🛠htmx 4.0.0 Released After 8 Months of Development
htmx 4 is here, and it's all about fetch() and history
TL;DR
htmx 4.0.0 is out, bringing fetch() under the hood and cleaning up event names. Most users won't notice big changes, but the new hx-history-cache extension is worth a look. Upgrade now with the provided tool.
htmx 4.0.0 is out, bringing fetch() under the hood and cleaning up event names. Most users won't notice big changes, but the new hx-history-cache extension is worth a look. This update standardizes event names and simplifies attribute inheritance, making htmx more consistent and easier to use. The hx-history-cache extension restores history from sessionStorage, offering a more robust solution than the default localStorage. Upgrade now with the provided tool to ensure your projects stay up-to-date.

Key Points
htmx 4.0.0 uses fetch() internally, improving performance and consistency.
Event names are now standardized to htmx:phase:action[:sub-action], simplifying debugging.
hx-history-cache extension restores history from sessionStorage, enhancing reliability.
hx-alpine-compat extension smooths over compatibility issues between htmx and Alpine.js.
htmax.js bundle packages htmx with popular extensions in a single file for easy integration.
Why It Matters
If you're using htmx 2.x, the upgrade to 4.0.0 will bring fetch() under the hood, improving performance and consistency. The hx-history-cache extension restores history from sessionStorage, offering a more robust solution than the default localStorage. The upgrade tool makes it easy to transition, ensuring your projects stay up-to-date.
Frequently Asked Questions
Why does this matter?
If you're using htmx 2.x, the upgrade to 4.0.0 will bring fetch() under the hood, improving performance and consistency. The hx-history-cache extension restores history from sessionStorage, offering a more robust solution than the default localStorage. The upgrade tool makes it easy to transition, ensuring your projects stay up-to-date.
What happened?
htmx 4.0.0 is out, bringing fetch() under the hood and cleaning up event names. Most users won't notice big changes, but the new hx-history-cache extension is worth a look. Upgrade now with the provided tool.
Comments
Be the first to comment
Enjoyed this article?
Get it daily. 7am. Free. Reads in 5 minutes.
Join 3,381 builders reading daily.