Every interactive region on a marketing site is a trade: fetch JSON and render it client-side, or fetch HTML and let the server do the rendering. HTMX picks the second, and it is the right default for content sites.
The API contract tax
JSON APIs force you to maintain a schema, a serializer, and a client-side renderer that all agree. Add a field and you touch three files. Streaming HTML removes the decoder entirely — the response is the UI.
Where it shines
Our contact form, newsletter subscribe, and server-time demo all swap small HTML fragments into place. The Django view returns a finished fragment; HTMX does the swap. There is no frontend state to desync.
Half the frontend state we used to maintain simply no longer exists.
Comments
Sign in to join the conversation.
Commenting as