Re the bundle target stuff https://clojurians.slack.com/archives/C07UQ678E/p1586791429463800 it suggests it'll be possible to write cljs libs which depend on npm libs, but it's not clear to me how that would work. Can someone pls explain?
@henryw374 deps.cljs
is a file that can be in your artifact
this file can declare {:npm-deps ...}
ClojureScript scans for all of these when installing node deps
trivial for any other tool to do that too
there's really nothing else you need to do
Thanks but npm-deps is not new... Is it new that it can be declared in deps.cljs?
nope
there's really almost nothing new in the :bundle
target
just tweaked stuff was already there + bug fixes
a lot of the changes are related to making it easier to build custom tools over the public apis
now that we've dropped Rhino / Nashorn / Graal.js
Krell the new React Native tool is also a dogfood project - helps show what's missing
Ok I didn't think that was new... But I read the post to mean there was something new wrt cljs libs and npm. I had heard ppl say a while back they thought npm-deps was heading towards deprecation... Apparently not then!
we decoupled a it from the Closure stuff a long time ago
the old documentation makes it seems like it's tied to Closure processing - it is not
Ok thanks
in fact it's trivial to switch a :bundler
project and try to force everything through Closure - won't work for React of course (w/o manual intervention)
but there's an interesting proposition here for libraries like say Transit.js
which could easily be written in Closure friendly ES6
granted you're not going to get much DCE because it's an encoder/decoder
but you get the idea
you could write a open source lib that you want JS users to directly consume/contribute that you also want to consume in ClojureScript but get DCE / code splitting
currently node_modules
handling is all or nothing - all :bundle
or all Closure but will probably spend some brain cycles on how to allow partitioning that's not cumbersome in the near future
btw, here is my repo for graaljs support using the new :target-fn compiler option https://github.com/nextjournal/clojurescript-graaljs