I'm trying to figure out how hard it would be to create an nbb/nodejs version of this:
https://github.com/babashka/sci.nrepl/blob/main/src/sci/nrepl/browser_server.clj
Basically I want to be able to access the scittle nREPL but via a running nbb server. It's a bit out of my depth but I might take a shot. Is the basic thing this does just forwarding from the editor client to the scittle websocket?
Isn't sci part of nbb. Afaik yes so you could generally do exactly the same right? Just with node utils like express and such.
Yes exactly, I hope so.
So i would spin up nbb add express or hapi or whatsoever and copy paste the s**t out of the example you shared xD
Ok i guess you'll need http://socket.io
I think it's pretty simple to implement a websocket server in raw express.
Due to the fact the example uses a websocket. No clue if there is plain nodejs solution
A quick search told me this :/ https://masteringjs.io/tutorials/express/websockets which refers to use ws for that there is even express-ws
access the scittle nREPL but via a running nbb serverWhy don't you write an nREPL client in nbb then?
the websocket thing just exists because of browser limitations
Going off what I am reading here: https://github.com/babashka/scittle/tree/main/doc/nrepl
I want to hook into Scittle from my editor, but that has to go via a websocket server, is that correct? The browser can't connect directly to my editor I guess. On that page it says to use babashka or Clojure JVM as the intermediary but I wanted a pure JS runtime solution. So I was thinking I want to run sci.nrepl on top of nbb. Does that sound right?
Actually this is probably not going to work I think because fireplace.vim expects a JVM nREPL before it will piggieback into the ClojureScript one. I'll do some more testing.
> I want to hook into Scittle from my editor, but that has to go via a websocket server, is that correct? Yes, you need to run a websocket server, but this is an implementation detail. Your editor should connect to the nREPL server, that proxies to that websocket server. The websocket server is an implementation detail
I don't see how this relates to nbb
Try Calva and connect with the "nbb" type nREPL. This should work. Or try lein repl :connect <port> . Should also work. If vim doesn't work, you could try conjure
or ping the author to support arbitrary nREPL servers instead of hardcoding JVM stuff into it
or was nbb going to be your workaround for the fireplace issue?
if you can have an nbb nrepl session in fireplace, then scittle would likely also work
Whoops sorry for dropping the ball on this thread, I got really busy! Thanks for your replies above I will have another shot at getting this working and report back.