Vaadin client engine generates javascript in run-time?

After reading through Vaadin book on its architecture, I still have a question. GWT is a compiler which generates javascript. Without any custom widget, I do not see any javascript in a sample Vaadin project. So I have to assume javascript is generated in run-time. When does Vaadin use GWT to generate javascript? Does the JavaScript code of the Vaadin Client-Side Engine contains the GWT-compiler?

Each Vaadin widget consists of to parts, a server side implementation (for example TextField.java) and a client side implementation (VTextField.java). The client side implementation is compiled to JavaScript with GWT. The client side is precompiled and distributed with the jar, so the user doesn’t need to worry about that.

If you make an application with Vaadin and only use widgets provided by Vaadin, then you don’t need to compile anything with GWT, as all the code you’ve written is executed on the server side and all the code that is executed in the browser are the client side implementations of widgets which have been precompiled.

Sometimes the widgets provided with Vaadin is not enough, so you’ll need to create some widgets of your own. If you’ve created a custom widget or if you are using a third party widget, then you’ll have to compile those to JavaScript with GWT. This task is done really easy with the eclipse plugin.

If you want to take a look at the precompiled javascript, open up the vaadin-6.x.x.jar and take a look at the VAADIN/widgetsets folder.

Hope this has cleared things for you :slight_smile:

  • Kim

Vaadin rocks. I am sold. No more waiting forever for the gwtc to finish.

Hi, is there a possibility to see the generated (not the precompiled) javascript code?

If I understand correctly what you want, maybe the -gen option of the GWT compiler helps with this.