3 ms·
Great news, just yesterday I was dusting off my old Cljs project and now this happened. I was reading the docs on externs (how to describe your JS code - like
by jarpineh 10y ago
Great news, just yesterday I was dusting off my old Cljs project and now this happened.
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.
- drcode 10y agoIs this the document you were reading? https://clojurescript.org/guides/javascript-modules https://clojurescript.org/guides/javascript-modules This is the "new stuff"... if you were reading any other document you were probably reading about a far more painful process.
- jarpineh 10y agoYes, that was one, but this too: https://clojurescript.org/guides/externs https://clojurescript.org/guides/externs The previous way was painful. The one before that few years back was also very hard to get correct...