Commit db59a3e
committed
[Fiber] Transfer
That way we can use it for debug information like component stacks and
DevTools. I used an extra stack argument in Child Fiber to track this as
it's flowing down since it's not just elements where we have this info
readily available but parent arrays and lazy can merge this into the
Fiber too. It's not great that this is a dev-only argument and I could
track it globally but seems more likely to make mistakes.
It is possible for the same debug info to appear for multiple child
fibers like when it's attached to a fragment or a lazy that resolves to
a fragment at the root. The object identity could be used in these
scenarios to infer if that's really one server component that's a parent
of all children or if each child has a server component with the same
name.
This is effectively a public API because you can use it to stash
information on Promises from a third-party service - not just Server
Components. I started outline the types for this for some things I was
planning to add but it's not final.
I was also planning on storing it from `use(thenable)` for when you
suspend on a Promise. However, I realized that there's no Hook instance
for those to stash it on. So it might need a separate data structure to
stash the previous pass over of `use()` that resets each render.
No tests yet since I didn't want to test internals but it'll be covered
once we have debugging features like component stacks.
DiffTrain build for commit 3f93ca1._debugInfo from Arrays, Lazy, Thenables and Elements to the inner Fibers. (#28286)1 parent 1739b31 commit db59a3e
File tree
13 files changed
+841
-287
lines changed- compiled-rn/facebook-fbsource/xplat/js
- RKJSModules/vendor
- react-test-renderer/cjs
- react/cjs
- react-native-github/Libraries/Renderer
- implementations
13 files changed
+841
-287
lines changedLines changed: 245 additions & 49 deletions
Large diffs are not rendered by default.
Lines changed: 19 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
2108 | 2108 | | |
2109 | 2109 | | |
2110 | 2110 | | |
2111 | | - | |
| 2111 | + | |
2112 | 2112 | | |
2113 | 2113 | | |
2114 | 2114 | | |
| |||
2165 | 2165 | | |
2166 | 2166 | | |
2167 | 2167 | | |
2168 | | - | |
2169 | | - | |
2170 | | - | |
2171 | | - | |
2172 | | - | |
2173 | | - | |
| 2168 | + | |
2174 | 2169 | | |
2175 | 2170 | | |
2176 | 2171 | | |
| |||
2180 | 2175 | | |
2181 | 2176 | | |
2182 | 2177 | | |
2183 | | - | |
2184 | | - | |
| 2178 | + | |
2185 | 2179 | | |
2186 | 2180 | | |
2187 | 2181 | | |
| |||
9168 | 9162 | | |
9169 | 9163 | | |
9170 | 9164 | | |
9171 | | - | |
| 9165 | + | |
9172 | 9166 | | |
9173 | 9167 | | |
9174 | 9168 | | |
9175 | 9169 | | |
9176 | | - | |
| 9170 | + | |
9177 | 9171 | | |
9178 | 9172 | | |
9179 | | - | |
9180 | | - | |
9181 | | - | |
9182 | | - | |
9183 | | - | |
| 9173 | + | |
| 9174 | + | |
| 9175 | + | |
| 9176 | + | |
| 9177 | + | |
9184 | 9178 | | |
9185 | 9179 | | |
9186 | 9180 | | |
| |||
9197 | 9191 | | |
9198 | 9192 | | |
9199 | 9193 | | |
9200 | | - | |
| 9194 | + | |
9201 | 9195 | | |
9202 | 9196 | | |
9203 | 9197 | | |
9204 | 9198 | | |
9205 | 9199 | | |
9206 | 9200 | | |
9207 | | - | |
| 9201 | + | |
9208 | 9202 | | |
9209 | 9203 | | |
9210 | | - | |
| 9204 | + | |
9211 | 9205 | | |
9212 | | - | |
9213 | | - | |
| 9206 | + | |
| 9207 | + | |
9214 | 9208 | | |
9215 | 9209 | | |
9216 | | - | |
9217 | | - | |
| 9210 | + | |
| 9211 | + | |
9218 | 9212 | | |
9219 | | - | |
| 9213 | + | |
9220 | 9214 | | |
9221 | 9215 | | |
9222 | 9216 | | |
| |||
Lines changed: 19 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
2128 | 2128 | | |
2129 | 2129 | | |
2130 | 2130 | | |
2131 | | - | |
| 2131 | + | |
2132 | 2132 | | |
2133 | 2133 | | |
2134 | 2134 | | |
| |||
2185 | 2185 | | |
2186 | 2186 | | |
2187 | 2187 | | |
2188 | | - | |
2189 | | - | |
2190 | | - | |
2191 | | - | |
2192 | | - | |
2193 | | - | |
| 2188 | + | |
2194 | 2189 | | |
2195 | 2190 | | |
2196 | 2191 | | |
| |||
2200 | 2195 | | |
2201 | 2196 | | |
2202 | 2197 | | |
2203 | | - | |
2204 | | - | |
| 2198 | + | |
2205 | 2199 | | |
2206 | 2200 | | |
2207 | 2201 | | |
| |||
9596 | 9590 | | |
9597 | 9591 | | |
9598 | 9592 | | |
9599 | | - | |
| 9593 | + | |
9600 | 9594 | | |
9601 | 9595 | | |
9602 | 9596 | | |
9603 | 9597 | | |
9604 | | - | |
| 9598 | + | |
9605 | 9599 | | |
9606 | 9600 | | |
9607 | | - | |
9608 | | - | |
9609 | | - | |
9610 | | - | |
9611 | | - | |
| 9601 | + | |
| 9602 | + | |
| 9603 | + | |
| 9604 | + | |
| 9605 | + | |
9612 | 9606 | | |
9613 | 9607 | | |
9614 | 9608 | | |
| |||
9625 | 9619 | | |
9626 | 9620 | | |
9627 | 9621 | | |
9628 | | - | |
| 9622 | + | |
9629 | 9623 | | |
9630 | 9624 | | |
9631 | 9625 | | |
9632 | 9626 | | |
9633 | 9627 | | |
9634 | 9628 | | |
9635 | | - | |
| 9629 | + | |
9636 | 9630 | | |
9637 | 9631 | | |
9638 | | - | |
| 9632 | + | |
9639 | 9633 | | |
9640 | | - | |
9641 | | - | |
| 9634 | + | |
| 9635 | + | |
9642 | 9636 | | |
9643 | 9637 | | |
9644 | | - | |
9645 | | - | |
| 9638 | + | |
| 9639 | + | |
9646 | 9640 | | |
9647 | | - | |
| 9641 | + | |
9648 | 9642 | | |
9649 | 9643 | | |
9650 | 9644 | | |
| |||
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 | |
|---|---|---|---|
| |||
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
593 | | - | |
| 593 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
586 | 586 | | |
587 | 587 | | |
588 | 588 | | |
589 | | - | |
| 589 | + | |
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments