dev-tooling

mauricio.szabo 2024-03-08T01:34:56.920929Z

Hi, folks! A question: suppose I want to have a middleware that sends REPL-side events - like, for example, a message that a promise in JS resolved, or that a breakpoint was hit. What should be the "recommended", if that exists, way of doing it? Sending back a message with some op field? Something else?

2024-03-08T13:10:43.101539Z

Hi Mauri! afaik nRepl is a request/multi-response protocol, with nothing for server sent events, so maybe a new op for polling events is your only option?

2024-03-08T13:13:29.422389Z

or maybe a long polling system is a little bit more efficient, but I guess that depends on clients and servers timeouts handling

2024-03-08T13:21:55.828049Z

what I would try is to add a middleware with a subscribe-to-events op that will send multiple responses but never send one with a :status :done . As events occur you keep sending back responses. On the client side call subscribe-to-events once after the client connects and dispatch all events client side for every response returned

mauricio.szabo 2024-03-08T01:35:26.213109Z

For now, the only thing that I saw that sent me REPL-side events were STDOUT and STDERR, but they just added some fields to a message and that's it...