chlorine-clover 2020-03-28

Is it possible to connect chlorine to a repl created via the clj CLI tool? For example, if I have a REPL started via:

clj --main cljs.main --compile app --repl
I don’t think I can connect chlorine to the above, but is it possible to start the above as a socket repl and then connect chlorine?

Yup, that does it!

Just thought i would ask before I dig into the code 😉

Yes, it is possible. There are examples on the project's README.

In fact, I don't think any tool starts a socket repl by default, only nRepl :)

Sorry, I meant I a ClojureScript repl…should have clarified

Ah, OK :). There is a command to open a specific socket repl for ClojureScript (on the browser, on nashorn, or node I think). Then you can connect to then, it's only a little limited in functionality. I'll look up these commands for you :)

(and also add then in the README too :D)

Okay, found it: you can start a ClojureScript socket REPL with the following command, for example:

clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.597"}}}' -J-Dclojure.server.browser="{:port 4444 :accept cljs.server.browser/repl}"

When you ask Chlorine to connect to port 4444, it'll start a browser and connect a REPL to it