Skip to content

Commit 56e29e3

Browse files
committed
[Fiber] Transfer _debugInfo from Arrays, Lazy, Thenables and Elements to the inner Fibers. (#28286)
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 [3f93ca1](3f93ca1)
1 parent 23457ab commit 56e29e3

21 files changed

+2213
-688
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9e7944f67c72b9a69a8db092ba6bd99fe9c731e2
1+
3f93ca1c8dec1fd85df4dbb748a2df9438fc699f

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,4 +617,4 @@ exports.useSyncExternalStore = function (
617617
exports.useTransition = function () {
618618
return ReactCurrentDispatcher.current.useTransition();
619619
};
620-
exports.version = "18.3.0-www-classic-1feffe18";
620+
exports.version = "18.3.0-www-classic-1596b9e6";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ exports.useSyncExternalStore = function (
621621
exports.useTransition = function () {
622622
return ReactCurrentDispatcher.current.useTransition();
623623
};
624-
exports.version = "18.3.0-www-classic-3fb37a53";
624+
exports.version = "18.3.0-www-classic-317962e3";
625625
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
626626
"function" ===
627627
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)