I’ve used GWT for over half a year now on koopjeszoeker.be. Two weeks ago I decided to stop development with GWT and go with plain HTML and mootools for the autocompleter. I’ve used mootools already a lot and I’m really getting the hang of it.
Why? Why did I spend all this time developing in GWT and why did I decided to stop?
First of all, GWT is a fantastic framework for doing web development. I think it’s the best tool at the moment if you want to build the next GMail or an intranet application. For all those slow and lousy web interfaces (for timesheets, CMS, …), GWT could come to the rescue. But my site is completely different.
Some of the reasons below are not really related to GWT, but more to using ajax in general. It is my opinion however, that these problems are easier to solve with ’standard’ javascript libraries like mootools, prototype, dwr or scriptaculous since these have a nice way to add some ajax to certain DOM elements. For example, in GWT I had to subclass the autocompleter textbox so I could attach it to an input field that already existed in the HTML. Maybe all of this could by solved if GWT had constructors that accept a DOM id too.
SEO
I’m entering in a highly competitive segment where SEO is really important. Since most of the html is build with GWT, you end up with a pretty empty page for Google. I added some noscript tags, but this was not really helpful.
Adsense
Another problem were my adsense banners. Since I didn’t have a lot of content on the page, the banners were sometimes off topic. An even bigger problem was that the banners stayed the same when people searched for different keywords (since the ajax refresh didn’t trigger an adsense refresh). I solved this by doing the search with a page refresh instead of an ajax call. The ajax part of the site was limited to sorting, faceting, i18n and displaying tips.
Google Analytics
I’m also using Google Analytics. Although no real evidence exists, it would be naive to think that Google isn’t using this data. But because of the ajax calls, I don’t get as many pageviews as a static version of competing sites. Every visitor is seen as doing 1 page visit, while he may have browsed several pages. This makes my bounce rate in Google Analytics really high. This can’t be good for my Google rankings.
In Belgium we have CIM Metriweb, a kind of archaic tracking system that is used when marketeers look for sites that have many hits. I’m not currently using this, but this thing depends on pageviews if you want the big guys to donate to your site.
What now?
I wanted a fully functional HTML version, where GWT was injected in some places to replace the full page loads with ajax calls. However, I couldn’t find an easy way to do this. And once I succeeded, I found that I had almost no code left in GWT that was worth using it instead of mootools. So now, after a lot of research and experimenting, I decided that I’ll go for the plain-old html way and spiced up some parts with ajax (like the “so 2007″ textbox autocompleter).
I discovered the Blueprint CSS framework (version 0.7 now has semantic classes) and CSS sprites. I’ve used Kuler and read a lot about CSS tips and tricks. I even read a bit about usability.
And since I spend 3 hours a day on the train, I have time to redesign the site. Using blueprint, it really was easy and the result is a much better looking, stable, fast site. Check the homepage: it only has 1 css, 1 javascript, 1 gif and 1 jpeg, but there are 25 images! Ah, the magic of blueprint, sprites and jawr…
Update: please see GWT follow-up
You can use DOM ids for GWT UI elements. Or you can use libraries like http://gwt-widget.sourceforge.net/ that already do so.
I’ve tried the methods in the DOM class. However, I had several issues because most widget methods like add() only accept a widget, not an element. I also had problems with the event handling, because onclick event were not fired anymore (I’m sure there’s a solution, but I couldn’t find it).
What I wanted to do was something like DOM.getByCSS(”a.facet”) and then replace the href with an ajax call (which is easy in Mootools).
Couple of points:
1) GWT is more than just a widget library. You can totally ignore gwt-user if you want and implement a moo-like interface using GWT (and it will load and run faster)
2) Whether or not your GWT app is an empty HTML page with just a BODY tag, or if you attach Widgets to existing HTML is a matter of how you design your app. Using traditional JS libraries like ExtJS , you can also do 100% of page layout in Javascript and have almost no content in HTML.
3) Yes, the existing GWT Widgets are not designed to envelope/attach to existing DOM elements that well. However, there are well known workarounds.
4) You can use GWT-Ext or MyGWT libraries which do have methods for overlaying widget functionality onto existing DOM elements
I would point out, that if you just want to spray a tiny bit of DHTML functionality into an HTML app, then GWT is probably not for you, and I don’t believe Google has been encouraging people to use GWT just to attach a single autocomplete Widget toa page.
However, once you build a non-trivial DHTML app, the GWT approach will pay off, in terms of scaling the size of the code base, to debugging and rich tool chains, to superior size and performance characteristics.
GWT is not really about replacing jQuery or Moo or Scriptaculous for piece-meal AJAX effects.
-Ray
Thank you for your feedback. I agree that GWT isn’t a good fit for my site as it is now (and GWT never claimed to be used for this), hence the reason of this post. But probably I didn’t explain the reasoning very well.
Please see my follow-up post post.
As far as the google analytics thing goes, we do the following with our gwt app:
1. Make your app support the history mechanism in gwt and make each logical page view a new history item (this is also good for your users in that it makes their back button function)
2. in the historyListener for your app, just make a native call to the urchinTracker, i.e. if ($wnd.urchinTracker) $wnd.urchinTracker($wnd.location);
3. voila! instant inflated stats!
[...] Why I Dumped GWT Pieter goes into details as to why he doesn’t develop with the Google Web Toolkit after one and a half years with the toolkit. He goes over reasons like SEO, Adsense customization, and others. If you found this article useful, then Subscribe to the feed [...]
[...] Why I dumped GWT [...]
Hello!
Very Interesting post! Thank you for such interesting resource!
PS: Sorry for my bad english, I’v just started to learn this language
See you!
Your, Raiul Baztepo
[...] Why I Dumped GWT Pieter goes into details as to why he doesn’t develop with the Google Web Toolkit after one and a half years with the toolkit. He goes over reasons like SEO, Adsense customization, and others. [...]
Cant we use mod_rewrite for Search Engine index?
Great article! I am the architect of my site and I decided to do exactly what you are recommending for the same reasons you have mentioned. We have injected GWT in locations where we wanted to give the user a rich user experience.