Fork me on GitHub
#shadow-cljs
<
2022-09-07
>
hanDerPeder11:09:34

can I reload my npm dependencies without restarting the repl?

Derek15:09:49

I believe you can just touch package.json

thheller16:09:07

the answer is pretty much no. npm dependencies are not built with hot-reload in mind, so it very very rarely works and more often just messes things up

đź‘Ť 2
hlship15:09:10

Is there documentation about the ["npm-lib" :as alias] :require form? AFAIK it's specific to shadow-cljs? I've been up and down the docs and there's only a sideways reference to it.

hlship15:09:27

🍳 I just found that too, don't know how I missed it. Thanks!

đź‘Ť 1
hlship15:09:54

Is that doc out of date? I picked up this form

["react-flow-renderer" :as rfr :default ReactFlow]
from another answer elsewhere and it looks like the :default part is related to the $default suffix in some examples in the users guide.

Derek15:09:27

I think :default was shadow specific. ClojureScript proper added “$default”

Derek15:09:36

I could be wrong there

thheller16:09:52

:default was shadow-cljs only yes, the $default is the official way. and the string require syntax otherwise is exactly the same as in CLJS, not shadow-cljs specific in any way. never was, except for the :default addition.

hlship19:09:51

Thanks; I couldn't find any documentation for this pattern in shadow-cljs or clojurescript.

thheller20:09:21

not much to it really. just using a string instead of a symbol since some npm packages can contain chars that would make for invalid symbols

thheller20:09:36

"@mui/core" etc

hlship14:09:36

Right, it was just the :default keyword that doesn't appear in documentation.

thheller17:09:33

yeah, I should have probably left a mention. I removed it when the official $default stuff was added to CLJS to not confuse users

dabrazhe16:09:16

Would it be possible to migrate an app running on Clojurescript—Figwheel—Electron to run on shadow-cljs - browser combination? I am not familiar with Figwheel, but used to run shadow-cljs previously.

thheller17:09:15

sure. electron works just fine, just as in figwheel.