@pez I’m reasonably certain that after you clone the piggieback session it goes back to being a plain nREPL session.
Inspecting the session bindings would answer this for certain. Btw, does this work for other cljs REPL types - e.g. a node or nashorn repl?
Hi all. Im running an embedded nrepl inside a mixed java/clojure project. Is there anyway to expose a user.clj or equivalent for some start/reset/stop functions?
@bozhidar: I have a feeling it might not work with nashorn, because that would explain some of the problems i ran into when trying to reproduce some funky nrepl stuff a while ago. However, it does work with lein-figwheel, Figwheel Main, and shadow-cljs, which is why I have assumed I am doing things right... (They do not revert back to plain anything.)
So, maybe I should instead clone the clj repl and promote that one each time?
> So, maybe I should instead clone the clj repl and promote that one each time?
Probably. I’m certain this will work.
Is that how CIDER does it?
CIDER never clones any existing sessions, so I never played much with this.
Interesting.
I think you should at least open a ticket about this on nREPL (or piggieback’s repo), so we would investigate this further at some point.
I'll do that. What session bindings should I inspect?
Close is supposed to clone most session bindings, but I don’t remember which one exactly.
I'll inspect some bindings and see if I can figure it out. 😃
I was certain that starting off with cloning the session you get when you connect was the way you should do it. So how does CIDER do these things?
*cljs-repl-env*
this one for instance.
Just pull those from the session like this https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/util/cljs.clj#L53
> I was certain that starting off with cloning the session you get when you connect was the way you should do it.
CIDER sets up two basic sessions for each logical connection - one for evaluations and one for everything else (aka the tooling session). The second is cloned from the first.
They can be upgraded to ClojureScript later if needed, but we always start off with Clojure sessions.
I think that’s most historical. When the project was created ClojureScript simply didn’t exist.