Saturday, January 31, 2015

Re: Why doesn't GWT just export everything automattically

That's a good point. I understand why they don't export everything automatically now, but if they won't export everything automatically then I want an easier way to export classes without changing them. The most common reason to not change code in order to export it is if it's in a library. Messing with a library's code would be a lot of trouble. GWT exporter's mechanism for exporting classes without changing them is also difficult.

On Saturday, January 31, 2015 at 6:00:29 PM UTC-5, Peter Donald wrote:


On Sun, Feb 1, 2015 at 8:58 AM, Joseph Gardi <jgle...@gmail.com> wrote:
right now GWT will export things if you tell using GWT exporter. In the GWT 3.0 it'll you can use JsInterfaces etcetera which is much better than GWT exporter and built into the compiler. It seems like it'd still be very complicated to build a hybrid app with GWT and JavaScript because you have to tell the compiler what things to export. Why doesn't GWT just export everything automatically? This would be a dramatic simplification. I understand that there might be a small performance cost but I think it'd be worth it. Doesn't regular javaScript code remain accessible when minified? I don't see why GWT shouldn't do the same.

GWT uses an optimizing compiler not a transpiler and minimizer, so GWT does more than just convert java to javascript and minify it. It removes any code it can determine that is not being used. It also rewrites code that is used to be far more optimal, which often results in methods/fields being elided. If "all" code was exported then it could not perform these optimizations and the performance would be intolerably slow. I don't know how GWT exporter works but I presume it is by identifying further entry points that can't be optimized away. 

--
Cheers,

Peter Donald

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" 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 http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment