Fork me on GitHub
#shadow-cljs
<
2022-03-31
>
arohner04:03:47

Is detecting and hot reloading node_modules supported? If not, is there a way to trigger a reload if I can tell shadow that a node_module changed?

thheller05:03:57

@arohner touch node_modules/that-package/package.json will trigger a reload of that-package. well at least a recompile, hot reload is not really supported given how commonjs works

👍 1
pez13:03:19

@thheller shadow-cljs does not recompile macros in required files when loading .cljs files. Is this on purpose or to be considered a bug?

thheller15:03:38

macro reloading works just fine. if you have a reproducible example of unexpected behavior I'm happy to take a look

pez15:03:52

Here's a repo that a colleague of mine created: https://github.com/sam-pitch/macro_example

pez15:03:32

I first thought it was a Calva issue, but then I can repro it using shadow only. https://github.com/sam-pitch/macro_example/issues/1

thheller15:03:11

if you just slurp some stuff shadow-cljs can't know that this file is part of compilation

thheller15:03:21

as such it doesn't invalidate the cache and keeps using the old value

thheller15:03:32

you can either use the method described above

thheller15:03:35

or turn off caching

pez15:03:47

Thanks. I'll forward the solution you provided. Sounds like exactly what he wants.

pez15:03:05

Do you know why loading the example.cljc file in the ClojureScript REPL bypasses the cache?

pez15:03:30

(Only out of my curiosity)

thheller15:03:30

load-file does exactly what it says. it loads the file, without considering any cache.

pez15:03:08

Makes sense. Thanks!

isak18:03:54

Is there a way to get Cursive to send forms to a node-repl? I'm getting the "Cannot load ClojureScript form into Clojure REPL" if I connect with the Clojure REPL setup.

thheller18:03:58

yeah, just run (shadow/node-repl) in the Cursive CLJ REPL

1
isak22:03:13

What does the word optimized mean here in the build-report?

thheller05:04:52

size of the source file after optimizations. ie. how much is left over.

thheller05:04:26

can't show gzipped size since its not easy to tell how much a thing contributes to overall gzip size

thheller05:04:40

but yes, raw bytes before gzip

isak14:04:04

ok makes sense, thanks

isak22:03:55

DCE'ed, but before gzip?