Commit 0bdbe43
committed
[Fizz] Fix Client Render after Postpone (#27905)
If we end up client rendering a boundary due to an error after we have
already injected a postponed hole in that boundary we'll end up trying
to target a missing segment. Since we never insert segments for an
already errored boundary into the HTML. Normally an errored prerender
wouldn't be used but if it is, such as if it was an intentional client
error it triggers this case. Those should really be replaced with
postpones though.
This is a bit annoying since we eagerly build up the postponed path. I
took the easy route here and just cleared out the suspense boundary
itself from having any postponed slots. However, this still creates an
unnecessary replay path along the way to the boundary. We could probably
walk the path and remove any empty parent nodes.
What is worse is that if this is the only thing that postponed, we'd
still generate a postponed state even though there's actually nothing to
resume. Since this is a bit of an edge case already maybe it's fine.
In my test I added a check for the `error` event on `window` since this
error only surfaces by throwing an ignored error. We should really do
that globally for all tests. Our tests should fail by default if there's
an error logged to the window.
DiffTrain build for commit f9dddcb.1 parent 92eda60 commit 0bdbe43
File tree
7 files changed
+9
-9
lines changed- compiled-rn/facebook-fbsource/xplat/js
- RKJSModules/vendor
- react-test-renderer/cjs
- react/cjs
- react-native-github/Libraries/Renderer
7 files changed
+9
-9
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25524 | 25524 | | |
25525 | 25525 | | |
25526 | 25526 | | |
25527 | | - | |
| 25527 | + | |
25528 | 25528 | | |
25529 | 25529 | | |
25530 | 25530 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9117 | 9117 | | |
9118 | 9118 | | |
9119 | 9119 | | |
9120 | | - | |
| 9120 | + | |
9121 | 9121 | | |
9122 | 9122 | | |
9123 | 9123 | | |
| |||
9148 | 9148 | | |
9149 | 9149 | | |
9150 | 9150 | | |
9151 | | - | |
| 9151 | + | |
9152 | 9152 | | |
9153 | 9153 | | |
9154 | 9154 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9545 | 9545 | | |
9546 | 9546 | | |
9547 | 9547 | | |
9548 | | - | |
| 9548 | + | |
9549 | 9549 | | |
9550 | 9550 | | |
9551 | 9551 | | |
| |||
9576 | 9576 | | |
9577 | 9577 | | |
9578 | 9578 | | |
9579 | | - | |
| 9579 | + | |
9580 | 9580 | | |
9581 | 9581 | | |
9582 | 9582 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
583 | | - | |
| 583 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
576 | 576 | | |
577 | 577 | | |
578 | 578 | | |
579 | | - | |
| 579 | + | |
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments