Hacker News new | past | comments | ask | show | jobs | submit login

Sorry to ask another question, but one thing holding me back from a Clojure-oriented stack is JS interop. I know there's work being done on getting CLJS to work with npm and now there's this thing about global exports for foreign libraries[0]... for a new project I need to use a bunch of libraries not in CLJSJS.

How was your CLJS experience with JS interop? Would you still use ClojureScript if you had a lot of JS dependencies?




I'd still use CLJS. Just fighweel alone is worth it. I can see any code change in <1s and have the exact same UI state. It's just much faster for developing.

Interop is not bad, I don't do too much interop. I don't use npm-deps but just bundle the React builds separately and include them in the HTML. They rarely change and I set caching header to immutable so the browser will just read them from memory (my CLJS app changes multiple times a week). If you want to use a lot of NPM deps I'd recommend shadow-cljs, there has been a lot of development by the maintainer and it seems to work incredibly well for NPM deps. Feel free to ping me on the Clojure slack, there is also a beginners channel that is very active. And there is a shadow-cljs channel where the maintainer will quickly respond.




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

Search: