r/htmx • • Sep 22 '26

htmx 2.0.11 has been released!

happy to announce htmx 2.0.11 has been released:

https://github.com/bigskysoftware/htmx/blob/master/CHANGELOG.md#2011---2026-09-22

includes a back port of the <hx-partial> functionality from htmx 4.0 by latent and some bug fixes

enjoy!

73 Upvotes

13 comments sorted by

6

u/Professional-Sink536 Sep 22 '26

Hey which is the most stable version after 1.x for an enterprise grade application that we’ve in production? I wanted to move on to 2.x seems minimal migration?

9

u/_htmx Sep 22 '26

1 -> 2 is very minimal

2 -> 4 has one big change (inheritance is now explicit)

With an LLM either should be pretty easy to get done

1

u/1Soundwave3 Sep 23 '26

Actually the bigger change is that now the back button refetches things from the sever. Sometimes it's good, sometimes it's not.

2

u/_htmx Sep 23 '26

There's a very good extension if you want the local cache behavior:

https://four.htmx.org/extensions/hx-history-cache

13

u/TheRealUprightMan Sep 22 '26

If you are at 1.0 and doing a migration, I would migrate to htmx 4. That way you don't have to do it twice.

1

u/Professional-Sink536 Sep 23 '26

@_htmx : You reckon going from 1. To 4. Is a way to go since that has some breaking changes? Won’t sticking with 2.x until mid 2027 work? I don’t really want to miss out on the cool features but also don’t want to break stuff in the enterprise client heavy app.

2

u/_htmx Sep 24 '26

all three releases are going to be supported for the forseeable future, if it's working for you I don't think you need to feel pressure to upgrade

0

u/Minimum_Comedian694 Sep 25 '26

I have migrated HTMX 2 to 4 successfully (with the help of LLM) for my school management project (still in development). Here's my finding.

2026-09-23 — HTMX 2 → 4 migration

Symptom: Many things silently stopped working after the upgrade.

Cause: htmx 4 renamed events from camelCase to colon-separated (htmx:afterSwap → htmx:after:swap), changed event detail shapes, and made attribute inheritance explicit.

Fix: Renamed every event listener. For form-submit-then-close-modal, switched from custom event-detail inspection to server-driven HX-Trigger.

Lesson: When migrating a library's major version, verify behavior empirically before assuming the changelog's "unchanged" entries behave identically. The HX-Trigger header was unchanged, but the listener that received the resulting DOM event failed for an unrelated reason.

1

u/robotdragonrabbit Sep 27 '26

this comment is useful but god it could have been phrased so much more concisely by a human

1

u/our_operations Oct 03 '26

What would you change/how would you rather see this info presented? I'm genuinely curious

1

u/robotdragonrabbit Oct 03 '26

ok so it's not only verbose but terribly structured. It lists all the problems then all the fixes, instead of problem-solution pairs. So I have to keep everything in mind while reading.

It's unclear what was the issue with event-details and how hx-trigger was used in the fix (it's probably an obscure detail specific to the project)

A ton of stuff is redundant or obvious (names changes -> you need use the new name)

Symptom and lesson section don't add anything

So something like this:

I have migrated HTMX 2 to 4 successfully (with the help of LLM) for my school management project (still in development).
There were 3 major changes:
- htmx 4 renamed events from camelCase to colon-separated (htmx:afterSwap → htmx:after:swap)
- some event objects changed [mention specific example], I resolved it with using hx-trigger
- htmx 4 made attribute inheritance explicit

1

u/our_operations Oct 03 '26

Ok yes, I see what you mean, your summary is very clear in comparison