Repository navigation
Commit 6d2bdeb
fix(web): move delegated event handlers off the Solid 1
Solid 1 delegates from `document` and fires any `$$click`/`$$input`/… it
finds while walking up from the target. A 1.x runtime on the same page —
an embedded widget, a devtools panel built on 1.x — therefore ran every
delegated handler in a 2.x app a second time, and a 2.x root fired 1.x
handlers rendered inside it. Both versions used the same key and the same
walk; nothing on the event object is consulted by 1.x, so no mark can stop
it. The only lever is a key it does not look for.
Compiled output (Babel and native) and the runtime (`addEvent`,
`eventHandler`) now stamp `_$$<type>` / `_$$<type>Data`. `_$` is the
existing Solid-owned expando family (`_$host`, `_$owner`, `_$classes`,
`_$styles`, `_$multiple`); the extra `$` gives event keys their own
namespace so a custom delegated event can never collide with one of those.
The key, the `_$SOLID_EVENT_OWNER` mark, and the walk rules are documented
in client.ts as the delegated-event wire contract: shared by every Solid
copy on a page and frozen going forward, so two bundles of the same major
— or a future major — coordinate through the existing mark rather than
needing a new key.
Regression coverage carries a faithful copy of the 1.x walker on
`document` beside a 2.x root (light DOM, open shadow root, 1.x content
nested in a 2.x root) and loads the runtime twice as separate module
instances to pin same-major nesting: single dispatch, stopPropagation
across instances, outer handlers above the inner root still firing.
Co-authored-by: Claude via Cursor <[email protected]>$$<type> key1 parent 7624320 commit 6d2bdeb
21 files changed
Lines changed: 309 additions & 48 deletions
File tree
- .changeset
- packages
- babel-plugin
- src/dom
- test
- __dom_fixtures__
- eventExpressions
- jsxAttributeValues
- __dom_hydratable_fixtures__
- eventExpressions
- jsxAttributeValues
- __dynamic_fixtures__/eventExpressions
- __tsrx_dom_fixtures__
- keyedAccessorEdges
- tryCatchPending
- compiler
- __tests__
- fixtures
- dom-hydratable
- eventExpressions
- jsxAttributeValues
- dom
- eventExpressions
- jsxAttributeValues
- dynamic/eventExpressions
- src/dom
- web
- src
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1059 | 1059 | | |
1060 | 1060 | | |
1061 | 1061 | | |
1062 | | - | |
| 1062 | + | |
1063 | 1063 | | |
1064 | 1064 | | |
1065 | 1065 | | |
| |||
1070 | 1070 | | |
1071 | 1071 | | |
1072 | 1072 | | |
1073 | | - | |
| 1073 | + | |
1074 | 1074 | | |
1075 | 1075 | | |
1076 | 1076 | | |
| |||
1080 | 1080 | | |
1081 | 1081 | | |
1082 | 1082 | | |
1083 | | - | |
| 1083 | + | |
1084 | 1084 | | |
1085 | 1085 | | |
1086 | 1086 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | | - | |
36 | | - | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
0 commit comments