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

[2.0] Improve extension registration logic #2505

Merged
merged 2 commits into from
Apr 25, 2024
Merged

[2.0] Improve extension registration logic #2505

merged 2 commits into from
Apr 25, 2024

Conversation

Renerick
Copy link
Collaborator

@Renerick Renerick commented Apr 24, 2024

Description

This PR improves htmx extension registration by allowing extensions to contribute to the selector used in findElementsToProcess. This change makes extension initialization much simpler since it can just inform htmx about what elements it want to process without the need to look for them in processed fragments. This change nicely avoids double processing issue since deduplication logic is implemeted by querySelectorAll

Corresponding issue: bigskysoftware/htmx-extensions#16

Testing

Since 2.0 repo has no extension, tests for this behavior are added to corresponding extension directory over at bigskysoftware/htmx-extensions

see bigskysoftware/htmx-extensions#18

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against the correct branch (master for website changes, dev for
    source changes)
  • This is either a bugfix, a documentation update, or a new feature that has been explicitly
    approved via an issue
  • I ran the test suite locally (npm run test) and verified that it succeeded

@1cg 1cg merged commit 45d45c3 into dev Apr 25, 2024
1 check passed
@Renerick Renerick deleted the extensions-getSelectors branch April 25, 2024 20:56
@MichaelWest22 MichaelWest22 mentioned this pull request Jul 12, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 enhancement New feature or request extension Consideration for an extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants