htmx 4.0.0 released: explicit attribute inheritance, fetch() under the hood, and morph swaps out of the box

Htmx 4.0.0 has been released

After eight months of work, the htmx team has shipped version 4.0.0. The big change for developers is that attribute inheritance is now explicit: you must add an `:inherited` suffix to attributes like `hx-confirm` for them to apply to child elements. Internally, htmx has migrated from XMLHttpRequest to fetch(), which enables new streaming extensions and a fresh approach to history handling—no more localStorage caching, just re-fetching on back navigation. The release also includes built-in morphing swaps, a new `<hx-partial>` tag for multi-target responses, and a command-line upgrade checker to ease migration.

One chance evening I was contacted by Christian, who had some interesting ideas around streaming HTML that got me thinking that moving the internals to fetch() would simplify things for him and for the library in general.
  1. dec0dedab0de

    I really like htmx, and intercooler.js before it. It's been a while since I tried to convince a co-worker to use it, it might be time to try again. Either way I can't wait to try out the new version.

    Full Disclosure, I am CEO of HTMX

  2. nzoschke

    Congrats and thanks! htmx brings me joy.

    Pretty much every experiment I build now starts with Go, htmx, and SQLite to keep things simple and fast but still responsive.

    I put a few more thoughts about this here:

    https://housecat.com/blog/the-hugs-stack-hypermedia-unix-go-...

  3. threesmegiste

    A thoughtful, clean, and useful library that wasn't built to climb the corporate ladder. It grew organically. I think it became a cry of relief for those annoyed by unnecessary complexity, which also boosted its recognition. It served as a starting point for things like Datastar, too. I believe it brought a refreshing breath of air to the frontend landscape.

  4. james2doyle

    > `hx-alpine-compat` - smooths over compatibility issues between htmx and Alpine.js

    I looked into this when I tried HTMX 4 on a project earlier this year. I actually found that https://alpine-ajax.js.org/ was smaller than HTMX while providing all the features I needed. It is one of the sanctioned projects they link to so I felt good using it

  5. rednb

    Maybe a contrarian view, but as someone very knowledgeable about .NET API backends + angular on the frontend, I've found that HTMX made things more difficult as it required me to move back to mixing presentation concerns with business-logic and data concerns (basically have the backend produce the UI, which is whole point of HTMX).

    This is not a criticism but I suspect that the people enjoying HTMX are either people preferring old-school server-side rendering or react users.

    Just sharing my experience, because HTMX is the absolute darling of hacker news.

    Since i mainly develop real SPA, i found that is more complex than just using typscrpit if you build something non-trivial as managing state on the server is not fun at all.

    In my opinion if you are happy using angular, you'll find that HTMX is a step backward in terms for dev experience. Can't speak about react, but since it is not a battery included stack unlike Angular, i can understand why many people find they'd be better off moving things server-side instead of messing around with 15 third-party libraries. My 2 cents

  6. bluesnowmonkey

    I found Htmx to be a great combo with agent driven development. It lets you end-to-end test the UI without a full headless browser by just examing the HTML, which means UI tests are cheap and fast, which means you can have tons of them. And coding agents are exactly as good as your test coverage. So with Htmx they're great.

  7. Baguette5242

    As CEO of HTMX, I am very proud of the work achieved by the team.

  8. havaloc

    Before vibe coding was a thing, HTMX made it super easy for me to implement Ajax like features. It was the most approachable library I've ever seen, and I'll always be grateful for it.

More from this day

2026-08-28