ClojureScript 1.9.456, Externs Inference and Comprehensive JavaScript Modules
groups.google.com
groups.google.com
ClojureScript (via Closure) can advance compile them to 32K
dead code elimination works"
https://twitter.com/swannodette/status/825384686629355520
This only worked because he wrote a program which didn't need every feature of react's library. YMMV.
That said, these days I wouldn't use Closure raw. The tooling is just awful, years out of date. ClojureScript doesn't have that issue though. It gets all the benefits without the crappy tooling.
Congrats on this great release. We're all looking forward to what comes next!
I was reading the docs on externs (how to describe your JS code - like a 3rd party library - Closure compliant for its API surface). Could it be possible to make Closure's advanced compilation work without name mangling and thus skip the need for externs? Or is there something else going that Closure requires?
Having read about running Babel in Cljs project on Clojurescript site, I'm now contemplating using TypeScript with my Cljs project. There was just now an article on HN about using Angular with Closure, and someone pointed out a library that can convert TypeScript to Closure annotations. It feels like having the best of both worlds: bearable JS when you have to use it and powerful Clojure to rely on. This method would probably work by having TS compiler and Tsickle produce JS + annotations and importing that through CommonJS module support into Cljs. I'll have to make a test for it.
This is the "new stuff"... if you were reading any other document you were probably reading about a far more painful process.
The previous way was painful. The one before that few years back was also very hard to get correct...
It's really a killer feature that allows generating externs almost pain-free! I'm making the jump to advance compile my React Native ClojureScript code because of that. :)
All I want is a ClojureScript Webpack loader.