* Process sse-swap properly when swapped in
Previously `sse-swap` were only processed when `sse-connect` was on the
root of what was being swapped in.
This is now fixed so that the closest sseEventSource is found and used as the
event source
* Pass for code readabiltiy
remove the nested if statements as there is no difference in handling
between sseURL and LegacySSEUrl.
* Fix indenting
* Initial attempt at sse extension tests
* Make existing tests pass
* Add test case for #916
* backport test for #916 to hx-sse for completeness
* add a distinct test for sse-swap
* more tests, fix tests
+ more tests differentiating the implementation of sse-swap and
hx-trigger
* fix for "is closed after removal with no close and activity"
* Cleanup listener if element is gone
* Revert "Cleanup listener if element is gone"
This reverts commit bbe3715276302656d1a422fbc4778842776e35f6.
* Clean up listeners if element gone, fix indenting
* Incorportate feedback from first review
+ seperate eventSource creation logic and event registering logic
+ manually create event handling, still confused by how hx-trigger works
* `createEventSourceOnElement` now looks for event sources in children
* explicitly handle legacy sse handling instead of having extra
selectors in `querySelectorOnThisOrChildren`
+ a few readability changes
+ add regression check to make sure that sseEventSource is only created
on elements with sse-connect or equivalent
+ add test to make sure that sse-connect in the child of a swapped
element is handled
* Allow multiple listeners in eventsource mock
* Backport eventsource mocks to legacy tests
---------
Co-authored-by: 1cg <469183+1cg@users.noreply.github.com>
* Prevent references to elements swapped out of the dom accumulating as detached nodes (memory leak).
* Safely delete internal data when we tear down a node
* perf: prevent initialization of all links on page
* perf: changed loop to queryselector
* removed spread operator
* fixed selector
* use only one query to retrieve elements
* Allow CSS selectors with whitespace in `hx-trigger`
Parsing of `hx-trigger` scans for whitespace, so if a CSS selector is used that contains whitespace, e.g. `form input`, a syntax error is raised.
A workaround is implemented by allowing such a CSS selector to be wrapped in either curly braces or parentheses.
* Add explanation whitespace in CSS selector to docs
* Tests for CSS selectors containing whitespace
* Use faster RegEx test, remove redundant variable declarations
* Added Descendant Combinator support to `root` and `target` modifiers
* Add missing semicolon
* Tests for descendant combinators in `root` and `target` modifiers
* Improve descendant combinator test coverage
* allow user to override Content-Type header
* reorder the code so it won't use userSetContentType variable
* remove userSetContentType
* clarification
* remove unrelated changes
---------
Co-authored-by: gbourant <root@gbourant.com>
* Update contribution guidelines
Break the PRs section into technical requirements and guidelines for how
we reviews. Add new info about how to craft PRs that are easy for us to
review.
* Fix typo
* Add note about extensions
* New extension guidelines