Htmx 4.0.0
HTMX 4.0.0 has been released, fundamentally revamping its internals to use fetch() while refining user-facing aspects like explicit attribute inheritance and standardized events. This major update introduces morph swaps, new extensions, and even LLM 'skill files', sparking discussion on its long-term architectural vision and relevance in an AI-accelerated development landscape. Hacker News debates whether LLMs diminish or enhance HTMX's appeal, but generally celebrates its continued commitment to simpler web development paradigms.
The Lowdown
The HTMX team has officially announced the release of version 4.0.0, the culmination of eight months of dedicated development. This update aims to solidify HTMX's position as a foundation for "100-year web services" by modernizing its core and refining its developer experience.
- Internal Refactor: The library's core now uses the modern
fetch()API instead ofXMLHttpRequest, a change largely transparent to end-users. - Major User-Facing Changes: Attribute inheritance is now explicit by default, requiring
:inheritedsuffixes. Event names have been standardized to a clearerhtmx:phase:action[:sub-action]pattern. History support no longer caches pages inlocalStorage, opting to re-fetch on back navigation for better third-party JS compatibility, with an optionalhx-history-cacheextension for local caching. - New Features: HTMX 4.0.0 introduces built-in morphing swaps via
idiomorphand a new<hx-partial>tag for more explicit out-of-band content updates. - Enhanced Extensions: The extension system has been reworked, with new additions like
hx-preload,hx-download, andhx-alpine-compat. New streaming extensions includehx-sse,hx-ws, andhx-multipart. A new small front-end scripting solution,hx-live, is also included. - Upgrade & LLM Support: A command-line tool assists with upgrading from HTMX 2.x, and "skill files" are provided for LLMs to help with development, debugging, extension authoring, and migration tasks.
- Installation: Available via package managers (using the
4.0.0tag, with 2.x remaininglatestfor now) or CDN.
The team emphasizes that HTMX 2.x will continue to receive indefinite support, allowing users to upgrade at their own pace. The announcement concludes with thanks to key contributors and a playful mention of "upgrade music."
The Gossip
LLMs and Libs: Redefining Relevance
A core discussion point revolves around how the emergence of Large Language Models (LLMs) impacts HTMX's value. Some commenters question HTMX's necessity when LLMs can generate JavaScript code efficiently, potentially eroding its advantage of reducing JS (49481124). Conversely, others argue that LLMs are adept at generating HTMX and accompanying glue JavaScript, thus enhancing HTMX's appeal and developer velocity (49481710, 49482556, 49481895). The creator acknowledges that LLMs might affect smaller libraries' adoption but emphasizes the enduring value of HTMX's underlying ideas (49481406). Notably, some users report that LLMs like Claude and GPT independently suggest HTMX for projects, seeing it as having "won the argument it was making" for simpler web development (49482127).
Stack Selections & Hypermedia's Strength
Commenters enthusiastically share their preferred technology stacks that pair well with HTMX. The combination of Go, HTMX, and SQLite (dubbed the "HUGS" or "GOSH" stack) is frequently praised for its simplicity, speed, and responsiveness in building applications (49480627, 49481793). Django and Postgres are also highlighted as a powerful backend combination for HTMX (49481710, 49482074). Many champion HTMX for facilitating server-side rendered (SSR) applications with minimal JavaScript, often using Alpine.js for light interactivity, viewing this as a "more pure" form of SSR-based interactive web development (49481865, 49482074). The ambitious goal of building "100-year web services" with HTMX is seen as a worthwhile pursuit, even if its practicality is met with some skepticism (49481100).
Version Victories & Quirky Queries
The community offered widespread congratulations and appreciation for the HTMX 4.0.0 release, with many sharing positive experiences and enthusiasm for the library (49480601, 49480627). A recurring question was the decision to skip version 3 (49480939). This was humorously explained as a commitment to a past promise after HTMX 2.x to never release a version 3 (implying no breaking changes), thus requiring a jump to version 4 to accommodate necessary breaking changes (49481230). Minor observations and quick fixes included initial typos in the announcement text (49480703, 49480644) and a broken image link that was swiftly addressed by the author (49480392, 49480651).