HN Debrief

Removing React.js from the codebase and adapting Htmx for UI interactivity (2023)

  • Programming
  • Developer Tools
  • Open Source
  • Web Development

The post is a 2023 design note from the Misago forum project explaining why it started removing React.js from a Django-based codebase and replacing those parts with HTMX. The key motivation was not a grand anti-JavaScript manifesto. It was maintenance pain. Misago had ended up implementing parts of the UI twice, once as Django templates and again as React components, which made even routine changes expensive. The author’s claim is that forum software is mostly server-rendered content with some interactive edges, so HTMX can deliver partial page updates and live behavior without carrying a full client framework everywhere.

If your product is mostly content, forms, pagination, and a little live updating, HTMX is a credible way to simplify the stack and ship less JavaScript. If you have dense client-side state, rich editors, or highly dynamic filtered interfaces, decide that up front and budget for a real frontend state model instead of hoping HTML partials will stretch that far.

Discussion mood

Mostly favorable to Misago’s choice and broadly positive on HTMX for server-rendered, content-heavy apps. The pushback was aimed less at this migration than at sweeping anti-React rhetoric and at the idea that HTMX scales cleanly into rich, stateful interfaces.

Key insights

  1. 01

    Faceted search exposed the HTMX boundary

    A real faceted listing page showed where the clean HTMX story breaks. The server could return partials for both filters and results, but once the filter options themselves changed with each selection, every update wanted to resend a lot of HTML and recompute UI state on the server. The working design ended up hybrid. Results stayed server-rendered, while the filter form moved to Alpine so local state, show and hide logic, ARIA toggles, and computed values could update without another round trip.

    For faceted search, pricing calculators, and similar controls-heavy flows, separate the dynamic control surface from the server-rendered output early. If the form owns meaningful behavior, keep that behavior local instead of trying to express it as repeated fragment swaps.

  2. 02

    State volume is the real architecture test

    Several comments sharpened the usual "interactive versus not interactive" framing into something more useful. HTMX does not fall down because a page has spinners, infinite scroll, or drag and drop. It falls down when the browser must hold and coordinate a lot of its own state and logic. That is why a forum fits and a digital audio workstation does not. The dividing line is not visual richness. It is how much the client has to know and remember between server interactions.

    When choosing between HTMX and a frontend framework, inventory client-owned state first. If your UX depends on local state machines, optimistic updates, or complex coordination between widgets, choose for that constraint rather than for page type.

      Attribution:
    • snorremd #1
    • egeozcan #1
    • sjoedev #1
  3. 03

    DOM replacement still bites on continuity

    Even supporters acknowledged that fragment swapping can disrupt fine-grained UI continuity. One example was a scrollable list whose items update mid-scroll, which can reset position or lose selection unless you add DOM morphing or custom preservation logic. Morphdom helps, but commenters pointed out that text selection and similar in-progress interactions can still get blown away. React-style reconciliation earns its keep precisely in these fiddly continuity cases.

    If users will edit, scroll, select, drag, or otherwise stay embedded in a live region while it updates, test those flows before committing to HTML swapping. The happy path demo is not the hard part. Preserving in-progress interaction is.

      Attribution:
    • Exoristos #1
    • rubylimetea #1
    • christophilus #1
    • rubyfruit #1
  4. 04

    The round-trip argument cuts both ways

    One popular claim was that modern hardware makes old SPA motivations less relevant. The more persuasive correction was narrower. Network latency still hurts, but many SPAs do not actually reduce total round trips in practice. They just move the orchestration to the client, often adding several fetches per route. That left people less interested in ideology and more interested in actual request patterns. A server-rendered page that returns the right HTML in one go can beat a nominally more modern stack that fans out through APIs to rebuild the same screen.

    Measure route-level request waterfalls, not framework labels. If your SPA route needs multiple client fetches to assemble one view, you may be paying more latency than a well-designed server-rendered response.

      Attribution:
    • epolanski #1
    • bbg2401 #1
    • christophilus #1
  5. 05

    HTMX tooling is still thinner

    A quieter but important point was that React-like ecosystems come with mature composition and development tooling that HTMX largely lacks. Reusing partials cleanly can get awkward, and one commenter said they moved to Svelte partly to regain Storybook-style component workflows. For teams that rely on isolated component development, visual testing, and established frontend conventions, the missing ecosystem can matter as much as runtime behavior.

    Do not compare only runtime complexity. Compare workflow support too. If your team depends on component catalogs, visual review, and reusable UI primitives, account for the tooling gap before declaring the stack simpler.

      Attribution:
    • dsego #1
    • jackhalford #1

Against the grain

  1. 01

    Latency still favors client-heavy apps sometimes

    The strongest defense of SPA architecture was not that React is trendy. It was that devices got faster while network latency barely moved, so avoiding blocking navigations can still be worth a lot. Once the shell is loaded, client-side transitions and background fetching can hide delay in ways classic multi-page navigation cannot. That does not rescue every bloated SPA, but it does undercut the idea that modern networks made the problem disappear.

    If your users traverse lots of screens in one session, benchmark perceived navigation latency after the first load. The initial payload is only half the story for workflow-heavy products.

      Attribution:
    • ko27 #1 #2
    • Izkata #1
  2. 02

    React solves more than page transitions

    A pointed pushback was that React and similar tools were never just about "single-page apps" as a routing trick. Their real contribution is a unified rendering model for initial render and updates, plus a structured way to derive UI from state. That matters even inside partially server-rendered systems. The argument changes how you evaluate a migration. Removing React is not only giving up client routing. It may also mean giving up the cleanest answer you had for granular updates and reusable components.

    When you compare stacks, separate transport concerns from state and rendering concerns. A server-rendered architecture can still need a client rendering model if the interactive pieces are complex enough.

      Attribution:
    • shooly #1
    • robertlagrant #1
  3. 03

    HTML-first can reintroduce hidden coupling

    Skeptics argued that the danger in HTMX is not performance but maintainability at scale. Once behavior depends on server templates, DOM structure, CSS classes, and little bits of inline request wiring all staying in sync, bugs can become silent and hard to reason about. That critique is overstated for simple apps, but it is a credible warning for large teams that value explicit component boundaries and stronger guarantees around UI behavior.

    If you go HTML-first, enforce conventions around fragment boundaries, selectors, and server response contracts. Without that discipline, you can trade one kind of frontend complexity for a harder-to-audit one.

      Attribution:
    • asdfsa32 #1
    • robertoandred #1
    • skeptic_ai #1

In plain english

Alpine
A lightweight JavaScript framework for adding small reactive behaviors directly in HTML.
ARIA
Accessible Rich Internet Applications, a set of HTML attributes that improve how interfaces are described to assistive technologies.
CRUD
Create, Read, Update, Delete, the basic operations used to describe many business applications.
Django
A Python web framework that includes server-side templates, routing, and many built-in features for building web applications.
HTMX
A JavaScript library that lets HTML elements make HTTP requests and swap server-returned HTML fragments into the page using attributes like hx-get and hx-post.
morphdom
A DOM-diffing library that updates existing page elements in place instead of replacing whole HTML sections.
partial
A reusable server-rendered HTML fragment that can be inserted into a larger page.
React
A JavaScript library for building user interfaces by describing how the UI should look for a given application state.
server-rendered
A web architecture where the server generates HTML for the browser instead of sending mostly data and letting the browser build the page.
SPA
Single-Page Application, a web app that loads one main page shell and updates content dynamically without full page navigations.
Storybook
A development tool for building and previewing user interface components in isolation.

Reference links

HTMX references and examples

Alternative libraries and frameworks

  • Alpine Ajax
    Suggested as a lighter alternative when HTMX partial swaps became too heavy for a dynamic faceted filter UI.
  • PyView
    Recommended as a Python option inspired by Phoenix LiveView for light DOM patching in server-rendered apps.
  • Triptych Project
    Linked as an effort to standardize some hypermedia ideas behind HTMX into HTML itself.

Backend and architecture references

PWA and demo projects

  • Swag
    Shared as an example project for building mobile-first PWA-style apps with Go, HTML, and HTMX.
  • data-star dbmon example
    Used to argue that server-pushed updates can handle chat and notifications simply without heavy client state management.