5 ms·
I think one could transpile to javascript compatible with the Google Closure compiler which does dead code elimination. Someone's probably already on it.
by dustingetz 11y ago
I think one could transpile to javascript compatible with the Google Closure compiler which does dead code elimination. Someone's probably already on it.
- emidln 11y agoGoogle Closure compiler seems to already support this out of the box: https://github.com/google/closure-compiler/wiki/ECMAScript6 https://github.com/google/closure-compiler/wiki/ECMAScript6 Edit: s/good/support/
- eatonphil 11y agoThat page says there are a number of features they aren't interested in supporting. Is there an actual list somewhere? I don't want to start using this then discover things I wanted to use just aren't supported.
- dustingetz 11y agoHave they figured out a solution to the string/property access problem preventing us from passing all js through Closure compiler? (To those who aren't aware, Closure compiler is already an excellent compiler stack, but it requires you write a specific subset of javascript[1], so real-world js written without specifically targetting Closure are generally not compatible. Closure compiler is not currently useful to a javascript developer who depends on the npm ecosystem) [1] e.g. write foo.bar instead of foo['bar'], so Closure compiler can do name mangling and dead code elimination. edit since i currently sit at zero points: my point being that you can't dead-code eliminate your dependencies, which is the whole point of using closure compiler instead of whatever other toolchain.
- Scarbutt 11y agoyou can use external libs but you have to write an extern file, the extern file only needs to reference the parts of the lib you use.
- lobster_johnson 11y agoCan you explain by what you mean by "requires"? We're using Closure to minify our code, and it works fine. We know that it's not able to do all the optimizations it can (it was made to follow Google's specific conventions, after all), but it still produces smaller code than minifiers such as Uglify, so it is useful.
- bpicolo 11y agoThe Closure compiler is definitely at it's best when you have all optimizations and are JSDoccing like they intend. While you get some out of the box, it's not the full power of it.