All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

htmx 4 Released: Library Rebuilt with Modern fetch() API for Better Performance

By

leephillips

6mo ago· 11 min readenNews

Summary

The article announces htmx 4, a major update to the htmx JavaScript library that replaces its XMLHttpRequest-based implementation with the modern fetch() API. The author explains that while they previously committed to stability for htmx 3, the opportunity to rebuild with fetch() in fixi.js revealed significant advantages in performance, reliability, and modern web standards compatibility. The new version maintains backward compatibility while offering improved error handling, better support for streaming responses, and cleaner integration with modern web development practices. The author emphasizes that this is a foundational change that will enable future enhancements while preserving the library's core philosophy of HTML-centric web development.

Key quotes

· 5 pulled
We are going to work to ensure that htmx is extremely stable in both API & implementation. This means accepting and documenting the quirks of the current implementation.
Earlier this year, on a whim, I created fixi.js, a hyperminimalist implementation of the ideas in htmx. That work gave me a chance to get a lot more familiar with the fetch() API.
The fetch() API is simply better than XMLHttpRequest in every way that matters for htmx: it's more reliable, has better error handling, supports streaming responses natively, and is the modern standard for browser-based HTTP requests.
htmx 4 maintains full backward compatibility with htmx 3 while offering significant improvements under the hood. Your existing code should work without modification.
This change represents a foundational improvement that will enable us to build more powerful features on top of htmx while staying true to our philosophy of HTML-centric web development.
Snippet from the RSS feed
You know, technically, I never said anything about a version *four*

You might also wanna read