This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-08
Channels
- # announcements (20)
- # aws (16)
- # babashka (63)
- # beginners (75)
- # calva (35)
- # cider (2)
- # clj-commons (5)
- # clj-kondo (2)
- # cljs-dev (1)
- # clojure (90)
- # clojure-australia (3)
- # clojure-europe (16)
- # clojure-france (1)
- # clojure-nl (4)
- # clojure-uk (5)
- # clojurescript (7)
- # data-science (2)
- # datahike (1)
- # datomic (39)
- # emacs (31)
- # events (2)
- # figwheel-main (1)
- # fulcro (15)
- # gratitude (8)
- # helix (17)
- # holy-lambda (1)
- # introduce-yourself (1)
- # jobs (3)
- # kaocha (2)
- # liquid (1)
- # malli (1)
- # nrepl (2)
- # other-languages (1)
- # portal (76)
- # react (19)
- # reagent (9)
- # remote-jobs (1)
- # rewrite-clj (9)
- # shadow-cljs (31)
- # tools-deps (5)
- # xtdb (11)
my app stops working in :advanced mode after migrating to shadow - no error under browser console. Before that we had webpack + cljsjs for npm modules. We have no compilation warnings except some from libraries when set {:infer-externs :all}
. There are lots of them, so I wonder there are a list of functions from popular libraries that are known to break :advance compilation.
here's the warnings, if anyone is interested https://gist.github.com/myguidingstar/5d6c828578bdc6a9413f4c80290f4977
never mind, I've pinpointed the problem with rigid logging.
but glad to know the libraries are not relevant. Thank you very much
Was playing around with this: https://github.com/thheller/netlify-cljs ...and after updating some deps, it seems to fail in netlify-lambda and netlify dev b/c __dirname
is set to /
so shadow's attempts to import things from __dirname + '/../.shadow-cljs/...'
fail. Anyone know of a workaround there?
@cap10morgan are you publishing development code that way or is this during development? you should only actually use release
code in a production environment which will never use __dirname
?
Strictly local dev so far
it has been 3 years since I touched netlify so no clue what changed on their side. you can set :output-dir "functions"
in addition to :output-to "functions/api.js"
. then it won't use __dirname
either
OK I'll give that a try thanks!
that made it put a cljs-runtime
dir in the functions
dir and then it errors out with no such file or directory, open '/cljs-runtime/goog.debug.error.js'
one issue might be that netlify-lambda now errors out if netlify.toml is pointed at the same functions dir. they say to point it at e.g. functions-build
and then it does some kind of build and copy of api.js
over to that dir
hmm yeah that doesn't work. the code expects to run in the place where it was created by the compiler
ok, yeah, it works w/ npx shadow-cljs release lambda
I mean if you make it copy all the other files in cljs-runtime
too then it should be fine
everything in :output-dir
needs to be readable and should ideally not be further modified. otherwise it might mess with hot-reload and stuff
I tried symlinking cljs-runtime
but that didn't work b/c it's still trying __dirname + /cljs-runtime
so ends up w/ /cljs-runtime
but I can probably get by w/ release for now
don't know why its messing with __dirname
though? is this no longer following node rules?
I guess not 🤷
If I'm targeting the browser but building a library that I expect people to consume in a react app w/ webpack, etc., should I use :target :npm-module
or :target :node-library
instead of :target :browser
?
:node-library
makes a few too many assumptions about being for node
so I wouldn't recommend that
Shadow-cljs tuning: Apart from :jvm-opts ["-Xmx512m"]
are there any settings to limit the RAM and CPU consumption of shadow-cljs? Like reducing the number of files watched, disabling some services? I use a low end device to learn the basics of reagent.
You might find this useful, you can learn the basics of clojurescript and reagent without needing to run anything except a browser https://borkdude.github.io/scittle/
Alternatively you could use a cloud vm service of some kind to run the shadow process
Thank you all!