|
| 1 | +--- |
| 2 | +layout: layout.njk |
| 3 | +tags: ['posts', 'announcements'] |
| 4 | +title: htmx 1.8.0 has been released! |
| 5 | +date: 2022-07-12 |
| 6 | +--- |
| 7 | + |
| 8 | +## htmx 1.8.0 Release |
| 9 | + |
| 10 | +I'm happy to announce the [1.8.0 release](https://unpkg.com/browse/htmx.org@1.8.0/) of htmx. |
| 11 | + |
| 12 | +**NOTE:** This was a big release with some changes to very touchy code that is hard to test (e.g. history support) so |
| 13 | +please test thoroughly and let us know if there are any issues. |
| 14 | + |
| 15 | +### New Features |
| 16 | + |
| 17 | +* The [`hx-replace-url`](https://htmx.org/attributes/hx-replace-url) attribute was introduced, allowing you to replace |
| 18 | + the current URL in history (to complement `hx-push-url`) |
| 19 | +* `m` is now a valid timing modifier (e.g. `hx-trigger="every 2m"`) |
| 20 | +* `next` and `previous` are now valid extended query selector modifiers, e.g. `hx-target="next div"` will target the |
| 21 | + next div from the current element |
| 22 | +* The `HX-Location` response header now implements client-side redirects entirely within htmx |
| 23 | +* The `HX-Reswap` response header allows you to change the swap behavior of htmx |
| 24 | +* The new [`hx-select-oob`](/attributes/hx-select-oob) attribute selects one or more elements from a server response to swap in via an out of band swap |
| 25 | +* The new [`hx-replace-url`](/attributes/hx-replace-url) attribute can be used to replace the current URL in the location |
| 26 | + bar (very similar to `hx-push-url` but no new history entry is created). The corresponding `HX-Replace-Url` response header can be used as well. |
| 27 | + |
| 28 | +### Improvements & Bug fixes |
| 29 | + |
| 30 | +* Boosted forms now will automatically push URLs into history as with links. The [response URL](https://caniuse.com/mdn-api_xmlhttprequest_responseurl) |
| 31 | + detection API support is good enough that we feel comfortable making this the default now. |
| 32 | + * If you do not want this behavior you can add `hx-push-url='false'` to your boosted forms |
| 33 | +* If htmx is included in a page more than once, we do not process elements multiple times |
| 34 | +* When localStorage is not available we do not attempt to save history in it |
| 35 | +* `hx-boost` will boost anchor tags with a `_self` target |
| 36 | +* The `load` event now properly supports event filters |
| 37 | +* The websocket extension has had many improvements: (A huge thank you to Denis Palashevskii, our newest committer on the project!) |
| 38 | + * Implement proper `hx-trigger` support |
| 39 | + * Expose trigger handling API to extensions |
| 40 | + * Implement safe message sending with sending queue |
| 41 | + * Fix `ws-send` attributes connecting in new elements |
| 42 | + * Fix OOB swapping of multiple elements in response |
| 43 | +* htmx now properly handles anchors in both boosted links, as well as in `hx-get`, etc. attributes |
| 44 | +* Many, many documentation updates (thank you to all the contributors!) |
| 45 | + |
| 46 | +Enjoy! |
0 commit comments