* refactor: Enhance WebSocket extension with URL normalization, improved request management, and refined message handling for better reliability and clarity.
feat: Add manual WebSocket server script and enhance WebSocket documentation with detailed message formats and connection management improvements.
feat: Include event type in WebSocket messages and update documentation for message format
* refactor: Update WebSocket extension to connect immediately by default, enhance documentation on connection triggers, and improve message handling examples.
* feat: Introduce URL validation for WebSocket send attributes to ensure proper connection handling and prevent non-URL markers from being processed.
* feat: add hx-ws WebSocket extension with accompanying tests and debug utilities.
* feat: Refine WebSocket extension initialization and processing logic, preventing re-initialization and ensuring comprehensive element handling.
* refactor: Enhance WebSocket connection handling with improved event triggering and dynamic configuration management
* refactor: Introduce dynamic configuration management for WebSocket connections, consolidating default settings into a dedicated function for improved maintainability and clarity.
* refactor: Update WebSocket extension to improve reconnection logic and dynamic configuration handling, enhancing maintainability and clarity.
* docs: Expand WebSocket extension documentation with detailed architecture, attributes, message formats, and example use cases for improved clarity and usability.
* refactor: Update WebSocket message structure to include default values for channel and format, enhancing clarity in documentation and implementation.
* feat: Add default `channel` and `format` values to WebSocket messages if not provided.
* move to registerExtension to avoid extension upgrade confusion
* Also fix window.htmx export to make modules work with extensions and add initial types file
* update docs on module use
---------
Co-authored-by: MichaelWest22 <michael.west@docuvera.com>
* move tokenizer to parseConfig for all the things
* move sse mode logic
* upgrade all JSON.parse!
---------
Co-authored-by: MichaelWest22 <michael.west@docuvera.com>
Implement native SSE handling with configurable stream modes (once/continuous), automatic reconnection with exponential backoff, and lifecycle events.
Streams are configured via hx-stream attribute or htmx.config.streams global defaults.
Update test infrastructure with ReadableStream-based mocking utilities.
# Conflicts:
# src/htmx.js
- replace previous implementation with a simple fetch-based approach
- long-lived streams still to be implemented using @microsoft/fetch-event-source, but SSE tests need to be restructured
* Move History storage to sessionStorage and history path to window
* Fix type warnings
* Revert currentPathForHistory to move it to its own PR
* fix test
* remove shared tag regex utility function that is no longer really needed
* fix head-support manual test to point to externally hosted extension
* minimize regex
* do not use template parsing for full body response content
* clear polling when reprocessing an element to avoid stacking up poll requests
latter fixes https://github.com/bigskysoftware/htmx/issues/1350
keep local URL anchors along for the magical ride into the history API, and scroll to the target directly to avoid adding a junk history entry along the way
have i mentioned that I hate the javascript history API?
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
- internal API has been moved to a constructor variable.
- added reconnect with exponential backoff
- initial tests of SSE features are working
- added many JSDoc comments in the process.
- added link to "sse triggers" test