Fork me on GitHub
#cljs-dev
<
2020-03-14
>
dominicm06:03:32

I don't have a use-case for this, but I can imagine one quite easily (testing!) The server in ClojureScript seems to be a singleton. Would changes to make each REPL env have a private server be welcome? This would allow for multiple REPLs to be run simultaneously without affecting each other.

dominicm06:03:21

It does look like the repl.server is only used by the browser anyway, so I guess you can currently run 1 of each type of REPL env, but not multiple?

dnolen18:03:27

ClojureScript socket REPL supports N connections to a REPL env

dnolen18:03:48

if the REPLs are isolated I'm not sure I understand the benefit over just starting them separately

dnolen18:03:06

but maybe I'm misunderstanding what you want?

dominicm18:03:28

I mean the second thing you thought of: multiple isolated repls. The general reason I wouldn't want to isolate them is that: - they may be transparent as part of the api (e.g. It starts a repl under the hood in order to send commands to the browser) but you don't want to stop the developer from starting their own server. - there's an interface overhead to managing multiple jvm connections and defs. E.g. 3 terminals running separate servers which I then need to fiddle with editor configuration to know when to switch between the 3, vs just differentiating in clojure based on which var I'm poking at within a single jvm.

dnolen18:03:53

would need to think about - the REPL stuff we currently have is modeled after Clojure and this seems a bit different

dominicm22:03:18

For me, it's akin to being able to run clojure.repl/main multiple times because it closes over it's state.