This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-10
Channels
- # announcements (3)
- # asami (4)
- # babashka (21)
- # beginners (97)
- # calva (32)
- # cider (4)
- # clj-kondo (7)
- # cljdoc (1)
- # clojure (70)
- # clojure-europe (27)
- # clojure-nl (10)
- # clojure-norway (18)
- # clojure-uk (8)
- # clojure-ukraine (1)
- # clojurescript (5)
- # datalevin (7)
- # docker (1)
- # emacs (3)
- # fulcro (4)
- # girouette (4)
- # graalvm (2)
- # graphql (9)
- # gratitude (3)
- # honeysql (4)
- # hoplon (3)
- # hyperfiddle (7)
- # jobs (3)
- # kaocha (31)
- # lsp (23)
- # malli (7)
- # missionary (6)
- # nextjournal (9)
- # off-topic (6)
- # pathom (13)
- # polylith (13)
- # practicalli (3)
- # remote-jobs (3)
- # reveal (7)
- # schema (1)
- # sci (23)
- # shadow-cljs (31)
- # tools-deps (62)
- # xtdb (8)
If I add https://www.npmjs.com/package/bootstrap-icons as a dependency, how can I actually reference the svg files?
Ok, I'll just copy the SVGs, yolo
I am trying to build a cljs project into an npm module for import into a js project, I understand that using the :node-library may lead more fine grained control, but I haven't been able to get past the roadblock of the output of shadow for this project including e.g. var js = FS.readFileSync(filePath);
. Am I missing some obvious control on how I would tell the compile job to output a node-library suitable for a browser env?
use :target :npm-module
if you want to include in a webpack build or something like that
am I misinterpreting this guidance:
> If you plan to distribute code on NPM, then you may want to use the :node-library
https://shadow-cljs.github.io/docs/UsersGuide.html#NodeLibrary instead since it allows for a finer level of control over exports and optimization.
?
well, technically speaking :node-library
works too. just assumes the presence of node for compile
and watch
builds. release
build will also work in the browser
but :target :npm-module
with :runtime :browser
will work more reliable and also with compile/watch
thanks @thheller. Is it possible to do a release build of either node-library or npm-module without minified function fields? I'm not publishing to npm now, i'm taking a very legacy cljs app and working on getting it behaving correctly in a js project, and as it is not yet behaving well, the console errors are difficult to debug with the minifed output.
you can set :compiler-options {:optimizations :simple}
but that'll make the build much much larger
yeah, unfortunately the webpack dev build of the js app was OOMing with non release optimizations
what kind of JS integration are you looking for? CLJS using JS code, JS code using CLJS or both?
you can also go with option #2 here https://code.thheller.com/blog/shadow-cljs/2020/05/08/how-about-webpack-now.html
does anyone have any clue why this is occurring for me, with a threejs load?
I am working on a better repro… basically I have some code that absolutely works with shadow-cljs: https://github.com/sicmutils/mathbox-clj/blob/main/src/main/mathbox_clj/demo.cljs
But then I try and use the code from a different project with more npm deps and I get this error. Those files definitely exist Vector3
, Matrix4
, but something is weird about the way they’re written. what is causing the module$node_modules
etc output?
in fact it seems like shadow loads it fine… there is just this error below
expanded
might have solved it from a SLACK search… gotta get used to that still…
mismatched shadow version caused it all 🙂