3 ms·
That's the secret sauce that ClojureScript relies upon for tree shaking, dead code elimination and other optimizations. The Closure library is also used for bui
by fulafel 9y ago
That's the secret sauce that ClojureScript relies upon for tree shaking, dead code elimination and other optimizations. The Closure library is also used for building blocks of the CLJS runtime.
https://www.clojurescript.org/about/closure https://www.clojurescript.org/about/closure
- yorwba 9y agoSure, but it can be used on all things JavaScript. I guess I'm just confused why it'd be brought up as specific tooling for ClojureScript.
- KingMob 9y agoThat's actually not true. The Closure compiler has certain restrictions on the Js it accepts for advanced mode compilation, so you can't throw just anything at it. The advantage is best-in-class dead code elimination, which is also why Closure was chosen; to distill the CLojurescript standard library into just the parts needed for a web page requires good DCE. Recently, other Js projects like Rollup and Webpack have gotten good DCE, but when Clojurescript was started, there were no other serious contenders.
- bpicolo 9y agoIn the context of clojurescript you get 'advanced' optimizations free just by writing clojurescript. In JS you have to buy outside the modern JS ecosystem entirely. The closure compiler doesn't play well with any modern JS tooling, but modern JS tooling is nowhere near as capable at dead-code elimination, minification, and code-rewriting.