2598 Commits

Author SHA1 Message Date
Carson Gross
7c1c406efc Merge branch 'v2.0v2.0' into merge-2075
# Conflicts:
#	src/htmx.js
2023-12-20 13:22:49 -07:00
Denis Palashevskii
23256373fc
Remove legacy WS/SSE code (#2095)
* 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
2023-12-14 15:54:16 -07:00
Carson Gross
63e4ef68bf Merge remote-tracking branch 'origin/v2.0v2.0' into v2.0v2.0 2023-12-14 15:52:50 -07:00
Carson Gross
6e63f1c559 Merge branch 'dev' into v2.0v2.0 2023-12-14 15:52:35 -07:00
Denis Palashevskii
41ba753518 Merge branch 'dev' into v2.0v2.0 2023-12-15 02:12:15 +04:00
Denis Palashevskii
31d01c9145
fix conflicting function names in sse.js (#2096)
* fix conflicting function names in sse.js

* update jsdoc

* rollback whitespace changes

* fix "afterProcessNode" call
2023-12-14 15:08:41 -07:00
Carson Gross
0eb8190342 Merge branch 'dev' into v2.0v2.0 2023-12-14 14:34:29 -07:00
fhp-mec
11cef8ee83
Fix: Make the SSE extension work properly and adhere to tests (#2025)
* 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>
2023-12-14 14:33:38 -07:00
Mark Croxton
9052a4d520
Prevent references to nodes swapped out of the dom accumulating as detached elements in memory (#2091)
* 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
2023-12-14 12:12:34 -07:00
Vincent
4057f9c465
Trigger specs cache indentation fix + documentation & tests (#2094)
* Fix parseAndCacheTrigger indentation as discussed in #1540

https://github.com/bigskysoftware/htmx/pull/1540#issuecomment-1834651800

* Trigger specs cache documentation + tests
2023-12-14 11:44:11 -07:00
Jyri-Matti Lähteenmäki
7866258936
add extension to populate path variables with request parameters (#1307)
* add extension to populate path variables with request parameters

* update extension readme
2023-12-13 18:31:28 -07:00
Carson Gross
c4d8548406 being annoying, but remove a lookup of the cache 2023-12-13 18:29:39 -07:00
Vincent
da546050c3
Cache evaluated trigger specs (#1540)
* Cache evaluated trigger specs

* Removed spec array copy

* parseAndCacheTrigger func (wrong indentation for more readable diff)

* triggerSpecsCache config property

* Avoid htmx.config.triggerSpecsCache repetition
2023-12-13 18:27:58 -07:00
Carson Gross
f84b332d19 Merge branch 'dev' into v2.0v2.0 2023-12-13 15:44:14 -07:00
Carson Gross
73ec692e6c remove some lets that snuck in 2023-12-13 15:01:16 -07:00
Carson Gross
cd176d61d7 remove legacy hx-on= syntax 2023-12-13 14:59:48 -07:00
Carson Gross
22fde35674 Merge branch 'dev' into v2.0v2.0 2023-12-13 14:46:37 -07:00
Carson Gross
b75962b9bb update docs 2023-12-13 14:45:47 -07:00
Carson Gross
3be4202e5e add support for dashes in hx-on* attributes 2023-12-07 15:15:10 -07:00
Katrina Scialdone
edc31073a7 Add tests for new extended selector syntax 2023-12-07 08:58:28 -07:00
Katrina Scialdone
4d9adabe6c Make shadow DOM tests actually pass 2023-12-07 08:48:20 -07:00
Katrina Scialdone
5f92e2cc92 Add shadow DOM tests 2023-12-07 08:07:00 -07:00
Katrina Scialdone
bf949749d3 Add basic support for shadow DOM 2023-12-07 07:40:38 -07:00
Viliam Mihálik
24b6ee194e
Improve performance of lib during initialization phase (#2045)
* 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
2023-12-05 16:57:59 -07:00
Sascha Woo
b89e4f4bf6
HX-Request and HX-Current-URL headers are missing in the request to restore from history (#2013) 2023-11-30 15:17:39 -07:00
Yaroslav Lapin
52826aaeec
fix src/htmx.js(3842,25): error TS2769: No overload matches this call. (#2038) 2023-11-30 15:16:45 -07:00
Jonathan Rietveld
edafdd1770
Use faster regexp.test over string.match for testing against regex (#2053) 2023-11-30 15:15:20 -07:00
Vincent
98997bdd02
Fix wildcard hx-on search's root node (#2060)
Thank you @Telroshan!
2023-11-30 15:14:32 -07:00
Carson Gross
3b65f85784 bump version for next release 2023-11-30 15:13:53 -07:00
JA
b796c8a52d
fix incorrect config types (#2046) 2023-11-27 10:27:03 -05:00
Vincent
200c503f31
Removed IE-specific tests (#2039) 2023-11-24 11:30:11 -05:00
JA
264c0f6d63
chore: add missing options to HtmxConfig type (#2026)
chore: add missing types to HtmxConfig
2023-11-24 11:25:34 -05:00
Carson Gross
5c42b3442b flip defaults for 2.0 2023-11-21 14:57:52 -07:00
Carson Gross
555522baaa sha for release 2023-11-21 11:44:50 -07:00
Carson Gross
7b918d9d25 prep 1.9.9 release 2023-11-20 16:27:37 -07:00
Carson Gross
d5203c3b42 Merge remote-tracking branch 'origin/dev' into dev 2023-11-20 16:17:21 -07:00
ahollandECS
78a9ecf170
Fix for race condition in readystate detection (#1972)
* trying to fix readystate race condition

* es6 to es5

* serialized intitialization routines

* encapsulating ready function call
2023-11-20 11:07:01 -06:00
Carson Gross
52d19a47fb Merge remote-tracking branch 'origin/dev' into dev 2023-11-19 07:56:40 -07:00
Dan Palmer
0b37d0507d
Fix relative resource URLs for boosted links (#1960)
Fix relative URLs
2023-11-19 07:56:06 -07:00
Carson Gross
087f7cb45a Merge branch 'master' into dev 2023-11-19 07:53:45 -07:00
Carson Gross
331f79d469 fix typo 2023-11-18 21:06:25 -07:00
Carson Gross
62ef92ccce fix typo 2023-11-18 20:57:16 -07:00
Carson Gross
a573775cb5 Merge remote-tracking branch 'origin/master' 2023-11-18 20:25:07 -07:00
Carson Gross
29bb2abcc6 new essay 2023-11-18 20:24:59 -07:00
Carson Gross
242f6631fa Merge remote-tracking branch 'origin/master' into dev
# Conflicts:
#	www/content/docs.md
2023-11-16 16:53:23 -07:00
Carson Gross
a59a10baad bump for next version 2023-11-16 16:52:11 -07:00
Carson Gross
ab8605714f Merge remote-tracking branch 'origin/dev' into dev 2023-11-16 16:50:16 -07:00
Spiro Floropoulos
7f3d752553
Adding Laravel PHP Example (#1982)
Co-authored-by: 1cg <469183+1cg@users.noreply.github.com>
2023-11-16 14:04:10 -07:00
matiboy
c454ea4eee
Fix WS sendImmediately (#1949)
* Tests at current state of the code

* Currently failing case (actual issue)

* Fix issue

---------

Co-authored-by: mat <matt@techspace.asia>
2023-11-16 13:48:36 -07:00
michaelperel
68661753bd
fix indicator styles flash (#1227)
fix flash of indicator when first added to page
2023-11-16 13:46:29 -07:00