The htmx team has announced the release of htmx 4.0.0, following eight months of development. This new version incorporates significant internal changes while maintaining a high degree of compatibility with the previous 2.x series for most users.
A core internal change in htmx 4.0.0 is the migration from XMLHttpRequest to the more modern Fetch API for handling network requests. This shift was driven by a desire to simplify the library's internals and align with contemporary JavaScript practices, though it is designed to be transparent to most end-users of htmx.
While behavioral differences are minimal, htmx 4.0.0 introduces three main changes that users may notice. Attribute inheritance is now explicit by default, requiring users to opt-in for inheritance rather than it being implicit. The library's event names have been standardized, which may require adjustments for advanced users listening to specific events. Additionally, history support no longer relies on localStorage by default, addressing a previous source of support issues.
Htmx 4.0.0 will not be marked as the 'latest' version on NPM to avoid force-upgrading users who depend on non-versioned CDN URLs. Version 2.x will remain 'latest' for the time being, with 4.0 designated as 'next' until early 2027. However, the official htmx website will reference the 4.0 version.
✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →
One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.
One email a day. Unsubscribe in one click, any time.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
Htmx 4.0.0 has been released, migrating its internal architecture from XMLHttpRequest to the Fetch API and introducing changes to attribute inheritance, event naming, and history support. This update aims to improve the library's internal workings and address previous support issues, though user-facing behavioral differences from version 2.x are minimal.