Google Web Toolkit dumps compatibility for sake of upgrades

Two new versions of Google Web Toolkit are due, featuring support for Java 8 but sacrificing backward compatibility

development tools toolbox saw wrench hammer measure
Shutterstock

Google Web Toolkit (GWT), which lets developers build browser-based applications in Java and deploy them in JavaScript, is on track for major enhancements this year. The GWT road map calls for two upcoming upgrades, but the latter will break compatibility.

The technology was the subject of the GWT.create conference in Silicon Valley late last week, where Google senior engineer Ray Cromwell talked about its direction. With GWT 3.0 due around the fourth quarter of this year, plans call for breaking compatibility with previous releases so that developers can deprecate older technologies. Previously, compatibility was rigorously maintained.

“Now, because IE6, IE7, and IE8 are dead and there’s certain legacy things that we don’t want to support anymore because we need to target newer browsers and this new world of mobile, we want to deprecate these things,” Cromwell said. Developers who recompile apps to GWT 3.0 might find them failing and will need to edit code to get them to work. But GWT builders will continue developing the 2.x line. “We’re not going to leave those people out to rot,” said Cromwell.

GWT 3.0 will back idiomatic module/class generation featured in the ECMAScript 6 specification underlying JavaScript. ECMASCript 6-compliant code would be generated out of the compiler. In addition, GWT 3.0 includes more Java-friendly calling into JavaScript, via JS Interop Phase 2.

GWT 3.0 also covers Elemental 2.0 for browser API bindings. “Elemental 2.0 is basically a library that you can run yourself at any time, and it will actually go out and fetch the browser specifications from the WC3 consortium, download the latest copies, and it will generate all of the Java interfaces for the APIs,” Cromwell said.

Version 3.0 will feature faster Java collections for the likes of array lists and maps; it highlights DeltaJS support for updating JavaScript code too. “DeltaJS basically allows your app to ship down only the JavaScript code that’s changed,” when doing a new version of an application, Cromwell said. “It allows you to efficiently update like native apps do.”

The ServiceWorker API, which handles network requests in the browser, will be supported. It allows the use of applications offline. “If you’re on an airplane, you can have an application that launches while you don’t have Wi-Fi,” said Cromwell. Firefox and Chrome already support ServiceWorker, said Cromwell.

In the meantime, GWT 2.8 is due out within three months. Its main feature is support for Java 8, including lambdas. GWT 2.8 supports CSS 3.0 via Google Style Sheets (GSS), along with better debugging. JS Interop is featured for interoperability between Java and JavaScript. “It allows you to do cross-language calls between the languages very easily.” Also, users can look forward to faster production compiles in version 2.8.

Overall, Cromwell said, GWT produces small and fast code compared to handwritten JavaScript, and it leverages Java development skill sets, better performance, and cross-platform code-sharing with Android, as well as iOS via technologies such as RoboVM, he said. “There’s value in being able to share [about] 70 percent of your code base between your platforms.”

A developer at the conference, however, wanted Java 8 lambda capabilities sooner. “My only disappointment so far is I was really looking forward to Java 8 support,” said Arien Talabac, developer at security trainer SANS Institute. “It was hoping today I could use it. It sounds like it’s months away.” Lambdas reduce the need to write boilerplate code, he said. Still, Talabac remains a GWT advocate. “I like the concept of it in that JavaScript is a fundamentally difficult language to write large application in,” he said. “Java is a better choice for it. You’re more able to write an enterprise-scale application.”

GWT has 130,000 active developers monthly and debuted in 2006.

Copyright © 2015 IDG Communications, Inc.