Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT 2.7: What is the difference between -XjsInteropMode JS and -XjsInteropMode CLOSURE?

I tried out GWT 2.7 and was woundering what is the difference between -XjsInteropMode JS and -XjsInteropMode CLOSURE compiler flag?

like image 390
confile Avatar asked Oct 02 '14 22:10

confile


1 Answers

-XjsInteropMode JS will output standard deobfuscated javascript accessors (method names match up directly, bean getter/setters map to simple property access). I assumed that using CLOSURE option will add Closure type annotations to the output to ensure two-way type safety between Gwt and Closure... But Goktug has replied on G+, saying:

-XjsInteropMode CLOSURE was used to generate export code in a way
that was assuming closure goog.provide(...) statements exists in
the beginning of js (potentially produced and prepended by a linker).
It was not useful for general public.

I'm using past tense because the option is now removed from the trunk.

Anways, if you are interested in Closure with Gwt, the video is not up yet, but Ray Cromwell's talk about Google Inbox mentions how they support highly optimized, fast compilation of Gwt -> Closure Friendly JS -> Minified obfuscated JS.

When the video is up, check it out here: http://gwtcreate.com/videos/index.html Until then, here are the slides: https://drive.google.com/a/wetheinter.net/file/d/0B3ktS-w9vr8IS2ZwQkw3WVRVeXc/view

Finally, Ray's talk specifically about Js Interop: https://docs.google.com/a/wetheinter.net/file/d/0ByS1wxINeBWjeGYxbkJpamxFZ28/edit

Note that there is also a video for that talk pending. It's very good. You should watch them both when they are uploaded.

like image 83
Ajax Avatar answered Oct 13 '22 18:10

Ajax