3 ms·
Have 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, C
by dustingetz 11y ago
Have 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.