chlorine-clover

athomasoriginal 2020-03-28T15:03:01.013800Z

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?

athomasoriginal 2020-03-29T16:15:43.015600Z

Yup, that does it!

athomasoriginal 2020-03-28T15:05:27.013900Z

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

mauricio.szabo 2020-03-28T16:29:08.014100Z

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

mauricio.szabo 2020-03-28T16:29:40.014300Z

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

athomasoriginal 2020-03-28T23:39:39.014500Z

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

mauricio.szabo 2020-03-29T00:05:09.014700Z

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 :)

mauricio.szabo 2020-03-29T00:05:25.014900Z

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

mauricio.szabo 2020-03-29T00:24:01.015100Z

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}"

mauricio.szabo 2020-03-29T00:25:20.015400Z

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