Commit db71391
authored
[Fiber] Instrument the lazy initializer thenable in all cases (facebook#35521)
When a lazy element or component is initialized a thenable is returned
which was only be conditionally instrumented in dev when asyncDebugInfo
was enabled. When instrumented these thenables can be used in
conjunction with the SuspendOnImmediate optimization where if a thenable
resolves before the stack unwinds we can continue rendering from the
last suspended fiber. Without this change a recent fix to the useId
implementation cannot be easily tested in production because this
optimization pathway isn't available to regular React.lazy thenables. To
land the prior PR I changed the thenables to a custom type so I could
instrument manually in the test. WIth this change we can just use a
regular Promise since ReactLazy will instrument in all
environments/flags now1 parent 4cf9063 commit db71391
File tree
2 files changed
+25
-34
lines changed- packages
- react-dom/src/__tests__
- react/src
2 files changed
+25
-34
lines changedLines changed: 7 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9551 | 9551 | | |
9552 | 9552 | | |
9553 | 9553 | | |
9554 | | - | |
| 9554 | + | |
9555 | 9555 | | |
9556 | | - | |
9557 | | - | |
9558 | | - | |
9559 | | - | |
9560 | | - | |
9561 | | - | |
9562 | | - | |
| 9556 | + | |
| 9557 | + | |
9563 | 9558 | | |
9564 | | - | |
9565 | 9559 | | |
9566 | 9560 | | |
9567 | 9561 | | |
9568 | | - | |
| 9562 | + | |
9569 | 9563 | | |
9570 | | - | |
9571 | | - | |
9572 | | - | |
9573 | | - | |
9574 | | - | |
9575 | | - | |
9576 | | - | |
9577 | | - | |
9578 | | - | |
| 9564 | + | |
| 9565 | + | |
| 9566 | + | |
9579 | 9567 | | |
9580 | | - | |
9581 | 9568 | | |
9582 | 9569 | | |
9583 | 9570 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
127 | 129 | | |
128 | 130 | | |
129 | 131 | | |
| |||
151 | 153 | | |
152 | 154 | | |
153 | 155 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
161 | 165 | | |
162 | 166 | | |
163 | 167 | | |
| |||
0 commit comments