* Updated mocha, tests now work with node 20
* Update package-lock.json
* Enable Node CI for v2.0v2.0 branch (#2123)
Run tests for v2.0v2.0 branch too
* Bump CI's node version to 20.x
* apply updated patch with legacy WS/SSE removal
* remove legace WS/SSE from the test server also
* remove sse mention from getTriggerSpec()
* clean up sse.js implementation after removal of hx-sse
* 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>
* Current behavior testing
Testing current library behavior
* Test should remove correct handler
* Add question in htmx:confirm event detail
* Allow skipping window.confirm
* Additional test without hx-confirm value
* Wrap htmx.off in finally
* More correct assertion in case of no calls to confirm
* Remove erroneously added formatting
* Remove erroneously added formatting
* Documentation, fix loop
---------
Co-authored-by: mat <matt@techspace.asia>
* Make htmx IE11 compatible again + tests IE11 compatible
* IE11 compatible handmade socket mock for ws-ext tests
* Fallback when xpath isn't supported, hx-on wildcard now working on IE11
* Merge remote-tracking branch 'upstream/relative-url-in-hx-boost' into ie11-compatibility
* Add support for hx-on:* attribute
* Use shorter XPath selector
* Add support for "hx-on::" shorthand
* Add note about mixing the two forms of `hx-on`
* Add hx-history="false" to prevent sensitive or session data entering the localStorage cache
* Correctly get value of hx-history attribute.
* Add test for hx-history attribute.
* Allow history cache to be disabled when multiple `hx-history` attributes are present in a document, and any one of them is set to false.
* Add documentation for `hx-history` attribute.
* Add `hx-history` attribute to reference doc
* Correct the order of the `hx-history` attr in the reference doc.
* Add events support for WebSockets
* Stop reconnection attempts after element has been removed
* Add tests for websockets
* Hide socker wrapper behind a more strict interface to avoid breaking changes in the future
* Fix legacy websocket tests interfering with new extension tests
* Minor doc fixes
* Add `wsBinaryType` configuration option
* Add data-loading-aria-busy directive for loading-states extension; add tests for the extension
* Update docs
* Fix tests of scoped loading states
* Commit test files
* Improve delay tests by using sinon timer
* Add reference to MDN about `aria-busy` attribute
absolute 👑
* Restore WS and SSE code
First pass at restoring removed ws and sse code. More to come.
* More progress on WS and SSE restore
* Update htmx.js
crucial whitespace
* Update documentation
* Combine SSE and WS servers into single "realtime" demo
* Realtime Test Server Updates
- separated tests for old- and new- style calling
- updated intro content and stylesheet
- removed extensions from manual test suite
* Remove SSE/WS from manual tests