nrepl

sg-qwt 2024-02-23T12:10:45.235959Z

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?

bozhidar 2024-03-02T17:26:08.978719Z

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

bozhidar 2024-03-02T17:26:31.286099Z

More details - https://nrepl.org/nrepl/design/middleware.html#dynamic-middleware-loading

bozhidar 2024-03-02T17:27:58.729999Z

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)

2024-02-23T12:19:54.430419Z

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.

👍 1
2024-02-23T12:24:26.374519Z

also if you start your server with the cider middleware it will be transparent to people not using Cider

2024-02-23T12:24:57.530649Z

so I guess you can always start it with that middleware if you want the fancy cider functionality

sg-qwt 2024-02-23T12:28:14.459859Z

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.

vemv 2024-02-23T12:52:25.857449Z

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

👍 1
Ivar Refsdal 2024-02-24T11:22:40.594699Z

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.