Monday, February 13, 2017

Re: JsInterop Question regarding execution in index.html


Thanks that worked! Given that this flag was off by default,  what are the main ramifications of leaving it on?


The flag is not active by default because your project might depend on GWT libraries that are also published as pure JS libraries by exporting the GWT code to JS using JsInterop (like you did). In that case all the exported classes/methods are considered entry points to your GWT app and the compiler has less opportunities to optimize any code that depends on it because it does not know how (and if) JS calls into your GWT app.

So basically if this option would be active by default, chances are that some projects compile to a larger final JS output because less optimizations have been done.

If you use newest GWT snapshot builds you can actually provide multiple regex to define which classes are allowed to be exported to circumvents the above issue. That way you can only export your own stuff and nothing from any library you might use. See: https://gwt-review.googlesource.com/#/c/17581/

-- J.

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

No comments:

Post a Comment