Repository navigation
Commit 23a196d
authored
Improve DOM and Web API symbol and iterator typing (#60117)
Summary:
## Context
Several DOM implementation details use symbol keys that were excluded from type checking, masking incorrect slot declarations and requiring suppressions. Symbol-key support allows those contracts to be checked. The collection APIs also return iterable generator objects, which should be reflected in their types.
## Changes
- Preserve unique-symbol identities and type core `Event` state, abort API state, DOM node metadata, and the existing parent/trusted-dispatch symbol methods.
- Correct composed-path and event-phase types, and type the internal timestamp read without changing public `EventInit`. The internal timestamp setter accepts any init object and defines the same enumerable, writable data property, so existing callers keep their option types.
- Keep the private dispatch flag, parent cache, and handler-attribute storage boundaries unchanged rather than exposing them for typing. Preserve the emitted `Event` and `EventTarget` runtime code.
- Align DOM collection iterator returns with `IteratorObject` and regenerate the public API snapshot.
- Extend existing Fantom suites with public collection-iterator and event-reuse assertions. Add no new test suites, private-state tests, or Babel transform changes.
- Remove 77 existing suppression comments (19 `$FlowFixMe`, 58 `$FlowExpectedError`) without introducing new ones.
Changelog:
[General][Fixed] - Correct DOM collection iterable iterator types
Reviewed By: christophpurrer
Differential Revision: D132890886
Pull Request resolved: #601171 parent 2cf3a3c commit 23a196d
16 files changed
Lines changed: 251 additions & 252 deletions
File tree
- packages/react-native
- src/private/webapis
- dom
- abort-api
- events
- __tests__
- internals
- nodes
- __tests__
- internals
- oldstylecollections
- geometry
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | 44 | | |
47 | 45 | | |
48 | 46 | | |
49 | | - | |
50 | 47 | | |
51 | 48 | | |
52 | 49 | | |
| |||
69 | 66 | | |
70 | 67 | | |
71 | 68 | | |
72 | | - | |
73 | 69 | | |
74 | 70 | | |
75 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
136 | 134 | | |
137 | | - | |
138 | | - | |
139 | 135 | | |
140 | 136 | | |
141 | 137 | | |
142 | 138 | | |
143 | 139 | | |
144 | 140 | | |
145 | | - | |
146 | 141 | | |
147 | 142 | | |
148 | 143 | | |
| |||
156 | 151 | | |
157 | 152 | | |
158 | 153 | | |
159 | | - | |
160 | 154 | | |
161 | 155 | | |
162 | 156 | | |
| |||
192 | 186 | | |
193 | 187 | | |
194 | 188 | | |
195 | | - | |
196 | | - | |
197 | 189 | | |
198 | 190 | | |
199 | 191 | | |
200 | | - | |
201 | 192 | | |
202 | | - | |
203 | 193 | | |
204 | 194 | | |
205 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
| 76 | + | |
79 | 77 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 78 | + | |
87 | 79 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | 80 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | 81 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | 82 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | 83 | | |
| 84 | + | |
| 85 | + | |
104 | 86 | | |
105 | 87 | | |
106 | 88 | | |
| |||
139 | 121 | | |
140 | 122 | | |
141 | 123 | | |
142 | | - | |
143 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
144 | 127 | | |
145 | 128 | | |
146 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
239 | 242 | | |
240 | 243 | | |
241 | 244 | | |
242 | | - | |
243 | | - | |
244 | 245 | | |
245 | 246 | | |
246 | 247 | | |
| |||
250 | 251 | | |
251 | 252 | | |
252 | 253 | | |
253 | | - | |
254 | | - | |
255 | 254 | | |
256 | 255 | | |
257 | 256 | | |
| |||
504 | 503 | | |
505 | 504 | | |
506 | 505 | | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
| 506 | + | |
| 507 | + | |
511 | 508 | | |
512 | 509 | | |
513 | 510 | | |
| |||
516 | 513 | | |
517 | 514 | | |
518 | 515 | | |
519 | | - | |
520 | 516 | | |
521 | 517 | | |
522 | | - | |
523 | 518 | | |
524 | 519 | | |
525 | 520 | | |
526 | 521 | | |
527 | 522 | | |
528 | 523 | | |
529 | | - | |
| 524 | + | |
530 | 525 | | |
531 | 526 | | |
532 | 527 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
86 | 112 | | |
87 | 113 | | |
88 | 114 | | |
| |||
0 commit comments