Tuesday, November 04, 2025

The Digital Press

All the Bits Fit to Print

Ruby
Web Development Artificial Intelligence Urban Planning
Astronomy

htmx 4.0 Launches with Fetch(), Streaming, and Simplified Features

htmx 4.0 replaces XMLHttpRequest with fetch(), simplifies attribute inheritance, and revamps history handling.

From Hacker News Original Article Hacker News Discussion

htmx 4.0 is set to be a major update introducing fetch() to replace XMLHttpRequest, explicit attribute inheritance, and simplified history handling, enhancing performance and maintainability. The update also brings new features like streaming responses, improved event handling, and better extension support while maintaining core functionality familiar to current users.

Why it matters: Transitioning to fetch() modernizes htmx’s AJAX handling, improving async support, event stability, and extension capabilities.

The big picture: Explicit attribute inheritance and opt-in history caching simplify the API and fix longstanding quirks, promoting easier maintenance and future growth.

New features: Core streaming responses, morphing DOM swaps, explicit partial tags, and improved view transitions expand htmx’s dynamic UI capabilities.

Commenters say: Users appreciate long-term support for htmx 2.0 and the project’s stability focus, though some debate API design choices and compare htmx to alternatives like Datastar.