Fork me on GitHub

is there a reason why shadow-cljs watch <build-id> seemingly compiles every time? is it possible to get it to not compile initially but just watch for changes if there's already something appropriate compiled?


@sogaiu it must always "compile" initially. if there is a cache it is mostly just loading the cache though.


you can see what exactly it is doing via shadow-cljs watch app --verbose


aha, will give that a try


lots of cache reading and flushing 🙂


i have an electron app setup with a :node-script build (main) and a :browser build (renderer). if i restart shadow-cljs (control-c and then invoke watch again), the renderer seems to be reachable again but not main (:node-script). is there something special i need to do to re-establish a connection to the js-runtime for main?


not sure what you mean. if you really kill the shadow-cljs process ALL REPLs will be disconnected and not be able to reconnect again


but if you have a server instance running only one watch may have been killed?


depends on how you run things?


if you start the watch did it say connected to server on startup?


i start with: yarn shadow-cljs watch main renderer and after the builds complete, i launch the electron app from the command line. i don't see "connected to server" in the output. when i control-c for shadow-cljs, i see: shadow-cljs - Connection closed! in white text on a red background in the electron app when i subsequently start the watch with: yarn shadow-cljs watch main renderer, i see very similar output to the first time (including no "connected to server") if i issue control-r to the electron app, the devtools console of the electron app reports: shadow-cljs Websocket connected! and i am able to reconnect to a cljs-repl for renderer via the command line and succesfully evaluate code. however, i still see the white text on red background indicating "shadow-cljs - Connection closed!" and no successful connection to a repl for main's js-runtime.


hmm is the page containing that error reloaded too?


maybe thats just not reloaded so it doesn't remove the error?


will check once again -- may be i was mistaken about the white text subsequent to the control-r issuing


sorry, my mistake -- upon reloading, the white text on red background does go away. however, it is still the case that there is no successful connection to a repl for main's js-runtime.


well I suspect that the main isn't restarted if you control-r


yes, that makes sense. i guess i can just kill the app...i don't suppose there's a way around that.


probably need to restart electron if you restart shadow-cljs


why do you restart shadow-cljs in the first place?


i am guilty of not taking good notes regarding this. will try to do so.


ah, i remember why i'm restarting -- it's because i'm testing tooling i'm making that works with shadow-cljs, and i'm testing it's ability to reconnect upon shadow-cljs restart 🙂