Fork me on GitHub
#shadow-cljs
<
2019-09-22
>
sogaiu05:09:15

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?

thheller08:09:55

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

thheller08:09:20

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

sogaiu08:09:57

aha, will give that a try

sogaiu08:09:25

lots of cache reading and flushing 🙂

sogaiu08:09:04

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?

thheller08:09:14

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

thheller08:09:48

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

thheller08:09:52

depends on how you run things?

thheller08:09:06

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

sogaiu08:09:15

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.

thheller09:09:06

hmm is the page containing that error reloaded too?

thheller09:09:18

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

sogaiu09:09:32

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

sogaiu09:09:18

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.

thheller09:09:44

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

sogaiu09:09:11

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

thheller09:09:14

probably need to restart electron if you restart shadow-cljs

thheller09:09:23

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

sogaiu09:09:09

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

sogaiu09:09:07

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 🙂