A Preview of GWT 2.0

Posted on Juli 24, 2009

Google Web Toolkit (GWT) is an open source set of tools that allows web developers to create and maintain complex JavaScript front-end applications in Java. It is licensed under the Apache License version 2.0. The GWT’s mission statement focuses on radically improving the web experience for users, by enabling developers to use existing Java tools to build no-compromise AJAX for any modern browser.

Google is set to launch GWT 2.0 later this year. The progress of GWT has been slow but steady over the years. Let us explore the road traveled so far and what lies ahead

The miles travelled…

Google promises much more with the GWT2.0 version scheduled to release later this year. Its various versions have been made available in the following sequence, with 2.0 following…

  • GWT 1.0 May 17, 2006
  • GWT 1.1 August 11, 2006
  • GWT 1.2 November 16, 2006
  • GWT 1.3 February 5, 2007
  • GWT 1.4 August 28, 2007
  • GWT 1.5 August 27, 2008
  • GWT 1.6 April 07, 2009
  • GWT 1.7 July 13, 2009

The launch…

And in comes the GWT 2.0 scheduled to be launched later this year. There is a lot on offer for this new version as Google promises to improvise it. GWT 2.0 contains huge improvements, including dynamic script loading, a new catalog of compiler optimizations, and a new approach to hosted mode debugging that uses the native browser.

The hosted mode is a key to productive development and it helps in debugging, editing etc. The problem is that the hosted mode browser is too special e.g. on Linux, hosted browser is an ancient Mozilla, hard to simulate interactions with other technologies (e.g. Flash) and it is impossible to debug browsers on non-dev OSes (e.g. IE from Mac). The GWT solves these problems by making hosted mode work with most native browser and make it work across the network.

Another huge advantage will be the compiler enhancements that come with the new kit. This new version promises much faster compilations, size, speed and obscurity benefits.

A new feature is the developer-guided code splitting. Often the compiled script size can be a problem because it holds all the code and can grow very big. Hence, the initial download can be too slow; UI hangs during script parsing etc. GWT 2.0 provides a solution, in code splitting by using- runasync. It is intentionally developer-guided and async. It intentionally forces you to think about failure paths. The split point doesn’t necessarily split. The compiler decides how to cluster code and it is guaranteed to be correct, ordering-wise.

Another new feature is the ClientBundle which generalizes ImageBundle to arbitrary resource types. With ClientBundle not only images are bundled together, all the resources (like CSS) are getting bundled. The obvious advantage is that only one file has to be downloaded, hence, less HTTP requests and faster download. Additionally, resources like CSS are getting optimized for size. At the Google I/O presentations it was also mentioned that in later versions ClientBundle probably also handles binary resources using Base64.

In GWT 2.0 there is the possibility to create a RPC blacklists which tell the RPC subsystem to skip types that you know aren’t ever sent across the wire and so doesn’t get compiled and stuffed into the code base. GWT 2.0 also promises a faster, easier and more predictable layout (at last). The standards mode provides new leverage including constraint-based layout that actually does what you say and also you’ll never have to hook the window resize event again. There is an updated set of Panels in GWT 2.0.

Version 2.0 will bring GWT a huge step forward and boost performance for developers and clients. It is not official, but 2.0 maybe also brings a new XML based markup language to define the layout. My guess is that the syntax will be close to HTML. Let’s hope that the new version attracts more GWT developers and which hopefully results in more widget libraries and extensions.

Lingui.st - Online Resource Editor, Manage your Ruby/Rails, Java, .Net and C++ language files with ease

Related posts:

  1. JavaFX preview is out (and has an expiration date)
  2. JavaOne 08 will be about JavaFX
  3. New details about Google OS
  4. Google App Engine supports Java
  5. Android SDK 1.5 released

Tags: ,

25 Responses to “A Preview of GWT 2.0”

  1. Hauke
    Jul 26, 2009

    A new XML based markup language to define the layout? – Oh my god. That could be the day that GWT dies for me.

    Either full developer created (i.e. Java based) layout or using the web’s standard methods (HTML & CSS). Not AGAIN another reinventing the layout mechanism in another XML grammar.


  2. Helmut M. Juskewycz
    Jul 26, 2009

    @Hauke
    as far as I remember it was mentioned in this talk http://code.google.com/events/io/sessions/GwtPreviewGoogleWebToolkit2.html
    However, I am sure that you don’t have to use XML and that you can always use a purely Java layout. I think that many developers
    are really looking forward to it.


  3. Hauke
    Jul 26, 2009

    If there are multiple ways to achieve the same goal, all will be used (and, worse, abused on the way).
    So as long as I am not working on a private project (without using any additional libraries) I will stumble upon all possible ways to do layout – and they will be mixed.
    If XML is the choosen way to do layout in GWT, ok, but then let it be the only way.

    I think it is an horrible idea. The existing XML layout languages are not successful for good reasons.

    This is only a single one of the improvements of GWT (which is, I don’t want to be mistaken, a great framework). But as the whole point of the GWT is presentation logic, it is a quite important one.


  4. Richard Vowles
    Jul 27, 2009

    XML layout works perfectly well for Android, and given GWT apps are “apps”, there is no reason it won’t work for GWT just as well.


  5. jem
    Jul 27, 2009

    The xml layouts used in android are very clever and usefull. Its really nice not having the gui laid out in lots of Java code and in some cases can really aid the development process. You can still do it in java though. Perhaps they will be using similar techniques to this android method


  6. Conrado
    Jul 28, 2009

    Hi there. Congratulations for the great work so far.

    I would like to suggest the support of other layout mechanisms, like those which we found in Qooxdoo Framework. This could let us develop depending much less on CSS editing, what is very error-prone and browser-dependent.

    By the way, don’t think that laying out with XML is a good idea. Better to do with code, and precisely. :)


  7. Itzik Yatom
    Jul 28, 2009

    It does not matter if it will be XML or HTML with a specific namespace, the need is clear – There are cases that the layout is complicated with a lot of panels and widgets, then GWT in its current version is too verbose.

    A more easy and clear way is to describe the layout in a declarative way.


  8. xavier
    Jul 28, 2009

    great news about compiling enhancements, and hosted mode improvements, less good news about xml as layout language… One of the strengths og gwt is the homogeneous side og the approach…Using XML (which particularly verbose too) is against this principle… Personnally, I would prefer to include in the java subset of GWT the possibility to define the GUI through a JFX like syntax or the groovy one.


  9. [...] bietet das Google Web Toolkit wirklich soviele nützliche Features? Seit der Bekanntgabe von GWT 2.0 werden die Argumente immer überzeugender. Gerade folgendes Feature ist für alle Webdesigner interessant: Another new feature is the [...]


  10. Hauke
    Jul 28, 2009

    Not to be misunderstood: My preferred way would be HTML/CSS (e.g. like Wicket does). Separating layout and logic is a good thing. I just don’t want another intermediate language.


  11. hezamu
    Jul 29, 2009

    Better hosted mode and code splitting in particular sound great, we’re sure to integrate 2.0 to Vaadin ASAP it comes out.

    In case someone here doesn’t know Vaadin it’s a server side UI framework that allows you to build RIA applications in 100% Java. GWT is used in the client side, but Vaadin takes care of all of the RPC and AJAX/HTML stuff if you wish. Layouting is done using our server side API, themeing with CSS, and GWT makes it easy to extend the client side if needed.

    Check out the demo at http://demo.vaadin.com/sampler/


  12. Aditya
    Jul 30, 2009

    As far as i’m concerned, it is really a gud idea to have the XML define the GWT layouts. The reason that i would reckon is, if we were to define the layouts in java, lot of redundant code that we need to write which would even lose the readability of it at a later point of time. Where as if we consider XML, we can just write one tag and that’s it.
    For example, a developer (like me :) ) / new learner would surely consider

    (over)
    Panel p = new Panel();
    p.setId(“someId”);
    p.setTitle(“someTitle”);
    RootPanel.get().add(p);

    I’m saying that neither pure XML nor pure Java is perfect to define the layouts. If GWT is thinking in a way to let the developers define the layouts using both of these languages, that would really be a nice feature to have in the future versions of it.


  13. Aditya
    Jul 30, 2009

    As far as i’m concerned, it is really a gud idea to have the XML define the GWT layouts. The reason that i would reckon is, if we were to define the layouts in java, lot of redundant code that we need to write which would even lose the readability of it at a later point of time. Where as if we consider XML, we can just write one tag and that’s it.
    For example, a developer (like me :) ) / new learner would surely consider

    <panel id=”someId” title=”someTitle” styleClass=”someCssStyle” >
    </panel>
    (over)
    Panel p = new Panel();
    p.setId(“someId”);
    p.setTitle(“someTitle”);
    RootPanel.get().add(p);

    I’m saying that neither pure XML nor pure Java is perfect to define the layouts. If GWT is thinking in a way to let the developers define the layouts using both of these languages, that would really be a nice feature to have in the future versions of it.


  14. Perit
    Aug 14, 2009

    I think having XML layouts is a real improvement. GWT is great in writing the application logic but creating a user interface via code is cumbersome and tiring. Many people consider Drag-and-Drop WYSIWYG visual editors to develop UIs, using a declarative language is probably the second best option, and I believe coding is the last. This XML thing has also two indirect benefits; UI designers with next to nothing programming experience can create GWT UIs and probably it will be much easier to create visual designers for GWT using this new XML technology.

    By the way, does anyone know whether it will be possible to send a GWT client a dynamically generated XML layout from the server so it can generate UI dynamically?


  15. Pavel Lahoda
    Sep 14, 2009

    @Richard Vowles: Fortunately, the XML layout is not the only way on Android. There are many cases developers complained about problems with the XML layout (especially once your project gets a little more complex)…it would be interesting to see how big percentage of Android apps are actually XML-layout based. I went for programatic layout completely and I would say my productivity raised significantly.

    I would say XML based layout for GWT is a bad decision. If anyone needs it, he/she can do the layout in (X)HTML and only attach individual components to it (in the Android style). The GWT team should rather concentrate on getting the current layout to work well and consistently across browsers. We don’t need any more chevronitis (XML poisoning).


  16. AlexanderT
    Okt 14, 2009

    There is no reason that speaks against an XML based markup -> XML is clean, easy to read and extreme successfull -> XHTML, XML ,XAML(!)


  17. ygor
    Okt 19, 2009

    It’s good to avoid usage of XML for programming tasks if possible, but …

    In case of GWT, usage of XML is justified. Think of Groovy Builder syntax. (http://groovy.codehaus.org/Builders). If Java had this kind of syntax to naturally define tree structures, XML layout would be redundant. Since this is not the case, XML is the best possible choice, since classic imperative way to define UI is awkward. And in case of GWT, validity of XML layout is checked at compile time and bound to a Java interface – so I must say, I look forward to this feature.


  18. Elias Balasis
    Dez 08, 2009

    I understand that XML declarative layout may help less experienced UI designers/developers and UI designer tools.
    However, XML although quite strong, clean and easy to understand, when it comes to logic, nothing can be compared against a source code fragment.
    In other words, there will be many cases where XML is simply not enough.
    (same holds true for other XML based declarative ways)
    I vote for traditional ways. Besides, why re-invent the wheel?

    Finally, I would recommend the use of both techniques but with emphasis on traditional source code based UI declaration.


  19. Amy
    Apr 23, 2010

    I think having XML layouts is a real improvement. GWT is great in writing the application logic but creating a user interface via code is cumbersome and tiring. Many people consider Drag-and-Drop WYSIWYG visual editors to develop UIs, using a declarative language is probably the second best option, and I believe coding is the last. This XML thing has also two indirect benefits; UI designers with next to nothing programming experience can create GWT UIs and probably it will be much easier to create visual designers for GWT using this new XML technology.

    By the way, does anyone know whether it will be possible to send a GWT client a dynamically generated XML layout from the server so it can generate UI dynamically?


  20. Ian
    Apr 27, 2010

    Not to be misunderstood: My preferred way would be HTML/CSS (e.g. like Wicket does). Separating layout and logic is a good thing. I just don’t want another intermediate language.


  21. Christopher
    Apr 27, 2010

    I understand that XML declarative layout may help less experienced UI designers/developers and UI designer tools.
    However, XML although quite strong, clean and easy to understand, when it comes to logic, nothing can be compared against a source code fragment.
    In other words, there will be many cases where XML is simply not enough.
    (same holds true for other XML based declarative ways)
    I vote for traditional ways. Besides, why re-invent the wheel?

    Finally, I would recommend the use of both techniques but with emphasis on traditional source code based UI declaration.


  22. Rob
    Apr 27, 2010

    I think having XML layouts is a real improvement. GWT is great in writing the application logic but creating a user interface via code is cumbersome and tiring. Many people consider Drag-and-Drop WYSIWYG visual editors to develop UIs, using a declarative language is probably the second best option, and I believe coding is the last. This XML thing has also two indirect benefits; UI designers with next to nothing programming experience can create GWT UIs and probably it will be much easier to create visual designers for GWT using this new XML technology.

    By the way, does anyone know whether it will be possible to send a GWT client a dynamically generated XML layout from the server so it can generate UI dynamically?


  23. Jonathan
    Apr 28, 2010

    I understand that XML declarative layout may help less experienced UI designers/developers and UI designer tools.
    However, XML although quite strong, clean and easy to understand, when it comes to logic, nothing can be compared against a source code fragment.
    In other words, there will be many cases where XML is simply not enough.
    (same holds true for other XML based declarative ways)
    I vote for traditional ways. Besides, why re-invent the wheel?

    Finally, I would recommend the use of both techniques but with emphasis on traditional source code based UI declaration.


  24. Simon
    Apr 28, 2010

    @Richard Vowles: Fortunately, the XML layout is not the only way on Android. There are many cases developers complained about problems with the XML layout (especially once your project gets a little more complex)…it would be interesting to see how big percentage of Android apps are actually XML-layout based. I went for programatic layout completely and I would say my productivity raised significantly.

    I would say XML based layout for GWT is a bad decision. If anyone needs it, he/she can do the layout in (X)HTML and only attach individual components to it (in the Android style). The GWT team should rather concentrate on getting the current layout to work well and consistently across browsers. We don’t need any more chevronitis (XML poisoning).


  25. Tony
    Apr 28, 2010

    As far as i’m concerned, it is really a gud idea to have the XML define the GWT layouts. The reason that i would reckon is, if we were to define the layouts in java, lot of redundant code that we need to write which would even lose the readability of it at a later point of time. Where as if we consider XML, we can just write one tag and that’s it.
    For example, a developer (like me :) ) / new learner would surely consider

    (over)
    Panel p = new Panel();
    p.setId(“someId”);
    p.setTitle(“someTitle”);
    RootPanel.get().add(p);

    I’m saying that neither pure XML nor pure Java is perfect to define the layouts. If GWT is thinking in a way to let the developers define the layouts using both of these languages, that would really be a nice feature to have in the future versions of it.



Leave a Reply

Subscribe