diff --git a/CHANGELOG.md b/CHANGELOG.md index e7c8bee0..fb001b60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,25 @@ ## [1.6.1] - 2021-11-22 +* A new `HX-Retarget` header allows you to change the default target of returned content +* The `htmx:beforeSwap` event now includes another configurable property: `detail.isError` which can + be used to indicate if a given response should be treated as an error or not +* The `htmx:afterRequest` event has two new detail properties: `success` and `failed`, allowing you to write + trigger filters in htmx or hyperscript: + ```applescript + on htmx:afterRequest[failed] + set #myCheckbox's checked to true + ``` +* Fixed the `from:` option in [`hx-trigger`](/attributes/hx-trigger) to support `closest ` + and `find ` forms +* Don't boost anchor tags with an explicit `target` set +* Don't cancel all events on boosted elements, only the events that naturally trigger them (click for anchors, submit + for forms) +* Persist revealed state in the DOM so that on history navigation, revealed elements are not re-requested +* Process all [`hx-ext`](/attributes/hx-ext) attributes, even if no other htmx attribute is on the element +* Snapshot the current URL on load so that history support works properly after a page refresh occurs +* Many, many documentation updates (thank you to all the contributors!) + ## [1.6.0] - 2021-10-01 diff --git a/www/events.md b/www/events.md index 143094bc..b907d9ce 100644 --- a/www/events.md +++ b/www/events.md @@ -40,8 +40,10 @@ can be paired with [`htmx:beforeRequest`](#htmx:beforeRequest) to wrap behavior * `detail.xhr` - the `XMLHttpRequest` * `detail.target` - the target of the request * `detail.requestConfig` - the configuration of the AJAX request -* `detail.succesful` - true if the response has a 20x status code, else false -* `detail.failed` - true if the response does not have a 20x status code, else false +* `detail.succesful` - true if the response has a 20x status code or is marked `detail.isError = false` in the + `htmx:beforeSwap` event, else false +* `detail.failed` - true if the response does not have a 20x status code or is marked `detail.isError = true` in the + `htmx:beforeSwap` event, else false ### Event - [`htmx:afterSettle`](#htmx:afterSettle) diff --git a/www/posts/2021-11-22-htmx-1.6.1-is-released.md b/www/posts/2021-11-22-htmx-1.6.1-is-released.md index 82d10dbd..bd4d6ddd 100644 --- a/www/posts/2021-11-22-htmx-1.6.1-is-released.md +++ b/www/posts/2021-11-22-htmx-1.6.1-is-released.md @@ -1,5 +1,6 @@ --- layout: layout.njk +tags: ['posts', 'announcements'] title: htmx 1.6.0 has been released! date: 2021-10-02 --- @@ -8,9 +9,28 @@ date: 2021-10-02 I'm happy to announce the [1.6.1 release](https://unpkg.com/browse/htmx.org@1.6.1/) of htmx. -### New Features & Major Changes +### New Features +* A new `HX-Retarget` header allows you to change the default target of returned content +* The `htmx:beforeSwap` event now includes another configurable property: `detail.isError` which can + be used to indicate if a given response should be treated as an error or not +* The `htmx:afterRequest` event has two new detail properties: `success` and `failed`, allowing you to write + trigger filters in htmx or hyperscript: + ```applescript + on htmx:afterRequest[failed] + set #myCheckbox's checked to true + ``` + ### Improvements & Bug fixes +* Fixed the `from:` option in [`hx-trigger`](/attributes/hx-trigger) to support `closest ` + and `find ` forms +* Don't boost anchor tags with an explicit `target` set +* Don't cancel all events on boosted elements, only the events that naturally trigger them (click for anchors, submit + for forms) +* Persist revealed state in the DOM so that on history navigation, revealed elements are not re-requested +* Process all [`hx-ext`](/attributes/hx-ext) attributes, even if no other htmx attribute is on the element +* Snapshot the current URL on load so that history support works properly after a page refresh occurs +* Many, many documentation updates (thank you to all the contributors!) Enjoy!