diff --git a/CHANGELOG.md b/CHANGELOG.md index e1b14a58..b7a9ee6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ indicator without issues * We now track the attribute state of an element and re-initialize it if `htmx.process()` is called on the element and the attributes have changed +* [Idiomorph](https://github.com/bigskysoftware/idiomorph) is now available for all your morph-swapping needs * The `unset` directive now works properly for `hx-vals` and `hx-vars` * The title of the page is now properly set on a history cache miss * The new (`hx-validate`)[/attributes/hx-validate] attribute will force elements to validate before a request, even if diff --git a/www/docs.md b/www/docs.md index 1684332d..b4033ea4 100644 --- a/www/docs.md +++ b/www/docs.md @@ -401,6 +401,21 @@ with any of the following values: | `afterend` | appends the content after the target in the targets parent element | `none` | does not append content from response ([Out of Band Swaps](#oob_swaps) and [Response Headers](#response-headers) will still be processed) +#### [Merge Swaps](#merging) + +In addition to the standard swap mechanisms above, htmx also supports _morphing_ swaps, via extensions. Morphing swaps +attempt to _merge_ new content into the existing DOM, rather than simply replacing it, and often do a better job +preserving things like focus, video state, etc. + +The following options are available for merge swaps: + +* [Morphdom Swap](/extensions/morphdom-swap/) - Based on the [morphdom](https://github.com/patrick-steele-idem/morphdom), + the original DOM morphing library. +* [Alpine-morph](/extensions/alpine-morph/) - Based on the [alpine morph](https://alpinejs.dev/plugins/morph) plugin, plays + well with alpine.js +* [Idiomorph](https://github.com/bigskysoftware/idiomorph) - A newer morphing algorithm developed by the creators of htmx, + which will be available out-of-the-box in htmx 2.0 + ### [Synchronization](#synchronization) Often you want to coordinate the requests between two elements. For example, you may want a request from one element