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

1,397 views
Skip to first unread message

Ahmad Bawaneh

unread,
Nov 22, 2018, 3:42:04 PM11/22/18
to GWT Users
Hi
I am happy to announce that i was able to build and deploy one of my applications using both J2CL and gwt2 at the same time.
you can browse both versions here 



for those who wants to to dig in and build the app i have prepared a github repository, find it here


happy J2CLing.. :-)

Lars

unread,
Nov 23, 2018, 3:51:40 PM11/23/18
to GWT Users
Cool! :-)

Any numbers about the app sizes, compile and runtime speed (compared between j2cl snd gwt)?

foal

unread,
Nov 24, 2018, 11:01:15 AM11/24/18
to GWT Users
Hmm... Looks like GWT wins. Yet.

GWT:

GWT.png



J2CL

j2cl.png




Stas

ahmad bawa3neh

unread,
Nov 24, 2018, 2:15:06 PM11/24/18
to google-we...@googlegroups.com
What i dont understand from the screenshots is why the load of the static resources should be so different?!

--
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 google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Vassilis Virvilis

unread,
Nov 24, 2018, 2:21:58 PM11/24/18
to google-we...@googlegroups.com
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?

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

   Vassilis



--
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 google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


--
Vassilis Virvilis

Thomas Broyer

unread,
Nov 24, 2018, 6:10:13 PM11/24/18
to GWT Users

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" (https://github.com/niloc132/j2cl/tree/app-building-tools) and an additional script to run the onModuleLoad (https://github.com/DominoKit/dominodo/blob/547699f501d0a85361827839f7cf005da82159d3/dominodo/dominodo-j2cl/src/main/java/org/dominokit/samples/App.native.js)

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".

Alina Grynenko

unread,
Nov 27, 2018, 4:36:57 AM11/27/18
to GWT Users
Hi, 
Im new to gwt. I try to build your project, but get 
Could not resolve dependencies for project org.dominokit.samples:dominodo-client:jar:1.0-SNAPSHOT: Could not find artifact com.vertispan.jsinterop:base:jar:1.0.0-SNAPSHOT in vertispan-snapshots (https://repo.vertispan.com/gwt-snapshot/) -> [Help 1]

What Im doing wrong?
Thanks.

Kirill Prazdnikov

unread,
Nov 27, 2018, 6:02:32 AM11/27/18
to GWT Users
I agree, if you compare GWT vs J2CL program, then it is fair to switch GWT to single permutation single-script linker before to measure.
And even more fair is to compare all if the compilers [GWT, J2CL, TeaVM], in terms of script size (compressed) and in terms of code performance (not DOM performance).

Ahmad Bawaneh

unread,
Nov 27, 2018, 10:45:06 AM11/27/18
to GWT Users
The GWT version already compiled with all properties collapsed

Ahmad Bawaneh

unread,
Nov 27, 2018, 10:45:54 AM11/27/18
to GWT Users
It seems i had a miss configured repository
can you please pull and try again?
sorry for this issue.

Kirill Prazdnikov

unread,
Nov 27, 2018, 12:59:35 PM11/27/18
to GWT Users
I mean different. Not collapsed, but single perm with sso linker.

Ahmad Bawaneh

unread,
Nov 27, 2018, 1:13:30 PM11/27/18
to GWT Users
I was waiting for next weekend to start running some experiments, such notes are really helpful..

Alina Grynenko

unread,
Nov 27, 2018, 2:00:48 PM11/27/18
to google-we...@googlegroups.com
Thanks a lot. I will try it. One more question: Why j2cl is working with maven in your application, I thought it works only with bazel? 

Am Di., 27. Nov. 2018 um 18:59 Uhr schrieb Kirill Prazdnikov <pki...@gmail.com>:
I mean different. Not collapsed, but single perm with sso linker.

Ahmad Bawaneh

unread,
Nov 27, 2018, 3:51:00 PM11/27/18
to GWT Users
even though j2cl inside google works with bazel and not maven, since j2cl was still private there was a work done to make it work with maven, @Colin built a tool that can run j2cl in a development which uses an old version of the closure compiler to allow incremental compilation, and now as j2cl is public the work has already started to make an actual maven plugin for j2cl, the initial work started based on Colin devmode, you can see the first version of the maven plugin in dominodo j2cl-maven-plugin, the master branch is simply running using that simple devmode.. thanks to Colin.


On Tuesday, November 27, 2018 at 9:00:48 PM UTC+2, Alina Grynenko wrote:
Thanks a lot. I will try it. One more question: Why j2cl is working with maven in your application, I thought it works only with bazel? 

Am Di., 27. Nov. 2018 um 18:59 Uhr schrieb Kirill Prazdnikov <pki...@gmail.com>:
I mean different. Not collapsed, but single perm with sso linker.

--
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 google-web-toolkit+unsub...@googlegroups.com.

Frank

unread,
Dec 17, 2019, 9:07:24 AM12/17/19
to GWT Users
It seems I am having the same or a simmilar issue as Alina had.
I have searched a little bit and read about adding the correct repository to the maven settings.xml. But  I have no clue what repo to add and in which profile.


mvn -Pdevmode
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building dominodo-j2cl 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.dominokit.samples:dominodo-client:jar:1.0-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.dominokit.samples:dominodo-client:jar:sources:1.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.590 s
[INFO] Finished at: 2019-12-17T15:05:13+01:00
[INFO] Final Memory: 12M/47M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project dominodo-j2cl: Could not resolve dependencies for project org.dominokit.samples:dominodo-j2cl:jar:1.0-SNAPSHOT: The following artifacts could not be resolved: org.dominokit.samples:dominodo-client:jar:1.0-SNAPSHOT, org.dominokit.samples:dominodo-client:jar:sources:1.0-SNAPSHOT: Failure to find org.dominokit.samples:dominodo-client:jar:1.0-SNAPSHOT in https://oss.sonatype.org/content/repositories/google-snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of google-snapshots has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
Reply all
Reply to author
Forward
0 new messages