nrepl

https://github.com/nrepl/nrepl || https://nrepl.org
bozhidar 2019-06-25T11:21:30.010400Z

@pez I’m reasonably certain that after you clone the piggieback session it goes back to being a plain nREPL session.

bozhidar 2019-06-25T11:23:25.011900Z

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?

2019-06-25T11:41:26.013800Z

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?

pez 2019-06-25T13:12:32.016500Z

@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.)

pez 2019-06-25T13:13:38.017100Z

So, maybe I should instead clone the clj repl and promote that one each time?

bozhidar 2019-06-25T13:14:41.017300Z

> So, maybe I should instead clone the clj repl and promote that one each time?

bozhidar 2019-06-25T13:14:55.017700Z

Probably. I’m certain this will work.

pez 2019-06-25T13:15:06.018300Z

Is that how CIDER does it?

bozhidar 2019-06-25T13:15:10.018500Z

CIDER never clones any existing sessions, so I never played much with this.

pez 2019-06-25T13:15:20.018800Z

Interesting.

bozhidar 2019-06-25T13:16:00.019500Z

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.

pez 2019-06-25T13:16:31.020400Z

I'll do that. What session bindings should I inspect?

bozhidar 2019-06-25T13:16:34.020600Z

Close is supposed to clone most session bindings, but I don’t remember which one exactly.

pez 2019-06-25T13:19:39.021200Z

I'll inspect some bindings and see if I can figure it out. 😃

pez 2019-06-25T13:20:51.022100Z

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?

bozhidar 2019-06-25T13:21:19.022500Z

*cljs-repl-env* this one for instance.

bozhidar 2019-06-25T13:23:49.022800Z

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

bozhidar 2019-06-25T13:24:06.023100Z

> I was certain that starting off with cloning the session you get when you connect was the way you should do it.

bozhidar 2019-06-25T13:25:05.024300Z

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.

bozhidar 2019-06-25T13:26:23.025400Z

They can be upgraded to ClojureScript later if needed, but we always start off with Clojure sessions.

bozhidar 2019-06-25T13:26:43.025900Z

I think that’s most historical. When the project was created ClojureScript simply didn’t exist.