Is it possible to change the JS runtime used as the eval target? #1019
-
In the manual it states that shadow-cljs "by default picks the first JS runtime that connected as the eval target." Is there a way to change the eval target (without closing the first browser)? Or set it to use the last connected JS runtime by default? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, this is possible. It is however somewhat manual currently. First off you need to find the correct "runtime-id" you want to eval in. You can get that in a variety of ways:
[{:since #inst "2022-06-03T07:38:54.075-00:00",
:proc-id "86abce83-e751-4eec-af91-4751d85fcb33",
:connection-info {:remote true, :websocket true},
:client-id 25,
:user-agent "Chrome 537.36 [Win32]",
:type :runtime,
:lang :cljs,
:build-id :browser,
:host :browser,
:worker-id 24,
:dom true}
{:since #inst "2022-06-03T07:38:54.369-00:00",
:proc-id "86abce83-e751-4eec-af91-4751d85fcb33",
:connection-info {:remote true, :websocket true},
:client-id 26,
:user-agent "Chrome 537.36 [Win32]",
:type :runtime,
:lang :cljs,
:build-id :browser,
:host :browser-worker,
:worker-id 24,
:dom false}] Once you have the runtime-id you need you can currently only switch to it via the CLJ REPL. (shadow/repl :your-build-id-here {:runtime-id 26}) You can The default configuration picks the first Runtime that connects and stays with it while it is available. You can set |
Beta Was this translation helpful? Give feedback.
Yes, this is possible. It is however somewhat manual currently.
First off you need to find the correct "runtime-id" you want to eval in. You can get that in a variety of ways:
shadow-cljs: #<an-integer> ready!
console message. With the integer being the runtime-id. This can be tricky to identify the correct one though if you use one or more workers. Since they all log the same message with different numbers. Otherwise it'll be just one and easy to see.