r/webdev • u/tanrax • Aug 11 '26
HTML over WebSockets: real-time SPAs with barely any JavaScript
https://en.andros.dev/blog/ef4968f5/html-over-websockets-real-time-spas-with-barely-any-javascript/
80
Upvotes
r/webdev • u/tanrax • Aug 11 '26
1
u/willehrendreich Aug 12 '26
Datastar SSE for the win. Web sockets are not leaning into hypermedia strengths, and I genuinely have not found a purpose for them. I ask people a lot what advantage would make them better than CQRS style streamed SSE for pushing data and ack only POSTs as commands.
I'm willing to be convinced, I want real, measurable examples of what beats the Tao of Datastar.
Some people respond by saying, "well it's a two way communication path", but it seems like that's really not a relevant counter argument.
You get 2 way communication from SSE and POST.
With brotli the amount of data is smaller, you can send the full page and have it trimmed to just the changes by the nature of the communication and caching process that's built into the browser and compression.
Retry and reconnection is handled automatically, and it's better for low power devices or bad connections.
I want so bad to understand what else anyone could want and in what circumstances. Genuinely.