Commit 7d29908
authored
fix(app-router): promote default slot persistence through route state (#1229)
* fix(app-router): promote default slot persistence through route state
Default and unmatched parallel slots were still inferred from AppElements transport markers. That made soft navigation persistence depend on wire shape instead of planner-owned route state, which breaks the #726 invariant that AppElementsWire is transport only.
Thread slot binding metadata through AppElements, browser state, and the navigation planner. The commit boundary now preserves previous slot content and binding proof only when target route-state marks the slot default or unmatched and the visible state proves a mounted/default value exists.
Tests cover the new planner contract, metadata validation, route wiring, mergeElements behavior, and browser commit lifecycle for default and unmatched slot targets.
* fix(app-router): align intercepted slot binding metadata
Intercepted slot payloads could render active modal content while their route-state metadata still described the slot as default. The browser planner could then preserve the previous default slot for an ID that the fresh payload should replace, breaking intercepted navigations in app-router E2E.
Derive slot IDs through one helper for both metadata and rendering, assert graph/wire ID divergence, and compute binding state from the same resolved override default export used by the render path. Move the app hydration marker to the committed root layout effect so E2E link clicks wait for a hydrated tree.
* fix(app-router): harden slot binding preservation
Review follow-up for #726-CORE-14. Centralize AppElements slot binding normalization so duplicate slot ids and stale owner layout ids fail at the wire boundary instead of creating quiet last-write-wins behavior.
Alias planner slot binding snapshots to the AppElements binding shape, share slot id ordering helpers, document the no-proof compatibility law, and add negative planner/wire tests plus a browser-visible soft navigation E2E. Refs #726.
* fix(app-router): align slot binding proof with rendering
* docs(app-router): clarify slot preservation invariants1 parent a5805b6 commit 7d29908
17 files changed
Lines changed: 1281 additions & 65 deletions
File tree
- packages/vinext/src
- server
- shims
- tests
- e2e
- app-router
| 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 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
| 511 | + | |
511 | 512 | | |
512 | 513 | | |
513 | 514 | | |
| |||
532 | 533 | | |
533 | 534 | | |
534 | 535 | | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
535 | 541 | | |
536 | 542 | | |
537 | 543 | | |
| |||
1000 | 1006 | | |
1001 | 1007 | | |
1002 | 1008 | | |
1003 | | - | |
1004 | 1009 | | |
1005 | 1010 | | |
1006 | 1011 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
| |||
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| 84 | + | |
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
| |||
95 | 98 | | |
96 | 99 | | |
97 | 100 | | |
| 101 | + | |
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
| |||
290 | 294 | | |
291 | 295 | | |
292 | 296 | | |
| 297 | + | |
293 | 298 | | |
294 | 299 | | |
295 | 300 | | |
| |||
304 | 309 | | |
305 | 310 | | |
306 | 311 | | |
| 312 | + | |
307 | 313 | | |
308 | 314 | | |
309 | 315 | | |
| |||
374 | 380 | | |
375 | 381 | | |
376 | 382 | | |
| 383 | + | |
377 | 384 | | |
378 | 385 | | |
379 | 386 | | |
| |||
413 | 420 | | |
414 | 421 | | |
415 | 422 | | |
| 423 | + | |
416 | 424 | | |
417 | 425 | | |
418 | 426 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
4 | 8 | | |
5 | 9 | | |
6 | 10 | | |
| |||
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| 32 | + | |
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
| |||
104 | 109 | | |
105 | 110 | | |
106 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
107 | 142 | | |
108 | 143 | | |
109 | 144 | | |
| |||
119 | 154 | | |
120 | 155 | | |
121 | 156 | | |
| 157 | + | |
122 | 158 | | |
123 | 159 | | |
124 | 160 | | |
| |||
132 | 168 | | |
133 | 169 | | |
134 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
135 | 177 | | |
136 | 178 | | |
137 | 179 | | |
| |||
148 | 190 | | |
149 | 191 | | |
150 | 192 | | |
| 193 | + | |
151 | 194 | | |
152 | 195 | | |
153 | 196 | | |
| |||
177 | 220 | | |
178 | 221 | | |
179 | 222 | | |
| 223 | + | |
180 | 224 | | |
181 | 225 | | |
182 | 226 | | |
| |||
189 | 233 | | |
190 | 234 | | |
191 | 235 | | |
| 236 | + | |
192 | 237 | | |
193 | 238 | | |
194 | 239 | | |
195 | 240 | | |
196 | 241 | | |
| 242 | + | |
197 | 243 | | |
198 | 244 | | |
199 | 245 | | |
| |||
0 commit comments