News for hackers. Stuff that matters.
Re:You might not need WebSockets by tbeseda on Friday April 11, 2025 @08:48PM (#43660285)
SSE is great. Most things with websockets would be fine with SSE.

Also I don't see it being much easier here than a few primitives and learning about generator functions if you haven't had experience with them. I appreciate the helper, but the API is pretty reasonable as-is IMO

Re:You might not need WebSockets by notpushkin on Friday April 11, 2025 @11:52PM (#43661195)
I’m experimenting with SSE for realtime project deployment logs in https://lunni.dev/ and it’s been extremely pleasant so far.

The only problem is, if you want to customize the request (e.g. send a POST or add a header),you have to use a third-party implementation (e.g. one from Microsoft [1]), but I hope this can be fixed in the standards later.

[1]: https://www.npmjs.com/package/@microsoft/fetch-event-source

Re:You might not need WebSockets by hntrl on Friday April 11, 2025 @10:37PM (#43660826)
The helper example was a sore attempt to plug the project I've been working on (tinkering with it is how I came up with the example). The library I plugged has much more to do with enabling a more flexible reactive programming model in js, but just so happens to plug into the stream API pretty handily. Still an interesting look IMO if you're into that kind of stuff
Re:You might not need WebSockets by notpushkin on Saturday April 12, 2025 @12:05AM (#43661271)
No worries, I know how it feels! (I said, plugging away my own project in a sibling comment, lol)

I do like the reactive approach (in fact, I’ve reinvented something similar over SSE). I feel a standards-based solution is just ever so slightly more robust/universal.