24 April 2020
ClojureScript 1.10.741 includes a new streamlined way to integrate with the
bundler like Webpack,
Metro, or any other build tool that
require. ClojureScript projects using this new target can
freely integrate libraries from
node_modules without handwritten externs or
additional configuration, yet still fully leverage REPL-driven development and
advanced compilation for the optimizable parts of their application.
If you want to cut to the chase and walk through a tutorial, head over to the new guide. For some history and context, read on.
Nuno Monteiro’s original post about Node module processing there’s a fairly
short paragraph about how under Node.js we actually generate Node.js
statements for libraries we know are coming from
node_modules. This was a
fantastic idea resulting in a very idiomatic experience when interacting
with Node.js. Over the next couple of years it became apparent that using
ClojureScript for Node.js was often simpler than web development. No longer, the
dependency resolution is either Node.js
require or ES6 import.
This feature is the result of many discussions and inspiration from some great projects in the ClojureScript community - in particular re-natal and shadow-cljs.