Monday, June 2, 2014

gwt-phonegap 3.5

I just finished the gwt-phonegap 3.5 releases and pushed it to maven central.

This is now fully compatible with Phonegap 3.5 and  GWT 2.6. It contains many bug fixes and improvements.

This version fully works with mgwt and already uses the new mgwt 2.0 for its showcase.
As always you can get the new version from google code or from maven central: 

<dependency>
      <groupId>com.googlecode.gwtphonegap</groupId>
      <artifactId>gwtphonegap</artifactId>
      <version>3.5.0.0</version>
</dependency>

Sunday, January 12, 2014

mgwt / gwt running on a the Tesla Model S

If you come the Silicon Valley these days you will spot Teslas everywhere, but not here in Germany. A couple of days ago I saw my first Tesla driving around in Munich, being a car nut I immediately needed to get my hands on one here.
I actually would like to replace my old BMW 5 series with something new and I was favoring a BMW M5 very much. When talking about cars in the US, I was always telling colleagues that a Tesla would not work in Germany for two reasons:

  • You will run out of battery on a german autobahn pretty soon, since driving high speeds is very energy consuming.
  • It does not have enough top speed (only 210 km/h)


Tesla just solved the battery problem by offering battery swaps as well as extending their super charger network. Today I can already drive from Munich to Dusseldorf without problems and this network is growing rapidly. Having the battery swaps means that you do not need to care about range anymore since getting new energy will only take 90 seconds.
The oomph that is provided by the performance plus version with its 600 Nm is quite exciting to drive, but it is still lacking in max speed. If I spent 125 thousand euros on a car, I expect it to at least go 250 km/h or even more. A BMW M5, a Porsche 911 turbo, Mercedes AMG 63, all these cars can easily hit 300 km/h on a german autobahn. This is not a theoretically number, people actually drive this fast in Germany. This is still a problem for Tesla in Germany, but other than that I would now prefer a Tesla any time over the other cars and will probably soon get one.

MGWT / GWT on the Tesla Model S


    After driving the car I also wanted to see how much the onboard system can actually do. This is running a version of the QT webkit based browser. The complete mgwt showcase was working and you could even think about using a Phonegap approach to build UIs for the car.
    Here is a picture of mgwt running:


    How cool is that?

    Thursday, January 2, 2014

    Profiling GWT applications with v8 and d8

    The v8 JavaScript engine has a command line version called d8 that can be used as a profiler.
    It can help you spot performance problems with your JavaScript in many different ways. If you want to get a good overview of how to profile JavaScript, here is a Google I/O talk on the subject: "Breaking the JavaScript speed limit with v8".
    Unfortunately the d8 profiler was not very useful for GWT applications (or any application that was compiled to JavaScript) in the past, since it highlighted problems in JavaScript with line numbers, which does not make a whole lot of sense for a GWT application. Compiling in pretty mode was no option either, since different code layout will lead to different optimizations in v8 (Currently v8 backs our of optimizing a function if it is too large, also counting comments). And of course you want to profile the same code that will be run by your users.

    This is why we added source maps support to the v8 profiling tools. Using a special GWT linker you can now profile your GWT application in d8 and get back Java line numbers. This is one of the things that we did to help the our colleagues to make Google Sheets as fast as possible.

    Here is how you can profile your GWT application:

    Build v8 locally

    Build your version of v8 using these instructions. After that make sure that d8 (most likely under out/native) and the tickprocessor (tools/mac-tick-processor or tools/linux-tick-processor or tools/windows-tick-processor.bat)  are available in your path.

    Create an entrypoint that runs your performance critical code

    Create a new GWT module with an EntryPoint that calls your performance critical code. In your gwt.xml file you need to add the linker, set the user agent and enable source maps:

    <define-linker name="d8" class="com.google.gwt.core.linker.D8ScriptLinker"/>
    <add-linker name="d8" />
    <set-property name="user.agent" value="safari" />
    <set-property name="compiler.useSourceMaps" value="true"/>

    Compile your GWT app

    Now you can just invoke the GWT compiler for your module. It will produce three files that you should move into one directory for your profile:
    • selection script: .nocache.js
    • actual program: .js
    • sourcemap: (located in WEB-INF/deploy//symbolmaps/_sourceMap0.json)

    Run the profiler

    This blog post does not cover all the details on how to use d8, this is much better covered by the v8 team, but most of the times for a GWT app you want to run:

    d8 -prof <modulename>.js

    (You want to make sure that all files are in the same directory and that you are running d8 from that directory)
    This will create a file called v8.log that contains all the information from that profile run. Now we will use the tick processor to analyze this file, but we also need to pass it the source map, so that it can give us Java line numbers:

    linux-tick-processor --sourceMap=<path to sourcemap> v8.log

    This will output a complete profile of your JavaScript. It will show you how much time you spend executing JavaScript (and which functions / Java methods), executing C++ or in library code. It also contains a drill down view of your profile.

    Sum up

    With the changes we made to v8 and GWT you can now use the great v8 toolchain to spot performance problems in your GWT applications. These tools will also allow us to improve the way the GWT compiler translates code in order to make it run faster as well as improving the standard libraries that come with GWT.  You can look forward to your GWT applications running faster in the future.

    Tuesday, December 31, 2013

    GWT.create conference aftermath

    I finally found some time to write on my impression of the first GWT.create conference in San Francisco and Frankfurt. I have been involved very early with the conference and helped in some aspects to make this a success, but it turned out even better than all the people behind GWT.create hoped.

    Before I go into any more detail let me quickly thank Vaadin, who not only invested a big amount of money and time to make this conference a success, but also made sure that this conference was not biased towards Vaadin and was a good platform for all people of the GWT community (such as Sencha, Readhat and others). 

    In both locations we had 646 attendees, which is huge for a first time conference, but what I liked even more is the fact that we had very good GWT content:  All the talks got an average rating of 4 out of 5.
    We had very exciting talks from many GWT team members that showed where we want GWT to be in one or two years time. 
    All the slides are already published on gwtcreate and talks will be published on youtube over the coming weeks, so if you could not make it, you still get a chance to watch the talks.

    One of the most valuable session was the panel discussion, in which we could listen to the communities input. I think the discussion around super dev mode and IE8 were very valuable and we will take our conclusions from that.
    I personally spoke to so many GWT developers that were building amazing things using GWT. I was completely amazed. One of the most notable things to me was a camera which uses GWT for its UI.

    Some thoughts on talks

    Ray's keynote was designed to give people an overview on some of the cool stuff we are working, such as:
    • JsInterop & zero effort JsInterop
    • Performance boosts
    • New Google products covering several platforms using GWT, such as  Google Spreadsheets
    • GWT 3.0
    • Java8 support
    GWT has been designed in 2006 to leverage the Java ecosystem for building client side web applications. At this time there was no JavaScript ecosystem (debugging was done with alert statements), but in 2014 there is a large JavaScript ecosystem and GWT developers should be able to benefit from this without any major efforts. This is why we are going to introduce a new way of consuming well written JavaScript libraries (JsInterop) without any extra work from developers. This is very exciting to watch in the keynote.
    Goktug's web components talk showed off how to use this for a new widget system in GWT. I think this was one of the most impressive talks on the conference, since it showed how easily GWT can sit on top of the JavaScript ecosystem.
    The new Java8 syntax with closures actually allows us to be more concise than JavaScript. We can finally get rid of all those nasty inline interfaces for callbacks.
    Ray also introduced one new Google product which is leading the way with writing once in Java and running your code everywhere: Google Sheets.
    Brian showed off his work on super dev mode and what we are going to do to make it as good or even better as dev mode. If you combine this with John's and Roberto's work to make the GWT compiler work incrementally, we have a very good story for developer productivity in 2014.
    Matthew presented on the status of the GWT open source project. We are seeing strong contributions from outside of Google. There was one we specifically wanted to highlight. Julien Dramaix presented with me on CSS3 and GSS support in GWT, which he did as a complete open source contribution. Erik presented on testing with GWT and his great open source project gwt-mockito and Rob on an architecture that we use inside of Google for really large applications called Turducken.
    There is so much more great content I want to talk about, but I guess I should leave this to separate blog posts.

    Combine all this work and we have a very good story for GWT in 2014.

    Since GWT.create 2013 was such a huge success, we are already planing on setting up something bigger for 2014. There is still time to get your ideas into the 2014 google moderator.
    I am very happy to see that so many people got involved with this conference and joined us in the contributor workshop. I felt so much appreciation for our work that I am really happy to be working on GWT and with this great community.

    Saturday, March 30, 2013

    gwt phonegap 2.4 released

    Today I got around to release gwt-phonegap 2.4.

    This is now fully compatible with Phonegap 2.4 and  GWT 2.5. It contains the new APIs such as the InAppBrowser and the Globalization API.

    This version fully works with mgwt.
    You can get the new version from github or from maven central:

    <dependency>
          <groupId>com.googlecode.gwtphonegap</groupId>
          <artifactId>gwtphonegap</artifactId>
          <version>2.4.0.0</version>
    </dependency>
    

    Tuesday, December 4, 2012

    GWT Survey results

    Today David Booth came through and together with Vaadin composed the complete results of the GWT survey. A really big thanks for all the work they have done!

    You will discover a lot of comments in the document from me, but let me outline a few important decisions. GWT is very healthy: about 90% of the people doing GWT would choose to use it for their next project as well.

    I was amazed by the number of people who are using mgwt / phonegap to build their projects for mobile.
    The three main things which I felt were missing from GWT (fast compiles, a better CSS3 parser and more great looking widgets) were named a lot in the survey.  The good thing is we are already working on the compile time with super dev mode which will have it's best days still ahead.

    Fast and beautiful widgets that leverage new browser features are still missing, but if you take a look at mgwt this can be done pretty easily. Why don't I build something for desktop as well?

    Those are just some quick thought, read through the report yourself and make up your mind. GWT is healthy with a very good community.

    Saturday, October 20, 2012

    mgwt 1.1.2 released

    Today I got around to releasing mgwt 1.1.2, this is a recommended update to all mgwt users. It is a a drop in replacement for mgwt 1.1.1, but it fixes a lot of bugs, such as:


    • Improved CellList
    • many css fixes
    • hide address bar support 
    • better permutation control
    • Improvements to GestureRecognizers
    • Bug fixes on MSearchBox
    • fixing android quirks
    • home screen offline support for iOS
    Here is a complete list.


    I encourage you to download the new version.
    It is also available from maven central:
    
    
    <dependency>
          <groupId>com.googlecode.mgwt</groupId>
          <artifactId>mgwt</artifactId>
          <version>1.1.2</version>
    </dependency>