Category Archives: My blog

GWT closing panel

The last session in the gwt.create conference was a discussion panel with speakers, GWT steering committee members and participants asking questions.

panel

Here some questions/ answers I managed to write down…

Q: What about Dart, GWT, say in two years?

The point is: GWT is here to stay, and even if Dart becomes the real next huge big thing, GWT will be one way to do it. Daniel reiterates that we should not think of one OR another.

Q: We don’t want to debug in JS in Chrome. Any way to do it better then SuperDevMode?

Well, no. DevMode is going away, and that is not GWT teams fault. Browsers are closing the door to required plugins, JS debuggers and source maps are the way to go.

SuperDevMode is no replacement or DevMode, but it has advantages, hence we start debugging in the target language/ platform. Besides, SuperDevMode is the only way to debug on mobile devices.

We also must take the improvements made by browsers/ debuggers in the past, so there is hope. IntelliJ is working on a remote debugger, nothing is known about Eclipse.

Attendees stated real life issues with SuperDevMode and the thread posed by not having DevMode ready, stable, fast, usable by the time the plugins stop working.

Discussion also showed that adoption might be better if setup is easier. Still, the worst case as described by Ray would be that we cannot use DevMode in the newest browsers – specifically Firefox and Chrome. We must keep in mind that actually DevMode is already broken in Safari and mobile devices.

Q: If you had a magical wand, what would you add/ remove change from GWT?

Nice question, here some statements.
Please don’t take them seriously, as no one really does have a magic wand…  :-)

  • Remove UI binder in favor of a HTML template mechanism
  • Incremental building
  • Vertical and Horizontal Panels (attendees cheer…  :-)  )
  • Kill the Widget system (because it was original made to fix IE6 memory leaks) in favor of a light widget model
  • Remove the “Serializable” interface support for GWT-RPC, as the implications on compilation are huge
  • Add runtime performance. More. Performance.
  • Configuration properties, compiler properties. Properties confusion.

jQuery for GWT without jQuery

gQuery is a purely GWT port of jQuery, this way taking all advantages of the GWT compiler.

The main purpose is to enhance UI elements:

gQuery can also be used to create completely new HTML based widgets, while still providing the full widget component interface.  This allows us to create lightweight widgets and repeat less code by using the core functionality provided by the library. Another very interesting part is that, by being entirely written in  GWT,  the compiled code will include only the pieces that were used.

Further, gQuery offers a set of functions very useful and missing in the core GWT distribution:

Like its counterpart, gQuery provides a plugin system. Existing plugins can be found here.

TURDUCKEN – How to handle big GWT projects?

How do you split big GWT projects?

A pattern used internally by Google (e.g. by adwords) was presented by Rob Keane and carries the name TURDUCKEN, which comes from “TURkey DUck chiCKEN”, that pretty much describes the approach…

turducken

When tackling big applications, you can either go for the monolithic one module approach, or try to split the application into many smaller ones with separate entry points, breaking the “single page” principle.

  • One module problems: one release, one build, very large if split not working, hard to test.
  • Many modules problems: full page reload, no split possible at all

According to Rob, at the end, multiple GWT modules is the only way to go… but how to handle page reloads?

The TURDUCKEN approach describes a surrounding global container, the first thing to load.  This way we still have a global single page GWT application that only reloads parts (submodules), providing a custom global shared place in the global container. For example,  the container could handle the overall history and the submodules containing their own entry points.

When a module should get loaded, you add the required script tag to load the corresponding module. All modules live then in the same container.

  • The container provides the main UI management, modules not going for the root panel anymore
  • CSS should avoid global style names (@external) to avoid conflicts (change body ID if you really need @external and must avoid collisions)
  • Introduce a custom history handler that does not change the URL directly, but propagates history changes via events to the container

To make inter app communicaton possible, you must create a global event bus hosted in the global container. This global event bus must be accessed via a JSNI based wrapper, wrapping and unwrapping of events must be implemented properly. One approach could be introducing GWT auto beans to serialize objects being passed back and forth between modules through the container.

Introducing a TURDUCKEN approach depends on number of teams, application size and submodules structuring. Most important: when using the actual common approaches typical to GWT rich client development, moving into such an TURDUCKEN approach should be possible.

GSS – Google Closure Stylesheet support for GWT

Surely anyone will agree that GWT badly requires a better CSS report. While the CSS resources introduced in GWT where a major step forward, CSS3 is here and it would really be great to have Closure Stylesheets working with GWT:

Closure Stylesheets is an extension to CSS that adds variables, functions, conditionals, and mixins to standard CSS. The tool also supports minification, linting, RTL flipping, and CSS class renaming.

GSS is a open source project at Github that brings a lot of CSS magic to GWT. It is planned to merge into GWT 3.0, but you can use it right now.

Unlike stated in the Github page, GSS does not require a trunk version of GWT as soon as you start using GWT 2.6…

GWT as an open source project, current status

Since GWT has been open sourced years ago, GWT mainly stayed an open sourced project run by Google. This has been changed with the introduction of the GWT committee and the big move into more openness.

Matthew Dempsky shared a few insights with the current state of GWT as an open source project. GWT finally detached from integral Google build process, moved to external GIT and Gerrit as first source of truth.

The GWT “re-opensourcing” and move to GIT started paying of. From 5% non Google patches in 2012 to actually 20% in 2013. Still rough spots in the review process, no official ownerships: only unofficial owners and un-owned code. Integration builds are still a problem, since testsuite too large, too expensive to run. Presubmit testing delivers fast response.

The build process is a work in process. The move to maven was stopped as seen as unfitting for GWT. The ant build files are working but are not good, there is some interest in gradle/ buck. Unfortunately there is no dependency management yet.