I'm trying to figure out, what's the best or common practice for application embeded repl, nrepl docs says I only need nrepl https://nrepl.org/nrepl/usage/server.html#embedding-nrepl , so I assume this is editor agnostic? But since I'm using cider, I checked cider docs which says I need both nrepl and cider.nrepl handler this case for embedded repl? https://docs.cider.mx/cider/basics/middleware_setup.html#using-embedded-nrepl-server Now it just gives me impression that nrepl has somewhat coupled with cider? Or shall I try things like socket repl? What am I missing if I leave cider.nrepl handler out this case?
@ivar.refsdal It has been possible for a few, but few people do it. I'm also not sure how many of the nREPL clients have implemented this functionality in the first place.
More details - https://nrepl.org/nrepl/design/middleware.html#dynamic-middleware-loading
The idea was the clients would configure the server the way they want to, but it seems that few clients have actually done this. (if any)
you can connect with cider to a nrepl server that doesn't contains the cider middleware. You will just get a warning from Cider saying that you will not be able to use some fancy features, but the repl will work just fine.
also if you start your server with the cider middleware it will be transparent to people not using Cider
so I guess you can always start it with that middleware if you want the fancy cider functionality
That's good to know. I guess I'll just put cider stuff in for better experience. It feels kind of weird because in a server repl usecase to put cider deps, ideally cider deps and handler should be in client side not server side. But as you said, it will be transparent to non cider client, then I guess I can live with that. Thanks.
At some point, as time allows we might offer a production-oriented subset of cider-nrepl (I'd particularly like that for Cider Log Mode), but in the meantime, I'd recommend to stick to bare nrepl
I haven't tried this myself --- but isn't it possible to load and add whatever middleware you like at runtime? Edit 1: where "runtime" is a remote nrepl session 🙂 Edit 2: Of course that would bloat the classpath/whatnot.