htmx 2.0 is the latest major release of htmx, a JavaScript library that extends HTML to enable modern web application functionality without requiring complex JavaScript frameworks.
Release date: It was officially released on June 17, 2024.
End of Internet Explorer support: Version 2.0 no longer supports Internet Explorer.
Core functionality: While it tightens up some defaults, most of the core functionality and API of the library remain unchanged.
Extension changes: Extensions have been moved out of the core repository, allowing each extension to be released on its own schedule.
Attribute deprecations: Some attributes like hx-sse
and hx-ws
have been deprecated in favor of using extensions.
HTTP DELETE requests: These now use parameters instead of form-encoded bodies for their payload.
New features: It includes a new htmx.swap()
method for replacing existing content with new content, and improved integration with web components.
Gradual adoption: To avoid breaking existing projects, htmx 2.0 is not marked as "latest" in NPM. Instead, it will remain as "next" until January 1, 2025, allowing users time to migrate.
Upgrade guide: A migration guide is available for users upgrading from htmx 1.x to 2.x.
htmx 2.0 continues the project's goal of simplifying web development by focusing on HTML rather than complex JavaScript frameworks, allowing developers to implement modern web UI patterns using HTML attributes.