Fork me on GitHub

Yes, that's the use-case for embedded repl. On ClojureScript with figwheel-main or shadow, the ClojureScript "REPL" lives on the Clojure side. The reason is that JS can't really open a socket server (and the compiler is in Clojure so even if it did live on JS side it would not be able to compile cljs forms into JS code)


So, an "embedded REPL" is a Clojure REPL that is able to run ClojureScript code. How it works differs from implementations, but most of the time is a command that you run on the Clojure side and then the REPL starts to understand ClojureScript


(it's a little bit more complicated because you have things like macros that, to be able to get the documentation for it, need to run on Clojure side, but that's about the ideia)


Thanks for the explanation. Every time I think I’m beginning to understand how ClojureScript tooling works, I discover something new that undermines my previous (mis-)understanding 🙂


Yes, ClojureScript tooling is quite a pain 😅


The whole problem lives in this "Cljs compiler lives in Clojure world" thing...


@mauricio.szabo Would it be possible for Clover to show results inline in the editor? I’ve seen quite a few extensions that seem to popup annotations in and around the code as you type so it sounds feasible… even if it is just to display the first 70 or 80 characters from a printed result.


@seancorfield It is possible, but the current code makes things a little bit difficult. Because of the UNREPL dependency, there are moments when the result is not "printable". I'm working on lots of simplifications and also change a lot of the current "render code" (again, in the current code both are quite tied so it's hard to separate them) so it's easy to get a "textual representation" and a "HTML representation" of an eval result.


Also, again, vscode API is quite hard to work with, and Clover is a "simple port" so to be honest, I didn't study too much vscode to make the port 😄. I even have to change some code because it seems I used some APIs that are harder to work with.... so now that I'm starting to have free time again, I'll re-organize my ideas and try to make a better vscode version, maybe even test with the current Calva version and delete my older code that simulates what calva already do (so the plug-ins play nicer and one do not try to get into the other's way)


I totally failed at extracting things out of Calva. But it wasn’t so much for lack of trying, just have so limited amounts of time in this life. 😃 Let me know if there is anything Calva can do to move out of the way of Clover. Not sure I can do so much more than what’s already been done, but anyway, as long as I am unawaere of things, I can’t do much. Haha.


@adamrenklint were you able to make the REPL connect?


@mauricio.szabo No, unfortunately no luck. I tried with the experimental flag on and off, also tried to simplify the shadow-cljs config to a single bundle. > (if you toggle “Enable experimental features” on Chlorine, you’ll see the error happening) Where should I see this error?


When you connect embedded and try to evaluate a CLJS command


(only with experimental features on)