Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Can 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.


The 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.


you 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.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: