3 ms·
Part of the reason is that a lot of the changes were things that were already pushed as "correct" way of doing things in v1, and the they even avoid marking v2
by p_l 2y ago
Part of the reason is that a lot of the changes were things that were already pushed as "correct" way of doing things in v1, and the they even avoid marking v2 as "latest" specifically to prevent accidental upgrades and provide a time frame to upgrade.
Let's go through migration guide:
- NO CHANGE NEEDED JS modules changes: new feature in form of all three major module formats being provided out of the box
- MINOR Extensions are now packaged separately, and one extension explicitly has to be upgraded. Minor amount of work (been there, done that)
- MINOR Again migration of SSE and WebSocket extensions, something already pushed as default and preferred way in later v1 versions. If you followed best practices from docs in last year, you have nothing to upgrade.
- MEDIUM hx-on="htmx:..." -> hx-on:htmx:... - again, old recommended becomes new mandatory. If you followed best practices you have nothing to upgrade, otherwise change is minor unless you have lots of custom events involved where you also did not follow recommended naming.
- MINOR - default settings of configuration options changed. Minor change of adding few configuration lines.
- MAJOR ... but only for users of internals, not public API - htmx.makeFragment() changed to simpler and more performant code underneath (and less buggy) - and it was because HTMX dropped IE that it could finally do so, because IE's documentFragment handling was simply plainly bad. It's also internal, not public API, so unless you went deep or wrote your own extensions you're not going to see it at all
- MAJOR - for extension authors that used a certain specific private internal API, that API got replaced with a new public one.
- Internet Explorer support getting dropped. Some of us still have to deal with it, for them the team behind htmx apparently promises to maintain v1 for a while longer. Also trigger for the makeFragment thing.
All in, if you have followed v1 documentation on recommended patterns in the last year or two, you're barely going to notice anything except maybe the configuration changes, and well, better be explicit about those.
- lyu07282 2y agoPlease read my other comment in this thread, I can't edit my comment :(