Saturday, November 24, 2018

Re: First application working as both J2CL and gwt2 at the same time

On Saturday, November 24, 2018 at 8:21:58 PM UTC+1, Vassilis Virvilis wrote:
Thanks for posting this.

Not sure if I read this correctly.

Assuming all other being equal (can't really be sure):

 GWT:  Loading of *.cache.js takes 433ms for 75.8KB - there is also app.nocache.js 95ms for 3.3KB
 J2CL: Loading of app.js takes 490ms for 70.5KB

The difference in timing is of course a network artifact since j2cl has less code to transmit.

Does j2cl has something equivalent of *.nocache.js. How it is linked? Does it use an iframe as GWT or is directly loaded in the document window?

J2Cl is only a Java to JS transpiler. JS compilation is done by the Closure Compiler. There's no notion of "permutation" (or, more accurately, it's a manual task, generating separate scripts, with no built-in equivalent to a selection script –GWT's *.nocache.js; btw even for GWT, Google uses server-side selection, have a look at the HTML source of Google Groups for an example).
In the case of this app, the code is loaded directly into the document; the "linker" is kind of a "hack", based on Colin's preliminary work to build a "devmode" ( and an additional script to run the onModuleLoad (

I could see a lot of GWT programs breaking if the link model changes...

J2Cl != GWT3

"Linkage" is part of the things that still need to be done for GWT3: how to handle permutations with the Closure Compiler? How about code splitting?
For apps that don't need i18n and/or code splitting, J2Cl + Closure Compiler (and the various J2Cl-compatible libs that are being developed now), and a simple "bootstrap script" (to create the entry point and call its onModuleLoad), should "just work".

You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment