Fork me on GitHub
#shadow-cljs
<
2023-04-03
>
hifumi12303:04:12

Is it possible to defer loading shadow-cljs’ default HTTP server until compilation of a target is complete? If not, then I assume an :after-load-async hook ensuring a custom HTTP server is started is a viable alternative? My use case involves some tooling that blindly checks for a live HTTP server in order to start a web app. With near certainty, the web app will launch in the middle of compilation and receive stale JS output. So at the moment I have to manually refresh the page.

thheller05:04:44

the http servers are not related to builds in any way, they are started when shadow-cljs is started. so no, this is not possible. not in a hook or elsewhere.

thheller05:04:47

> blindly checks for a live HTTP server

thheller05:04:32

can't you just check if is returning a 404 or so? ie. the output not present?

hifumi12309:04:28

Unfortunately not. Because I am dealing with something that’s like electron, but there doesn’t seem to be a way to force it to wait until shadow-cljs compilation finishes. It only checks for the presence of an HTTP server for the web frontend

thheller09:04:42

well you can always use your own webserver. there is nothing special about :dev-http and its not needed for REPL/hot-reload

DrLjótsson20:04:33

I am wondering about goog.DEBUG. The User Guide says that is set to false in release builds, which I can confirm. But I also notice that it set to true in development. But I am not sure why - is it the default setting from goog or is it set by shadow-cljs?

thheller20:04:46

its a default closure define from the closure library

DrLjótsson20:04:38

Ah, OK. Great, thanks!