Commit 9682735
committed
[Fizz] Reset error component stack and fix error messages (#27456)
The way we collect component stacks right now are pretty fragile.
We expect that we'll call captureBoundaryErrorDetailsDev whenever an
error happens. That resets lastBoundaryErrorComponentStackDev to null
but if we don't, it just lingers and we don't set it to anything new
then which leaks the previous component stack into the next time we have
an error. So we need to reset it in a bunch of places.
This is still broken with erroredReplay because it has the inverse
problem that abortRemainingReplayNodes can call
captureBoundaryErrorDetailsDev more than one time. So the second
boundary won't get a stack.
We probably should try to figure out an alternative way to carry along
the stack. Perhaps WeakMap keyed by the error object.
This also fixes an issue where we weren't invoking the onShellReady
event if we error a replay. That event is a bit weird for resuming
because we're probably really supposed to just invoke it immediately if
we have already flushed the shell in the prerender which is always atm.
Right now, it gets invoked later than necessary because you could have a
resumed hole ready before a sibling in the shell is ready and that's
blocked.
DiffTrain build for [0fba3ecf73900a1b54ed6d3b0617462ac92d2fef](facebook/react@0fba3ec)1 parent 8d75fc4 commit 9682735
File tree
9 files changed
+316
-183
lines changed- compiled/facebook-www
9 files changed
+316
-183
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9774 | 9774 | | |
9775 | 9775 | | |
9776 | 9776 | | |
9777 | | - | |
| 9777 | + | |
9778 | 9778 | | |
9779 | 9779 | | |
9780 | 9780 | | |
| |||
9805 | 9805 | | |
9806 | 9806 | | |
9807 | 9807 | | |
9808 | | - | |
| 9808 | + | |
9809 | 9809 | | |
9810 | 9810 | | |
9811 | 9811 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
10649 | 10649 | | |
10650 | 10650 | | |
10651 | 10651 | | |
10652 | | - | |
10653 | | - | |
| 10652 | + | |
10654 | 10653 | | |
10655 | 10654 | | |
10656 | 10655 | | |
| |||
11422 | 11421 | | |
11423 | 11422 | | |
11424 | 11423 | | |
11425 | | - | |
11426 | | - | |
11427 | | - | |
11428 | | - | |
11429 | | - | |
11430 | | - | |
11431 | | - | |
11432 | | - | |
11433 | | - | |
11434 | 11424 | | |
11435 | 11425 | | |
11436 | 11426 | | |
11437 | 11427 | | |
| 11428 | + | |
| 11429 | + | |
| 11430 | + | |
| 11431 | + | |
| 11432 | + | |
| 11433 | + | |
| 11434 | + | |
| 11435 | + | |
| 11436 | + | |
| 11437 | + | |
| 11438 | + | |
| 11439 | + | |
11438 | 11440 | | |
11439 | 11441 | | |
11440 | 11442 | | |
| |||
11485 | 11487 | | |
11486 | 11488 | | |
11487 | 11489 | | |
| 11490 | + | |
11488 | 11491 | | |
11489 | | - | |
| 11492 | + | |
| 11493 | + | |
| 11494 | + | |
| 11495 | + | |
| 11496 | + | |
11490 | 11497 | | |
11491 | 11498 | | |
11492 | 11499 | | |
| |||
11851 | 11858 | | |
11852 | 11859 | | |
11853 | 11860 | | |
| 11861 | + | |
11854 | 11862 | | |
11855 | 11863 | | |
11856 | 11864 | | |
| |||
12165 | 12173 | | |
12166 | 12174 | | |
12167 | 12175 | | |
| 12176 | + | |
12168 | 12177 | | |
12169 | 12178 | | |
12170 | 12179 | | |
| |||
12185 | 12194 | | |
12186 | 12195 | | |
12187 | 12196 | | |
| 12197 | + | |
| 12198 | + | |
12188 | 12199 | | |
12189 | 12200 | | |
12190 | 12201 | | |
| |||
12323 | 12334 | | |
12324 | 12335 | | |
12325 | 12336 | | |
12326 | | - | |
12327 | | - | |
12328 | 12337 | | |
12329 | 12338 | | |
12330 | 12339 | | |
| |||
12333 | 12342 | | |
12334 | 12343 | | |
12335 | 12344 | | |
| 12345 | + | |
12336 | 12346 | | |
12337 | 12347 | | |
12338 | 12348 | | |
| |||
12350 | 12360 | | |
12351 | 12361 | | |
12352 | 12362 | | |
| 12363 | + | |
| 12364 | + | |
| 12365 | + | |
| 12366 | + | |
| 12367 | + | |
| 12368 | + | |
| 12369 | + | |
| 12370 | + | |
12353 | 12371 | | |
12354 | 12372 | | |
12355 | 12373 | | |
| |||
12390 | 12408 | | |
12391 | 12409 | | |
12392 | 12410 | | |
12393 | | - | |
| 12411 | + | |
12394 | 12412 | | |
12395 | | - | |
12396 | | - | |
12397 | | - | |
12398 | | - | |
| 12413 | + | |
| 12414 | + | |
| 12415 | + | |
| 12416 | + | |
| 12417 | + | |
12399 | 12418 | | |
12400 | 12419 | | |
12401 | 12420 | | |
| |||
12678 | 12697 | | |
12679 | 12698 | | |
12680 | 12699 | | |
| 12700 | + | |
| 12701 | + | |
| 12702 | + | |
| 12703 | + | |
| 12704 | + | |
| 12705 | + | |
| 12706 | + | |
| 12707 | + | |
12681 | 12708 | | |
12682 | 12709 | | |
12683 | 12710 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
10408 | 10408 | | |
10409 | 10409 | | |
10410 | 10410 | | |
10411 | | - | |
10412 | | - | |
| 10411 | + | |
10413 | 10412 | | |
10414 | 10413 | | |
10415 | 10414 | | |
| |||
11170 | 11169 | | |
11171 | 11170 | | |
11172 | 11171 | | |
11173 | | - | |
11174 | | - | |
11175 | | - | |
11176 | | - | |
11177 | | - | |
11178 | | - | |
11179 | | - | |
11180 | | - | |
11181 | | - | |
11182 | 11172 | | |
11183 | 11173 | | |
11184 | 11174 | | |
11185 | 11175 | | |
| 11176 | + | |
| 11177 | + | |
| 11178 | + | |
| 11179 | + | |
| 11180 | + | |
| 11181 | + | |
| 11182 | + | |
| 11183 | + | |
| 11184 | + | |
| 11185 | + | |
| 11186 | + | |
| 11187 | + | |
11186 | 11188 | | |
11187 | 11189 | | |
11188 | 11190 | | |
| |||
11233 | 11235 | | |
11234 | 11236 | | |
11235 | 11237 | | |
| 11238 | + | |
11236 | 11239 | | |
11237 | | - | |
| 11240 | + | |
| 11241 | + | |
| 11242 | + | |
| 11243 | + | |
| 11244 | + | |
11238 | 11245 | | |
11239 | 11246 | | |
11240 | 11247 | | |
| |||
11599 | 11606 | | |
11600 | 11607 | | |
11601 | 11608 | | |
| 11609 | + | |
11602 | 11610 | | |
11603 | 11611 | | |
11604 | 11612 | | |
| |||
11913 | 11921 | | |
11914 | 11922 | | |
11915 | 11923 | | |
| 11924 | + | |
11916 | 11925 | | |
11917 | 11926 | | |
11918 | 11927 | | |
| |||
11933 | 11942 | | |
11934 | 11943 | | |
11935 | 11944 | | |
| 11945 | + | |
| 11946 | + | |
11936 | 11947 | | |
11937 | 11948 | | |
11938 | 11949 | | |
| |||
12071 | 12082 | | |
12072 | 12083 | | |
12073 | 12084 | | |
12074 | | - | |
12075 | | - | |
12076 | 12085 | | |
12077 | 12086 | | |
12078 | 12087 | | |
| |||
12081 | 12090 | | |
12082 | 12091 | | |
12083 | 12092 | | |
| 12093 | + | |
12084 | 12094 | | |
12085 | 12095 | | |
12086 | 12096 | | |
| |||
12098 | 12108 | | |
12099 | 12109 | | |
12100 | 12110 | | |
| 12111 | + | |
| 12112 | + | |
| 12113 | + | |
| 12114 | + | |
| 12115 | + | |
| 12116 | + | |
| 12117 | + | |
| 12118 | + | |
12101 | 12119 | | |
12102 | 12120 | | |
12103 | 12121 | | |
| |||
12138 | 12156 | | |
12139 | 12157 | | |
12140 | 12158 | | |
12141 | | - | |
| 12159 | + | |
12142 | 12160 | | |
12143 | | - | |
12144 | | - | |
12145 | | - | |
12146 | | - | |
| 12161 | + | |
| 12162 | + | |
| 12163 | + | |
| 12164 | + | |
| 12165 | + | |
12147 | 12166 | | |
12148 | 12167 | | |
12149 | 12168 | | |
| |||
12426 | 12445 | | |
12427 | 12446 | | |
12428 | 12447 | | |
| 12448 | + | |
| 12449 | + | |
| 12450 | + | |
| 12451 | + | |
| 12452 | + | |
| 12453 | + | |
| 12454 | + | |
| 12455 | + | |
12429 | 12456 | | |
12430 | 12457 | | |
12431 | 12458 | | |
| |||
0 commit comments