85 Commits

Author SHA1 Message Date
Carson Gross
4606fdc4ae fix cross domain request support 2025-12-31 12:33:56 -07:00
Stu Kennedy
37cf0e8c6c
WebSocket Extension (hx-ws) Improvements (#3592)
* 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.
2025-12-19 11:42:36 -07:00
Carson Gross
24507afacc move htmx config back to htmx-config 2025-12-06 07:57:41 -07:00
Carson Gross
d209b34d0a hx-head extension 2025-11-23 12:14:49 -07:00
Stu Kennedy
7510030e59
Websocket extension for HTMX (#3547)
* 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.
2025-11-23 11:38:02 -07:00
MichaelWest22
d569ce6ccf
move to registerExtension to avoid extension upgrade confusion (#3546)
* 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>
2025-11-22 10:58:38 -07:00
Carson Gross
0e1cdad9f1 merge streaming changes 2025-11-19 11:18:25 -07:00
MichaelWest22
aaff01750e
Implement hx-custom template tag support (#3537)
Co-authored-by: MichaelWest22 <michael.west@docuvera.com>
2025-11-18 07:19:03 -07:00
MichaelWest22
a9ba0a1c35
move tokenizer to parseConfig for all the things (#3516)
* move tokenizer to parseConfig for all the things

* move sse mode logic

* upgrade all JSON.parse!

---------

Co-authored-by: MichaelWest22 <michael.west@docuvera.com>
2025-11-12 04:55:02 -07:00
scriptogre
2f9318a4cd
add demo for custom events via SSE in manual tests 2025-10-28 17:19:54 +02:00
scriptogre
314a540bc8
replace <partial> with <htmx-action type="partial"> 2025-10-28 16:29:07 +02:00
scriptogre
afb1af04e1
add server-sent events (sse) streaming support
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
2025-10-28 16:13:43 +02:00
scriptogre
2ac86e2c44
update SSE implementation
- 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
2025-10-27 15:39:16 +02:00
Carson Gross
2d0839a928 move code into four branch 2025-10-26 13:26:44 -06:00
Deniz Akşimşek
deecda151c
Add alt text to images in content and examples (#3423) 2025-10-17 13:11:02 -06:00
MichaelWest22
7388d0c057
Move History storage to sessionStorage (#3305)
* Move History storage to sessionStorage and history path to window

* Fix type warnings

* Revert currentPathForHistory to move it to its own PR

* fix test
2025-06-16 18:08:34 -05:00
MichaelWest22
5b550e5c49
Optimize Head regex (#2781)
* 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
2024-10-02 19:20:23 -06:00
Carson Gross
b4048ebb59 add moveBefore support 2024-08-23 15:20:01 -06:00
Carson Gross
df16ed8e96 manual test for keeping indicators visible 2024-08-05 12:29:33 -06:00
Carson Gross
e99d8976f5 Manual test to ensure disabled elements are scrubbed when saving history 2024-08-05 12:22:51 -06:00
Carson Gross
f3ae976aa2 fix outerHTML body swapping issue
fixes https://github.com/bigskysoftware/htmx/issues/2639
2024-06-18 10:28:53 -06:00
Carson Gross
1e07206ed2 ignore empty files 2024-05-22 14:53:29 -06:00
Carson Gross
ab4e9deabc remove manual tests for extensions 2024-03-26 15:56:40 -06:00
Carson Gross
c16758a198 alpha2 2024-02-09 11:13:47 -07:00
Carson Gross
15c69b141b pain 2024-01-25 21:06:50 -07:00
Fernando Comunello
e9bce8db65
Improve head tag parsing on template fragments (#2024)
Fix https://github.com/bigskysoftware/htmx/issues/2018
2023-12-20 15:37:42 -07:00
Dan Palmer
0b37d0507d
Fix relative resource URLs for boosted links (#1960)
Fix relative URLs
2023-11-19 07:56:06 -07:00
Jordan Stewart
59f4da1d9d
fix problem with styles at the start of the server content (#1768)
fix problem with styles at the start of the server content when navigating through history
2023-09-21 12:10:04 -06:00
Viktor Szépe
b085d89459
Fix assorted comment typos (#1590) 2023-07-17 11:36:04 -04:00
Carson Gross
110dd63e97 two small bug fixes:
* 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
2023-04-11 09:32:52 -06:00
Carson Gross
613f7b61d5 Support an opt-in cache-buster parameter that is sent up with htmx GET requests but that is stripped from the URL pushed into the browser's history 2023-01-08 17:35:07 -07:00
Carson Gross
6ec00b7bed update head-support.js 2022-10-28 10:17:27 -06:00
Carson Gross
fe4c002db9 maybe ios history bug 2022-10-27 08:51:04 -06:00
Carson Gross
5652c01635 maybe ios history bug 2022-10-27 08:50:50 -06:00
Carson Gross
accd55d4e8 document the new head-support extension 2022-10-18 13:39:07 -06:00
Carson Gross
9c74684881 rename 2022-10-15 09:35:55 -06:00
Carson Gross
418ce8e1e2 tighten up logic and trigger event w/ request info for better filtering possibilites 2022-10-13 14:42:03 -06:00
Carson Gross
c6c1395469 head-merge extension 2022-10-13 14:25:30 -06:00
Carson Gross
7e7a5b4361 fix https://github.com/bigskysoftware/htmx/issues/827
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?
2022-07-11 13:34:40 -06:00
carson
9e7d5e7939 attempt to reproduce https://github.com/bigskysoftware/htmx/issues/854 (unsuccessful so far) 2022-04-15 09:42:23 -06:00
carson
faec23002c Merge remote-tracking branch 'origin/dev' into dev 2022-02-16 19:21:03 -07:00
carson
5cb4b4dd16 move title update after pushUrlIntoHistory()
fixes https://github.com/bigskysoftware/htmx/issues/746
2022-02-16 19:20:55 -07:00
Ben Pate
546e346e98
Restore hx-ws and hx-sse tags (#811)
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
2022-02-12 11:11:30 -07:00
makasaurus
8a7228c02a
adding support for hx-trigger="restore" (#668)
* adding support for hx-trigger="restore"

* switching over to an extension + docs + tests

Co-authored-by: 1cg <469183+1cg@users.noreply.github.com>
2022-02-04 11:09:18 -07:00
carson
ee507565d0 Merge branch 'dev' into pull/660
# Conflicts:
#	src/htmx.js
#	www/extensions.md
2021-11-23 13:43:29 -07:00
carson
80ed121060 Fixes https://github.com/bigskysoftware/htmx/issues/620 - Refresh breaks history cache 2021-11-20 19:30:07 -07:00
Ben Pate
3bd85e1e8d Add test servers 2021-11-10 18:28:39 -07:00
Ben Pate
de228177bf Quick check in to demo 2021-11-09 13:45:04 -07:00
Ben Pate
2aca696c88 Rebuild SSE using new Extension API
- 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
2021-10-29 13:24:16 -06:00
Ben Pate
93acf88431 Update test cases
- trigger tests working.
- settle tests failing
2021-10-25 21:56:24 -06:00