HTMX 4.0 is a major release that replaces the legacy XHR transport layer with the modern Fetch API, enabling native streaming of HTML fragments via ReadableStream. Key changes include: Idiomorph DOM morphing algorithm now bundled in core (was an extension in 2.x), explicit prop inheritance replacing implicit inheritance, removal of the brittle localStorage history engine, status-specific error swapping syntax (e.g. hx-status:404), a new <hx-partial> tag for cleaner multi-target server responses, and native View Transitions API integration. Despite HTMX 2.0 being declared the final version, the team jumped to 4.0 to honor the 'no 3.0' promise while delivering a refactor that adds more power with less complexity, keeping the library at ~14KB.
4 Comments
Sort: