Mitch Pronschinske is a Senior Content Analyst at DZone. That means he writes and searches for the finest developer content in the land so that you don't have to. He often eats peanut butter and bananas, likes to make his own ringtones, enjoys card and board games, and is married to an underwear model. Mitch is a DZone Zone Leader and has posted 2574 posts at DZone. You can read more from them at their website. View Full User Profile

GWT 2.0 Adds a Bunch of New Tools

12.09.2009
| 17801 views |
  • submit to reddit
Version 2.0 of the Google Web Toolkit is now available.  The new version of Google's Java centric toolkit for browser-based applications features a Development Mode, UiBinder, Layout Panels and more JavaScript code size optimizations.  The most notable new feature is a Chrome extension that allows developers to analyze any web application.  The extension is called Speed Tracer.

Speed Tracer metrics are taken from the low level instrumentation points of the browser to analyze web applications in real time.  JavaScript parsing times, DOM event handling, layout, painting, CSS style calculations, resource loading, timers, and XMLHttpRequests can all be monitored in a timeline.  Speed tracer also gives you advice through hints.  The interface contains two views: sluggishness and network.  The sluggishness view shows the UI's responsiveness over time and the network view shows network activity.  When developers find a performance bottleneck, GWT 2 allows them to select non-essential elements in an application and make them download only as they are needed, resulting in faster application start up.  Google's code page has the Speed Tracer source code for developers to check out.  Chrome 4.0, which is still under development, must be installed to use Speed Tracer.  For a deeper AJAX analysis tool, developers should try dynaTrace's free AJAX Edition and compare the tools.

The second version of GWT improves developer workflow with the UIBinder.  The UIBinder method allows designers to create declarative UIs in XML and give those files to developers for loading into the application at runtime.  This workflow is intended to speed up the transition of design elements into functioning applications.  The UIBinder template can include an associated CSS widget style that allows widgets to be used across different applications with the same look.  

GWT 2.0 also improves debugging with the new Developer Plugin.  Developers can use the plugin to debug in any browser with their preferred tools (e.g. Firebug).  The Development Mode works across the network to test web apps on any combination of browsers and operating systems.  Development Mode can be used in any Java IDE.  

GWT 2.0 also introduces CSS-based layout panels and compiler improvements.  With the layout panels, it is possible to build an application that looks the same on every browser.  The UIBuilder can be used in making the layout panels.  The JavaScript compiler for GWT 2.0 now utilizes "code splitting" to allow application startup without waiting for the whole thing to load.  The "splitting" function creates many split points by calling GWT.runAsync() and the compiler loads all necessary dependencies for a section of code.  The resulting JavaScript code is reduced in size by 3 to 20%.

To get started using the Google Web Toolkit, download DZone's GWT Refcard  Download Speed Tracer and the GWT SDK here.