| HTML over WebSockets: real-time SPAs with barely any JavaScript(en.andros.dev) | |
| 246 points by redbell 9 days ago | 193 comments | |
tl;dr: HTML over WebSockets (popularized by Phoenix LiveView) renders HTML on the server and pushes it to clients over a persistent bidirectional channel, eliminating the need for a JSON API, client-side rendering framework, or duplicated state. Advantages include a single language/codebase, real-time broadcast, and better XSS safety, at the cost of stateful servers, higher resource use per connection, and no offline support. The article surveys implementations across Elixir, Ruby, Python/Django, .NET, and PHP, and notes SSE as a cheaper one-way alternative when bidirectional communication isn't required. | |
HN Discussion:
| |