Copied from linked post:
I'm very happy to announce the release of htmx 2.0. This release ends support for Internet Explorer and tightens up some
defaults, but does not change most of the core functionality or the core API of the library.
Note that we are not marking 2.0 as latest
in NPM
because we do not want to force-upgrade users who are relying on non-versioned CDN URLs for htmx. Instead, 1.x will
remain latest
and the 2.0 line will remain next
until Jan 1, 2025. The website, however, will reference 2.0.
All extensions have been moved out of the core repository to their own repo
and website: https://extensions.htmx.org. They are now all versioned individually and can be developed outside of
the normal (slow) htmx release cadence.
/dist/ext
directory so as to not break the URLs of CDNs like unpkg, but pleaseWe removed the deprecated hx-sse
and hx-ws
attributes in favor of the extensions, which were available and
recommended in 1.x.
HTTP DELETE
requests now use parameters, rather than form encoded bodies, for their payload (This is in accordance w/ the spec.)
We now provide specific files in /dist
for the various JavaScript module styles:
/dist/htmx.esm.js
/dist/htmx.amd.js
/dist/htmx.cjs.js
/dist/htmx.js
file continues to be browser-loadableThe hx-on
attribute, with its special syntax, has been removed in favor of the less-hacky hx-on:
syntax.
htmx.config.scrollBehavior
was changed to 'instant'
from 'smooth'
DELETE
requests now use query parameters, rather than a form-encoded body. This canhtmx.methodsThatUseUrlParams
to the value ['get']
,htmx.config.selfRequestsOnly
now defaults to true
rather than false
Not much, really:
selectAndSwap()
internal API method was replaced with the public (and much better) swap()
methodA complete upgrade guide can be found here:
htmx 1.x -> 2.x Migration Guide
If you require IE compatibility, the 1.x will continue to be supported for the foreseeable future.