The GWT landscape has been very active in the last year, so it seems like a good time to review the core technology and health of the ecosystem. Let’s take a look at a few of the highlights that will interest our GXT developers.
Note: This article has been updated with information on GWT 2.8 RC1.
The 2.8 beta was published to Maven Central in December, and RC1 is currently in smoke test. While we’re still waiting on the official release, the beta is stable and 15% of our customers told us in our recent survey that they’re already using it (read all of the details in our recent blog post, Survey Results Drive 2016 GXT Roadmap). The primary benefits of GWT 2.8 include performance, support for Java 8, and the long-awaited JsInterop. According to the most recent GWT Steering Committee notes, the main driver for the 2.8 final release is full Guava support.
Super Dev Mode launch is now faster, with Google reporting that Inbox compiles in only 3s vs. the previous 30s. This a huge and long-awaited improvement to the GWT development cycle. In addition, GWT 2.8 offers many runtime performance improvements. HashMap/HashSet now use ES6 maps when available to make them up to 3x faster. New Long emulation is up to 50x faster for smaller numbers (really good news if you’re writing a spreadsheet app with GWT!), and Double and Boolean types are no longer boxed, which brings further performance gain. (Source: GWT 2.8.0 RC1 release notes)
GWT 2.8 supports Java 8 syntax including lambdas and method references as well as Streams emulation. There are also third-party alternatives to support functional programming such as the recently-created rxjava-gwt library which offers emulation of many RxJava features. This project’s GwtObservable class offers an interesting new way to do form data binding (see the GwtObservable.fromHasValue() example on the project’s home page).
The final specification has been well received and numerous projects are using it to provide GWT wrappers for popular JS libraries (gwt-react, for example). Indeed, JsInterop is a core part of our strategy for GXT 5 and is being used to decouple GXT widget implementations from the parts of GWT that will be removed in J2CL (GWT 3). For a deep dive on JsInterop, see Googler Julien Dramaix’s presentation from GWTCon 2015.
It’s now pretty well known in the GWT community that the next version of the GWT compiler will eliminate many classic GWT features in order to modernize the framework and get the performance improvements possible with modern browsers. The biggest concerns for most projects are the forthcoming elimination of GWT-RPC, Generators, and of course, widgets (see below on GXT 5). According to our recent survey, the GWT community is still divided on whether to migrate to J2CL when it becomes available; however, the GWT community is developing alternatives to replace the legacy functionality. RestyGWT is a mature alternative to GWT-RPC, although still based on GWT Generators. The newer AutoREST for GWT uses APT and RxJava return types.
Sources at Google indicate that many GWT projects are building successfully with J2CL today and that it provides the hoped-for performance improvements, even over GWT 2.8. As demonstrated by Google Inbox, GWT / J2CL remains a key part of Google’s strategy to build cross-platform applications in Java for the Web, Android, and iOS (via j2objc).
The Sencha GXT team is hard at work on GXT 5, which will offer a path to J2CL for our customers. With GXT 5, you will continue to be able to use the familiar and powerful GXT widgets, although there will be some API changes necessary. The widgets are being re-implemented not only to work with GWT 2.8, but also to provide an easy migration path to J2CL when it becomes available. Here are a few of the highlights:
More Robust Event Model
GXT 5 will not be dependent on GwtEvent. Instead, it will use JsInterop to handle JS events directly. This offers numerous advantages over the current event handling system:
- Better orchestration of events in the widget hierarchy
- Superior focus handling not dependent on browser focus management
- Support for ARIA tabbing
- Support for MS pointer events
- More touch gestures (pan, rotate, pinch, swipe)
- Mouse gestures
- Event filters and other customization
Easier Widget Customization
As we’ve stated previously, GXT 5 will allow direct access to CSS to make it easier to customize widget appearance. Beyond that, GXT widgets are being refactored to more clearly separate widget behavior from widget appearance (skin). This will make it much easier for you extend widget functionality with new features. Furthermore, in preparation for J2CL, widgets are being implemented such that you can create a new widget Skin without having to GWT.create() an Appearance as in GXT 3 and 4. Also GXT 5 widgets are using JsInterop to interact with the DOM much like the Elemental 2 library that is expected with J2CL. By eliminating the dependency on the GWT Widget base class and other classes contained in gwt-user, GXT 5 is leading the way toward J2CL for GXT customers and will be an excellent widget library for use with J2CL.
GXT 5 will support responsive design containers using a 12-column grid system common to many responsive design frameworks. This will make it much easier to write applications that work well with a variety of devices and form factors. In addition, GXT 5 will offer a modern theme based on Google’s material design guidelines.
Overall, GXT 5 promises to be a highly performant and modern toolkit for building cross-platform web applications in Java. You can expect to see a preview of new capabilities at SenchaCon in November.
In conclusion, users of GWT and GXT can continue to look forward to modernization and performance improvements in upcoming releases. Customers routinely tell us that there is no way they could build their large applications without Java and GXT, and the GXT engineering team is committed to keeping pace with developments in the GWT compiler to enable our customers to build rich web applications using Java.