scittle

chromalchemy 2024-12-23T19:32:50.741789Z

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?

borkdude 2024-12-23T19:45:24.607639Z

I think yes, let me check the code

borkdude 2024-12-23T19:47:08.222949Z

I think the code here should do some kind of polling, probably https://github.com/babashka/scittle/blob/df1e5a429a9223f122821201252d478b2574af35/src/scittle/nrepl.cljs#L11

borkdude 2024-12-23T19:49:46.796329Z

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

borkdude 2024-12-23T19:51:00.076029Z

probably there is some timeout of 30 minutes or so

chromalchemy 2024-12-23T19:58:43.002929Z

> 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?

chromalchemy 2024-12-23T20:02:24.890229Z

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

borkdude 2024-12-23T20:32:28.682179Z

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

chromalchemy 2024-12-23T20:45:03.433329Z

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.

chromalchemy 2024-12-23T20:46:45.834499Z

Is that code only intended to be precompiled to js?

borkdude 2024-12-23T21:05:53.644609Z

yes. just copy/paste the code

borkdude 2024-12-23T21:05:57.962909Z

and tweak it to your needs

borkdude 2024-12-23T21:06:24.261899Z

hmyeah sorry that namespace isn't exposed

borkdude 2024-12-23T21:07:40.899809Z

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

chromalchemy 2024-12-23T21:40:28.318469Z

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?)

borkdude 2024-12-23T21:45:19.713369Z

correct

👌 1