htmx 1.2.0 has been released!
htmx 1.2.0 Release
Iām happy to announce the 1.2.0 release of htmx.
New Features & Major Changes
hx-varshas been deprecated in favor ofhx-valshx-valsnow supports ajavascript:prefix to achieve the behavior thathx-varsprovided- The new
hx-headersattribute allows you to add headers to a request via an attribute. Likehx-valsit supports JSON or javascript via thejavascript:prefix hx-includewill now include all inputs under an element, even if that element is not a form tag- The preload extension now offers a
preload-images="true"attribute that will aggressively load images in preloaded content - On requests driven by a history cache miss, the new
HX-History-Restore-Requestheader is included so that the server can differentiate between history requests and normal requests
Improvements & Bug fixes
- Improved handling of precedence of input values to favor the enclosing form (see here)
- Moved event filtering logic after
preventDefaultso filtering still allows events to be properly handled - No longer trigger after swap events on elements that have been removed via an
outerHTMLswap - Properly remove event handlers added to other elements when an element is removed from the DOM
- Handle the
scroll:modifier inhx-swapproperly when anouterHTMLswap occurs - Lots of docs fixes
Enjoy!