dev-tooling

Benjamin 2024-10-31T10:34:11.057939Z

Hi I'm currently looking at a nrepl connect flow for clerk where you have a second nrepl server (cljs, scittle-like) in the same process. I also made a video: https://github.com/mk/clerk-render-repl/issues/1#issuecomment-2446967183 This is cider specific at the moment. At the moment one runs the process via cider-jack-in and makes a second cljs connect command. Would be interesting to know if anybody has a different idea, and how other editor integrations handle this. The dream would be a clj&cljs jack in convinience. The .nrepl-port file concept would help, then the ide can connect when an nrepl server is ready. But it needs to be cardindality many, so an idea would be /.nrepl/nrepl-name.edn , etc. Where the files give info how to connect (port, unix socket, ...). Then the ide could watch for nrepl files to appear and make a connection? Not completely figured out. If anybody has ideas they are welcome.

pez 2024-10-31T10:45:29.253849Z

@benjamin.schwerdtner’s post reminds me: As I am currently thinking a lot about what to do with session management in Calva, it is great input. Sounds awesome if the port files could be edn and have more info. Some kind of session name that is easier to parse as a human than uuids are would be nice. I want to support multiple shadow-cljs app instances. shadow-cljs has API for it, but if something could be done on the nrepl side of things that gives us these richer session files, the implementation in each client could get less bespoke, maybe?

🤩 1
Benjamin 2024-10-31T10:51:24.083069Z

yea my use case would be that the nrepl servers say what nrepls are available - via something like nrepl files (files work provably so seems like a good idea to me). So the nrepl files would be something like 'possible sessions'. And perhaps in cider I would make a file watch for nrepl files that automatically makes connections; That's roughly what would make my problem smooth. nrepl file could contain an object like: {port, host, name, other-data-the-user-says-when-starting-nrepl-server?}. For nrepl this is the place, should be easy to add, once it's figured out what to put: https://github.com/nrepl/nrepl/blob/cc6b88f39e6e81333f5a87767e36885bb2937fe3/src/clojure/nrepl/cmdline.clj#L470 We would keep the old nrepl.port stuff around of course to not break old setups.