Repository navigation
Commit 37195a1
committed
fix(hydration): restore seeds before retry and scan past non-elements in skipForeign
1. Seed undo lost after suspend: when a Suspense arm suspends after applying
seeds, passSeeds moved the restore closures to the outer hydration without
running them. The retry then snapshotted the already-seeded thenable, so a
mismatch discardSeeds restored to the seeded state instead of the original
pending state. Use discardAndPassSeeds to run the restores before passing
them to the outer hydration, so the retry captures the pre-seed state and
the outer's own fallback can still run them idempotently.
2. Foreign skip stops at comments: skipForeign returned null immediately when
the cursor was a non-element and its scan loop stopped at the first comment
or text node. The deopt singleton walk had the same issue. Remove the
cursor.nodeType !== 1 bail and scan past all non-element siblings in both
skipForeign and the deopt walk, matching React 19's behavior of skipping
unmatched nodes in root containers and document singletons.1 parent 23cc378 commit 37195a1
1 file changed
Lines changed: 24 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19391 | 19391 | | |
19392 | 19392 | | |
19393 | 19393 | | |
| 19394 | + | |
| 19395 | + | |
| 19396 | + | |
| 19397 | + | |
| 19398 | + | |
| 19399 | + | |
| 19400 | + | |
| 19401 | + | |
| 19402 | + | |
| 19403 | + | |
| 19404 | + | |
| 19405 | + | |
| 19406 | + | |
| 19407 | + | |
19394 | 19408 | | |
19395 | 19409 | | |
19396 | 19410 | | |
| |||
20830 | 20844 | | |
20831 | 20845 | | |
20832 | 20846 | | |
20833 | | - | |
20834 | 20847 | | |
20835 | 20848 | | |
20836 | 20849 | | |
20837 | 20850 | | |
20838 | 20851 | | |
20839 | 20852 | | |
20840 | 20853 | | |
20841 | | - | |
20842 | | - | |
| 20854 | + | |
| 20855 | + | |
| 20856 | + | |
| 20857 | + | |
| 20858 | + | |
20843 | 20859 | | |
20844 | 20860 | | |
20845 | 20861 | | |
| |||
34559 | 34575 | | |
34560 | 34576 | | |
34561 | 34577 | | |
34562 | | - | |
34563 | | - | |
| 34578 | + | |
34564 | 34579 | | |
34565 | 34580 | | |
34566 | 34581 | | |
| |||
39848 | 39863 | | |
39849 | 39864 | | |
39850 | 39865 | | |
39851 | | - | |
39852 | | - | |
| 39866 | + | |
| 39867 | + | |
| 39868 | + | |
39853 | 39869 | | |
39854 | | - | |
| 39870 | + | |
39855 | 39871 | | |
39856 | 39872 | | |
39857 | 39873 | | |
| |||
0 commit comments