Fork me on GitHub
#cljs-dev
<
2020-07-10
>
wcohen17:07:56

Is package.json + build.edn (rather than :npm-deps) now the best place for a cljs library (per https://clojurescript.org/guides/webpack) to note its js dependencies and a path to a working bundling method, which then assumes that downstream users will just need to be aware that they need to add those for themselves on their own?

lilactown17:07:42

CLJS libs that depend on npm libs should note them in deps.cljs

wcohen17:07:33

so is it fair to say that the bundle target with aggressive js hinting may solve npm usage and advanced compilation for the final stages of projects, but cljsjs is still a needed step for libraries? i thought i’d finally escaped generating externs!

lilactown17:07:25

the webpack guide doesn’t really go into it, but if you assume that people are using the :bundle target, then the idea is you place your libs npm deps in deps.cljs to tell downstream apps/libs to install them. then, use them throughout your lib code the same way it says in the webpack guide

wcohen17:07:55

oh. lovely. that’s perfect. thank you so much

lilactown17:07:26

this also operates well with shadow-cljs projects too