Fork me on GitHub
#shadow-cljs
<
2022-07-18
>
roklenarcic07:07:34

I’ve got a question: is it normal that namespace reloading on changes stop working if you’ve got a Warning. Whenever I save a file the code automatically compiles and the browser starts running the new code immediately. But if I’ve got a warning then only the compile happens, the browser still runs the old code. The warning I don’t really know how to get rid of:

59 |                   (if (satisfies? obj IWithMeta)
-----------------------------^--------------------------------------------------
Cannot infer target type in expression (. IWithMeta -org$clojars$roklenarcic$indexed-db$store$obj$)

thheller07:07:42

wrong argument order. should be (satisfies? IWithMeta obj), with the other order this will always end up as false, so probably not what you intended 😉

thheller07:07:54

but to answer your actual question. yes, warnings stop the reload because they should be fixed. you may however set :devtools {:ignore-warnings true} if you'd still rather want the reload. this can of course result it actual errors during load so it is not recommended.

roklenarcic07:07:34

Ok, thank you for the explanation. I don’t intend to turn the mechanism off, I was just surprised by it

roklenarcic07:07:09

Perhaps the warning blurb could contain some text to explain that namespace wasn’t reloaded

diego.videco16:07:40

Hello, I have a project on typescript that is used as node_module in shadow-cljs project. Is there a way that I can make shadow-clj pick up the changes that I do on the typescript project after every time I compile the typescript project? Currently it seems like I have to restart the repl every time.

thheller16:07:32

you can touch node_modules/your-package/package.json to invalidate the cache shadow-cljs keeps for node_modules

diego.videco17:07:25

ah got it, thanks

diego.videco22:07:26

Actually it doesn’t seem to be working, I am also trying to touch the built files, with no luck

steveb8n23:07:29

@diego.vid.eco I have a similar setup. in my case, webpack converts the typescript into a module that can be used by the shadow project. when I make a change in typescript, the javascript artifact produced by webpack is updated and shadow automatically sees that it has changed because the artifact is in its source path(s). is that true for yours? i.e. is the javascript artifact from the typescript project being regenerated into a location that shadow knows about?

diego.videco23:07:43

not at the moment, but it could