Using JavaScript libraries from ClojureScript involves two distinct concerns:
- Packaging the code and delivering it to the browser
- Making ClojureScript code that accesses JavaScript libraries safe for advanced optimization
Right now, the only single tool that solves these probems reliably, optimally, and with minimal configuration is shadow-cljs
, and so that is what I favor. In paricular, shadow-cljs
lets you install npm modules using npm
or yarn
and uses the resulting package.json
to bundle external dependencies. Below I describe why, what alternatives there are, and what solutions I disfavor at this time.