This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-26
Channels
- # announcements (6)
- # babashka (29)
- # babashka-sci-dev (2)
- # beginners (129)
- # calva (9)
- # clara (16)
- # cljdoc (49)
- # clojure (125)
- # clojure-bay-area (3)
- # clojure-europe (55)
- # clojure-france (1)
- # clojuredesign-podcast (8)
- # clojurescript (85)
- # conjure (3)
- # core-logic (2)
- # cursive (1)
- # events (1)
- # honeysql (61)
- # jobs-discuss (23)
- # lsp (69)
- # malli (14)
- # nrepl (3)
- # off-topic (16)
- # portal (11)
- # re-frame (8)
- # releases (1)
- # ring (2)
- # shadow-cljs (12)
- # vim (42)
- # xtdb (18)
If I have an atom in a web worker namespace, is there any way to inspect this value via the REPL? I’m assuming the repl is connected to the main thread as when I try to execute anything the values are all empty
Or is there some integration with insepct/tap that I can load an atom into it and inspect it at any time?
Oh my god. I can just open up all the defined atoms in a namespace? Consider my mind blown.
If there is anyway to cycle the JS runtime you connect to though, I’d still be keen to know
Or looking through the source code it looks like maybe there is some way to delegate tasks to the worker thread? :thinking_face:
I’m getting close with something like:
(->> (shadow.cljs.devtools.api/repl-runtimes :browser)
(last)
:proc-id
(hash-map :proc-id)
(shadow.cljs.devtools.api/repl :browser))
This successfully connects to a repl and I can execute arbitrary code (i.e. (+ 1 1)
) but I still can’t access any contextHmm it seems proc-id is actually the same for both repl-runtimes so I’m connecting to the same instance. Can’t figure out how to print the runtime-id (it is not returned from repl-runtimes
)
ahaaa so client-id
is the runtime-id
(small numeric number). Was able to get it working with:
(->> (shadow.cljs.devtools.api/repl-runtimes :browser)
(last)
:client-id
(hash-map :runtime-id)
(shadow.cljs.devtools.api/repl :browser)))
With this and inspect shadow-cljs is unstoppable!