@samitouri / QOS-React-2 / commits / 03a62b20fd

[Flight] Look for moved debugInfo when logging component performance track (#34839)

Sebastian Markbåge committed Oct 14, 2025 at 07:21 UTC 03a62b20fddb197876ce20ac5ea34994b0e5b242
1 file changed +20 -1
packages/react-client/src/ReactFlightClient.js
+20 -1
@@ -4318,7 +4318,26 @@ function flushComponentPerformance(
4318
4319 // First find the start time of the first component to know if it was running
4320 // in parallel with the previous.
4321 - const debugInfo = __DEV__ && root._debugInfo;
4321 + let debugInfo = null;
4322 + if (__DEV__) {
4323 + debugInfo = root._debugInfo;
4324 + if (debugInfo.length === 0 && root.status === 'fulfilled') {
4325 + const resolvedValue = resolveLazy(root.value);
4326 + if (
4327 + typeof resolvedValue === 'object' &&
4328 + resolvedValue !== null &&
4329 + (isArray(resolvedValue) ||
4330 + typeof resolvedValue[ASYNC_ITERATOR] === 'function' ||
4331 + resolvedValue.$$typeof === REACT_ELEMENT_TYPE ||
4332 + resolvedValue.$$typeof === REACT_LAZY_TYPE) &&
4333 + isArray(resolvedValue._debugInfo)
4334 + ) {
4335 + // It's possible that the value has been given the debug info.
4336 + // In that case we need to look for it on the resolved value.
4337 + debugInfo = resolvedValue._debugInfo;
4338 + }
4339 + }
4340 + }
4341 if (debugInfo) {
4342 let startTime = 0;
4343 for (let i = 0; i < debugInfo.length; i++) {