a computer screen with a bunch of text on it

For a decade, the 'modern' way to build a web app has been a complex puzzle: a JavaScript framework on the front end, a JSON API on the back end, and a mountain of boilerplate to glue them together. We’ve accepted this overhead as the price of a snappy, Single Page Application (SPA) experience. But what if we just... stopped doing that?

The Return of the Server

There is a growing movement toward 'HTML over the wire.' Instead of sending raw data (JSON) and asking the browser to render it using a heavy JS framework, the server renders the HTML and pushes it directly to the client. When combined with WebSockets, this creates a bidirectional pipe. The server can push UI updates in real-time without the client even asking for them.

Frameworks like Elixir's Phoenix LiveView have pioneered this, allowing developers to build real-time clones of sites like Twitter with almost zero client-side JavaScript. It eliminates the need for complex state synchronization and API contracts, keeping the logic in one single language on the server.

The Great Debate: Sockets vs. SSE

Not everyone is sold on the WebSocket approach. Critics argue that for most apps, Server-Sent Events (SSE) and standard HTTP Fetch requests are sufficient. The primary concern? Operational complexity and efficiency. Since SSE is standard HTTP, it leverages browser compression and traditional request-response benefits that WebSockets can bypass.

Still, proponents argue that the latency gains and the ability to maintain a persistent, stateful connection make WebSockets the superior choice for truly interactive, high-speed interfaces.

A Leaner Future

Whether it's Hotwire, LiveView, or custom Django implementations, the shift is clear: we are tired of JS overhead. By moving the rendering engine back to the server, we get faster initial loads and a drastically simplified developer experience. We might not kill JavaScript entirely, but we're certainly shrinking its footprint.

Sources

Media