Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Unpoly looks really nice, something I need to investigate as a comparison against htmx.

Server Side Events (SSE) is better option to websockets IMHO, it is a much simpler protocol so you can implement in any backend of choice with a few lines because it just a HTTP request that is kept open for a longer period of time.

Websockets are bidirectional whereas SSE are unidirectional, but you rarely need the client to push huge data sets to the server.

And if you already have endpoints for fetching HTML fragments for rendering a components, SSE fits well as enhancement into that architecture to get a more live experience.

e.g.

model update in backend -> notify frontend with SSE that model changed -> component that renders model fetches new HTML fragment over HTTP.

This makes the messages over SSE tiny, only need to say that a model changed, not the entire model data. This means that you can turn off SSE and the applications still works, just without live updates thru push, e.g switch to timer based solution instead.

What is also nice by fetching HTML fragments over HTTP is that you use cache headers, if you already have the latest fragment that is just a 304 Not modified.

I think that SSR with dynamic updates of HTML fragments closer respects how the web was intended.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: