Skip to content

Commit 18e907e

Browse files
committed
[Fiber] Stash ThenableState on the Dependencies Object for Use By DevTools (#30866)
This lets us track what a Component might suspend on from DevTools. We could already collect this by replaying a component's Hooks but that would be expensive to collect from a whole tree. The thenables themselves might contain useful information but mainly we'd want access to the `_debugInfo` on the thenables which might contain additional information from the server. https://github.com/facebook/react/blob/19bd26beb689e554fceb0b929dc5199be8cba594/packages/shared/ReactTypes.js#L114 In a follow up we should really do something similar in Flight to transfer `use()` on the debugInfo of that Server Component. DiffTrain build for commit 8d68da3.
1 parent 3ba4b12 commit 18e907e

File tree

14 files changed

+95
-53
lines changed

14 files changed

+95
-53
lines changed

compiled-rn/VERSION_NATIVE_FB

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19.0.0-native-fb-246d7bfe-20240826
1+
19.0.0-native-fb-8d68da3f-20240903

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<9fd63ef3b1c7300e9c6d203ae91a8b08>>
10+
* @generated SignedSource<<f2db4f138a96e7535db3c704161f2a6d>>
1111
*/
1212

1313
"use strict";
@@ -3676,6 +3676,14 @@ __DEV__ &&
36763676
}
36773677
function finishRenderingHooks(current, workInProgress) {
36783678
workInProgress._debugHookTypes = hookTypesDev;
3679+
null === workInProgress.dependencies
3680+
? null !== thenableState &&
3681+
(workInProgress.dependencies = {
3682+
lanes: 0,
3683+
firstContext: null,
3684+
_debugThenableState: thenableState
3685+
})
3686+
: (workInProgress.dependencies._debugThenableState = thenableState);
36793687
ReactSharedInternals.H = ContextOnlyDispatcher;
36803688
var didRenderTooFewHooks =
36813689
null !== currentHook && null !== currentHook.next;
@@ -7796,7 +7804,11 @@ __DEV__ &&
77967804
"Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
77977805
);
77987806
lastContextDependency = context;
7799-
consumer.dependencies = { lanes: 0, firstContext: context };
7807+
consumer.dependencies = {
7808+
lanes: 0,
7809+
firstContext: context,
7810+
_debugThenableState: null
7811+
};
78007812
} else lastContextDependency = lastContextDependency.next = context;
78017813
return value;
78027814
}
@@ -12230,7 +12242,8 @@ __DEV__ &&
1223012242
? null
1223112243
: {
1223212244
lanes: pendingProps.lanes,
12233-
firstContext: pendingProps.firstContext
12245+
firstContext: pendingProps.firstContext,
12246+
_debugThenableState: pendingProps._debugThenableState
1223412247
};
1223512248
workInProgress.sibling = current.sibling;
1223612249
workInProgress.index = current.index;
@@ -12283,7 +12296,8 @@ __DEV__ &&
1228312296
? null
1228412297
: {
1228512298
lanes: renderLanes.lanes,
12286-
firstContext: renderLanes.firstContext
12299+
firstContext: renderLanes.firstContext,
12300+
_debugThenableState: renderLanes._debugThenableState
1228712301
}),
1228812302
(workInProgress.selfBaseDuration = current.selfBaseDuration),
1228912303
(workInProgress.treeBaseDuration = current.treeBaseDuration));
@@ -14938,11 +14952,11 @@ __DEV__ &&
1493814952
(function () {
1493914953
var internals = {
1494014954
bundleType: 1,
14941-
version: "19.0.0-native-fb-246d7bfe-20240826",
14955+
version: "19.0.0-native-fb-8d68da3f-20240903",
1494214956
rendererPackageName: "react-test-renderer",
1494314957
currentDispatcherRef: ReactSharedInternals,
1494414958
findFiberByHostInstance: getInstanceFromNode,
14945-
reconcilerVersion: "19.0.0-native-fb-246d7bfe-20240826"
14959+
reconcilerVersion: "19.0.0-native-fb-8d68da3f-20240903"
1494614960
};
1494714961
internals.overrideHookState = overrideHookState;
1494814962
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -15087,5 +15101,5 @@ __DEV__ &&
1508715101
flushSyncWorkAcrossRoots_impl(0, !0));
1508815102
}
1508915103
};
15090-
exports.version = "19.0.0-native-fb-246d7bfe-20240826";
15104+
exports.version = "19.0.0-native-fb-8d68da3f-20240903";
1509115105
})();

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<c126df2e448ffc59e98d891cf74ae8d2>>
10+
* @generated SignedSource<<8ab9ee6b60c4927fc87658452c1ef8e1>>
1111
*/
1212

1313
"use strict";
@@ -9331,14 +9331,14 @@ function wrapFiber(fiber) {
93319331
}
93329332
var internals$jscomp$inline_1216 = {
93339333
bundleType: 0,
9334-
version: "19.0.0-native-fb-246d7bfe-20240826",
9334+
version: "19.0.0-native-fb-8d68da3f-20240903",
93359335
rendererPackageName: "react-test-renderer",
93369336
currentDispatcherRef: ReactSharedInternals,
93379337
findFiberByHostInstance: function (mockNode) {
93389338
mockNode = nodeToInstanceMap.get(mockNode);
93399339
return void 0 !== mockNode ? mockNode.internalInstanceHandle : null;
93409340
},
9341-
reconcilerVersion: "19.0.0-native-fb-246d7bfe-20240826"
9341+
reconcilerVersion: "19.0.0-native-fb-8d68da3f-20240903"
93429342
};
93439343
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
93449344
var hook$jscomp$inline_1217 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -9474,4 +9474,4 @@ exports.unstable_batchedUpdates = function (fn, a) {
94749474
flushSyncWorkAcrossRoots_impl(0, !0));
94759475
}
94769476
};
9477-
exports.version = "19.0.0-native-fb-246d7bfe-20240826";
9477+
exports.version = "19.0.0-native-fb-8d68da3f-20240903";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<1730b3d88bae08be3715d2c99dbe4f36>>
10+
* @generated SignedSource<<e248d99b7723de8d3af2a0d7fe19e52e>>
1111
*/
1212

1313
"use strict";
@@ -9944,14 +9944,14 @@ function wrapFiber(fiber) {
99449944
}
99459945
var internals$jscomp$inline_1117 = {
99469946
bundleType: 0,
9947-
version: "19.0.0-native-fb-246d7bfe-20240826",
9947+
version: "19.0.0-native-fb-8d68da3f-20240903",
99489948
rendererPackageName: "react-test-renderer",
99499949
currentDispatcherRef: ReactSharedInternals,
99509950
findFiberByHostInstance: function (mockNode) {
99519951
mockNode = nodeToInstanceMap.get(mockNode);
99529952
return void 0 !== mockNode ? mockNode.internalInstanceHandle : null;
99539953
},
9954-
reconcilerVersion: "19.0.0-native-fb-246d7bfe-20240826",
9954+
reconcilerVersion: "19.0.0-native-fb-8d68da3f-20240903",
99559955
getLaneLabelMap: function () {
99569956
for (
99579957
var map = new Map(), lane = 1, index$149 = 0;
@@ -10102,4 +10102,4 @@ exports.unstable_batchedUpdates = function (fn, a) {
1010210102
flushSyncWorkAcrossRoots_impl(0, !0));
1010310103
}
1010410104
};
10105-
exports.version = "19.0.0-native-fb-246d7bfe-20240826";
10105+
exports.version = "19.0.0-native-fb-8d68da3f-20240903";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<896f79c85e8c2785f38cee89b95a332f>>
10+
* @generated SignedSource<<3086926418188819cb264b2b4ce337d7>>
1111
*/
1212

1313
"use strict";
@@ -1705,7 +1705,7 @@ __DEV__ &&
17051705
exports.useTransition = function () {
17061706
return resolveDispatcher().useTransition();
17071707
};
1708-
exports.version = "19.0.0-native-fb-246d7bfe-20240826";
1708+
exports.version = "19.0.0-native-fb-8d68da3f-20240903";
17091709
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
17101710
"function" ===
17111711
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<fc1f4804ec761bcebe4c15d74709e0e6>>
10+
* @generated SignedSource<<67e2739cc6ec149e186940fa71fedf5a>>
1111
*/
1212

1313
"use strict";
@@ -580,4 +580,4 @@ exports.useSyncExternalStore = function (
580580
exports.useTransition = function () {
581581
return ReactSharedInternals.H.useTransition();
582582
};
583-
exports.version = "19.0.0-native-fb-246d7bfe-20240826";
583+
exports.version = "19.0.0-native-fb-8d68da3f-20240903";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<695d3ab4be692d0760b33e3253e66289>>
10+
* @generated SignedSource<<00f72c0d892fa33507b893f4a9760683>>
1111
*/
1212

1313
"use strict";
@@ -584,7 +584,7 @@ exports.useSyncExternalStore = function (
584584
exports.useTransition = function () {
585585
return ReactSharedInternals.H.useTransition();
586586
};
587-
exports.version = "19.0.0-native-fb-246d7bfe-20240826";
587+
exports.version = "19.0.0-native-fb-8d68da3f-20240903";
588588
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
589589
"function" ===
590590
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
246d7bfeb0c90ecccd9531929b60a79d628a4c78
1+
8d68da3f7396064614f34b84881fe8833b6039ac

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<554f420a6fa3f25ed0f068fc6a103bef>>
10+
* @generated SignedSource<<9ef28de841583eb0dc8a86a45dee3b60>>
1111
*/
1212

1313
"use strict";
@@ -4571,6 +4571,14 @@ __DEV__ &&
45714571
}
45724572
function finishRenderingHooks(current, workInProgress) {
45734573
workInProgress._debugHookTypes = hookTypesDev;
4574+
null === workInProgress.dependencies
4575+
? null !== thenableState &&
4576+
(workInProgress.dependencies = {
4577+
lanes: 0,
4578+
firstContext: null,
4579+
_debugThenableState: thenableState
4580+
})
4581+
: (workInProgress.dependencies._debugThenableState = thenableState);
45744582
ReactSharedInternals.H = ContextOnlyDispatcher;
45754583
var didRenderTooFewHooks =
45764584
null !== currentHook && null !== currentHook.next;
@@ -8952,7 +8960,11 @@ __DEV__ &&
89528960
"Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
89538961
);
89548962
lastContextDependency = context;
8955-
consumer.dependencies = { lanes: 0, firstContext: context };
8963+
consumer.dependencies = {
8964+
lanes: 0,
8965+
firstContext: context,
8966+
_debugThenableState: null
8967+
};
89568968
enableLazyContextPropagation && (consumer.flags |= 524288);
89578969
} else lastContextDependency = lastContextDependency.next = context;
89588970
return value;
@@ -13464,7 +13476,8 @@ __DEV__ &&
1346413476
? null
1346513477
: {
1346613478
lanes: pendingProps.lanes,
13467-
firstContext: pendingProps.firstContext
13479+
firstContext: pendingProps.firstContext,
13480+
_debugThenableState: pendingProps._debugThenableState
1346813481
};
1346913482
workInProgress.sibling = current.sibling;
1347013483
workInProgress.index = current.index;
@@ -13517,7 +13530,8 @@ __DEV__ &&
1351713530
? null
1351813531
: {
1351913532
lanes: renderLanes.lanes,
13520-
firstContext: renderLanes.firstContext
13533+
firstContext: renderLanes.firstContext,
13534+
_debugThenableState: renderLanes._debugThenableState
1352113535
}),
1352213536
(workInProgress.selfBaseDuration = current.selfBaseDuration),
1352313537
(workInProgress.treeBaseDuration = current.treeBaseDuration));
@@ -16952,11 +16966,11 @@ __DEV__ &&
1695216966
(function () {
1695316967
var internals = {
1695416968
bundleType: 1,
16955-
version: "19.0.0-native-fb-246d7bfe-20240826",
16969+
version: "19.0.0-native-fb-8d68da3f-20240903",
1695616970
rendererPackageName: "react-native-renderer",
1695716971
currentDispatcherRef: ReactSharedInternals,
1695816972
findFiberByHostInstance: getInstanceFromNode,
16959-
reconcilerVersion: "19.0.0-native-fb-246d7bfe-20240826"
16973+
reconcilerVersion: "19.0.0-native-fb-8d68da3f-20240903"
1696016974
};
1696116975
null !== extraDevToolsConfig &&
1696216976
(internals.rendererConfig = extraDevToolsConfig);

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<29f175ffe3a5d88a87ee965eaba00742>>
10+
* @generated SignedSource<<acaa31fb9763a1810659aacab7dd2a6f>>
1111
*/
1212

1313
"use strict";
@@ -10852,11 +10852,11 @@ batchedUpdatesImpl = function (fn, a) {
1085210852
var roots = new Map(),
1085310853
internals$jscomp$inline_1151 = {
1085410854
bundleType: 0,
10855-
version: "19.0.0-native-fb-246d7bfe-20240826",
10855+
version: "19.0.0-native-fb-8d68da3f-20240903",
1085610856
rendererPackageName: "react-native-renderer",
1085710857
currentDispatcherRef: ReactSharedInternals,
1085810858
findFiberByHostInstance: getInstanceFromNode,
10859-
reconcilerVersion: "19.0.0-native-fb-246d7bfe-20240826"
10859+
reconcilerVersion: "19.0.0-native-fb-8d68da3f-20240903"
1086010860
};
1086110861
null !== extraDevToolsConfig &&
1086210862
(internals$jscomp$inline_1151.rendererConfig = extraDevToolsConfig);

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<9eaa9c4ff858b3df438918ddfcf7f694>>
10+
* @generated SignedSource<<014d80b875dc73d152ab691019204f09>>
1111
*/
1212

1313
"use strict";
@@ -11555,11 +11555,11 @@ batchedUpdatesImpl = function (fn, a) {
1155511555
var roots = new Map(),
1155611556
internals$jscomp$inline_1233 = {
1155711557
bundleType: 0,
11558-
version: "19.0.0-native-fb-246d7bfe-20240826",
11558+
version: "19.0.0-native-fb-8d68da3f-20240903",
1155911559
rendererPackageName: "react-native-renderer",
1156011560
currentDispatcherRef: ReactSharedInternals,
1156111561
findFiberByHostInstance: getInstanceFromNode,
11562-
reconcilerVersion: "19.0.0-native-fb-246d7bfe-20240826"
11562+
reconcilerVersion: "19.0.0-native-fb-8d68da3f-20240903"
1156311563
};
1156411564
null !== extraDevToolsConfig &&
1156511565
(internals$jscomp$inline_1233.rendererConfig = extraDevToolsConfig);

0 commit comments

Comments
 (0)