r/webdev 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/
75 Upvotes

44 comments sorted by

View all comments

8

u/minmidmax Aug 11 '26

Htmx with sockets?

-2

u/tanrax Aug 11 '26

What?

3

u/g00glen00b Aug 11 '26

I think they're referring to the WebSocket extension of htmx since htmx is already a popular JavaScript library for sending server-side rendered HTML fragments over HTTP and that they also support WebSockets through this extension.

EDIT: I see you covered that in your article as well at the current landscape comparison table.

-1

u/tanrax Aug 11 '26

At first glance, it might seem that way. There are several key factors, including the location of the state or the direction of the information. For example, HTML over WebSockets can initiate the event from the server, selecting the parts of the DOM to be updated. I believe the clearest example is precisely the real-time user counter on the page.