Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove multi-swap extension (OR modify documentation) since by now (almost) everything can be done with hx-select-oob #124

Open
oliverhaas opened this issue Dec 21, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@oliverhaas
Copy link

oliverhaas commented Dec 21, 2024

See my comment here bigskysoftware/htmx#1512 (comment).

Since 1.0.2 the multi-swap extensions became redundant, since hx-swap-oob and hx-select-oob started supporting nested swaps (see https://github.com/bigskysoftware/htmx/blob/master/CHANGELOG.md#102---2020-12-12).

This means the documentation of multi-swap (which says oob swaps can't handle nested swaps), as well as the actual existence of the extension itself, is misleading. I certainly used multi swap when I did not need to.

If there is anything I'm missing, let me know. Otherwise I'm open to making a PR.

@oliverhaas oliverhaas changed the title Remove multi-swap extension since by now everything can be done with hx-select-oob Remove multi-swap extension (OR modify documentation) since by now (almost) everything can be done with hx-select-oob Dec 22, 2024
@oliverhaas
Copy link
Author

I've actually found reasons what multi-swap can do that hx-select-oob can't:

Since there is not Hx-Reselect-Oob response header, one has to use mutli-swap if one wants that functionality with response headers.

Same goes for htmx.ajax: Since there is not selectOobOverride (yet?) or similar, multi-swap here has some niche where one might want to use it.

So I would probably reduce the scope of this issue to modifying the docs so it's reflecting the information given here.

@Telroshan
Copy link
Collaborator

I agree with you @oliverhaas , we realized this 3 years later, that OOB swap could totally handle nested elements, see bigskysoftware/htmx#2119
I could have sworn I had changed the multiswap docs along back then to remove that note, but it seems it was all just a dream!

We can't remove the extension entirely as existing websites could depend on it, but we certainly should update the documentation to avoid confusion about what OOB can and cannot do

If you're interested, please feel free to open a documentation PR!

@Telroshan Telroshan added the documentation Improvements or additions to documentation label Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants