scittle 2024-12-23

When using scittle nrepl via these instructions https://github.com/babashka/scittle/tree/main/doc/nrepl , I find that it works if I start the bb nrepl/start task before loading the js evironment with scittle deps and code, but not if the js page is started first, or already running. Is there a way to have an already loaded scittle webpage (with nrepl deps) connect to the bb nrepl instance. Would that have to do some kind of polling?

I think yes, let me check the code

I'm not 100% sure, probably the websocket is trying to connect for a while

probably there is some timeout of 30 minutes or so

> should do some kind of polling, probably Do you mean the current behavior should be doing some kind of polling? Or that some behavior for this should be added?

Instead of adding scittle.nrepl.js as a precompiled js dep, can I use nrepl.cljs code directly in scittle userland cljs loading? Where I could have more control..

I'm not sure if the scittle.nrepl stuff is actually SCI compatible but you could try :) but the code here for sure: https://github.com/babashka/scittle/blob/df1e5a429a9223f122821201252d478b2574af35/src/scittle/nrepl.cljs#L11 so you could try to make a combination of both if scittle.nrepl isn't fully compatible

I’m confused. If i try to load the nrepl.cljs code in scittle, I get this error. Could not find namespace sci.nrepl.server.

Is that code only intended to be precompiled to js?

yes. just copy/paste the code

and tweak it to your needs

hmyeah sorry that namespace isn't exposed

it might work if you also load all of these namespaces in the right order: https://github.com/babashka/sci.nrepl/blob/main/src/sci/nrepl/server.cljs and then you could probably do without the .js file

Thanks, I’ll try that out. So am i understanding correctly that the default behavior does not do any effective polling for a nrepl server (and expects it to be available on load?)

correct

👌 1