4 ms·
I know GWT isn't the most popular framework (it isn't really a framework, is it?), but I've been a fan of it for a while. It solves three critical problems that
by aabajian 11y ago
I know GWT isn't the most popular framework (it isn't really a framework, is it?), but I've been a fan of it for a while. It solves three critical problems that have plagued web development:
1. Cross-browser compatibility.
2. Code performance.
3. Code organization (there are many JavaScript frameworks whose selling point have been making JavaScript more organized).
But in regards to this article, one often overlooked feature of GWT is that dead-code is automatically removed from the compiled JavaScript:
https://www.quora.com/How-fast-is-GWT-compared-to-JavaScript-and-other-languages-that-compile-to-JavaScript https://www.quora.com/How-fast-is-GWT-compared-to-JavaScript...
Thus you don't have to include the entire Angular/React/Ember/JQuery whatever library just to get a few features for your site.
- Drakim 11y agoI'm not sure I understand, how can a framework "solve" code performance? Do you mean that it's faster than other frameworks?
- aabajian 11y agoThe article mentions load performance. Meaning the time it takes to download and setup the Framework. GWT compiles Java to JavaScript and leaves out code that will never run. JavaScript frameworks load functionality in case that functionality is required, even if you don't use it.
- techterrier 11y agomany javascript optimisers / minifiers do this
- warfangle 11y ago> JavaScript frameworks load functionality in case that functionality is required, even if you don't use it. Unless you use something like webpack to segment your codebase.
- aikah 11y agoSure but GWT == writing Java, downloading an heavy an complex SDK , and writing imperative UIs. Sure it comes with widgets but you can find the same widgets in JS. Compare with React,AngularJS and co : way more popular,declarative UIs , if you need static typing you can use Typescript which needs no heavy runtime. GWT might make sense for some LOB app for desktop but not for a mobile webpage.
- deleted 11y ago[deleted]
- DCoder 11y agoGoogle Closure Compiler [1] can also perform dead code removal, but it requires extra work annotating all public APIs and naturally it can't cope with dynamic/indirect calls. [1]: https://developers.google.com/closure/compiler/ https://developers.google.com/closure/compiler/
- warfangle 11y agoSo does UglifyJS. At least, obviously dead code (e.g., if(false) {} )