This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-10
Channels
- # announcements (10)
- # aws (5)
- # babashka (81)
- # babashka-sci-dev (4)
- # beginners (100)
- # calva (60)
- # clj-kondo (34)
- # clojars (1)
- # clojure (30)
- # clojure-austin (12)
- # clojure-berlin (1)
- # clojure-europe (45)
- # clojure-italy (5)
- # clojure-losangeles (9)
- # clojure-nl (3)
- # clojure-norway (10)
- # clojure-spec (1)
- # clojurescript (8)
- # community-development (2)
- # conjure (5)
- # cursive (10)
- # data-science (2)
- # datalog (1)
- # emacs (4)
- # events (10)
- # fulcro (6)
- # jobs-discuss (8)
- # lambdaisland (3)
- # leiningen (2)
- # luminus (5)
- # membrane (61)
- # off-topic (8)
- # portal (5)
- # releases (20)
- # sci (25)
- # scittle (6)
- # shadow-cljs (25)
- # testing (6)
- # xtdb (11)
I feel I am missing something. On the command line, I can start the server and a watch worker using:
shadow-cljs watch my-build
This will stay in the foreground, I can cancel with ctrl+c
.
I can also start a server without watchers using:
shadow-cljs start
...and then start (background) watches using the UI at
.
After starting the server in the background, can I also start a watcher in the background, using the CLI?if you have a function in the user
(.clj) ns like
(defn watch-foo
{:shadow/requires-server true}
[]
(shadow.cljs.devtools.api/watch :foo))
you can then run it either from the repl or with shadow-cljs run user/watch-foo
you can also send processes to the background using good ol' terminal commands https://linuxhandbook.com/run-process-background/
the shadow-cljs start
command is nice because you can stop a watch without stopping the server, meaning starting other watches is fast
Exactly, this is why I'd like to start the server independent from starting/stopping watches. Since I want to integrate that with other tooling, running watch
in the background is not feasible I fear.
@UAEH11THP - this looks interesting, will have a look
@U922FGW59 I'm not sure what you mean "running watch
in the background is not feasible I fear."
I meant:
shadow-cljs watch my-build &
if you start the server first, your watch will connect to the server and when you stop the watch it will not stop the server
For example, if you want to run this from a babashka script
When I start a server with shadow-cljs start
, it starts in the background.
I can then go to the UI and start a watch, without having to keep a terminal open for the watcher.
I'd like to have the same behaviour at the CLI: To start/stop a watcher without binding the watch to my terminal
if you're running shadow-cljs watch my-build
directly from your terminal, then adding &
at the end will start it in the background.
if you're using babashka to run it, then you should be able to start the babashka process in the background.
but i don't really understand what you mean at this point, so i'll let others try and help
even if you & a process if you close the terminal doesn't it get killed? when you shadow-cljs run a function that :shadow/requires-server, the server will process it and your cli command (the shadow-cljs run) will exit almost immediately
Hm, weirdly this custom script solution does not work for me either. It compiles, but does not start a watcher?! n/m looked at the wrong place
is there a way for me to ignore different warnings in different ns' when compiling with warnings-as-errors?
But there’s no way to specify “in this ns, only ignore this warning. In this other ns, only ignore this other warning”