htmx - 1.7.0
-
2022-02-2
-
The new
hx-sync
attribute allows you to synchronize multiple element requests on a single
element using various strategies (e.g. replace) - You can also now abort an element making a request by sending it the
htmx:abort
event - Server Sent Events and Web Sockets are now available as
extensions, in addition to the normal core support. In htmx 2.0, the currenthx-sse
andhx-ws
attributes will be
moved entirely out to these new extensions. By moving these features to extensions we will be able to add functionality
to both of them without compromising the core file size of htmx. You are encouraged to move over to the new
extensions, buthx-sse
andhx-ws
will continue to work indefinitely in htmx 1.x. - You can now mask out attribute inheritance via the
hx-disinherit
attribute. - The
HX-Push
header can now have thefalse
value, which will prevent a history snapshot from occuring. - Many new extensions, with a big thanks to all the contributors!
- A new
alpine-morph
allows you to use Alpine's swapping engine, which preserves Alpine - A restored extension was added that will trigger a
restore
event on all elements in the DOM
on history restoration. - A loading-states extension was added that allows you to easily manage loading states
while a request is in flight, including disabling elements, and adding and removing CSS classes.
- A new
- The
this
symbol now resolves properly for thehx-include
andhx-indicator
attributes - When an object is included via the
hx-vals
attribute, it will be converted to JSON (rather
than rendering as the string[Object object]"
) - You can now pass a swap style in to the
htmx.ajax()
function call. - Poll events now contain a
target
attribute, allowing you to filter a poll on the element that is polling. - Two new Out Of Band-related events were added:
htmx:oobBeforeSwap
&htmx:oobAfterSwap
Details
date
Feb. 2, 2022, midnight
name
1.7.0
type
Minor
👇
Register or login to:
- 🔍View and search all htmx releases.
- 🛠️Create and share lists to track your tools.
- 🚨Setup notifications for major, security, feature or patch updates.
- 🚀Much more coming soon!