Skip to content

Commit

Permalink
Log Render Phases that Never Committed (#31548)
Browse files Browse the repository at this point in the history
This includes:

- `Interrupted Render`: Interrupted Renders (setState or ping at higher
priority)
- `Prewarm`: Suspended Renders outside a Suspense boundary
(RootSuspendedWithDelay/RootSuspendedAtTheShell)
- `Errored Render`: Render that errored somewhere in the tree (Fatal or
Not) (which may or may not be retried and then complete)
- `Teared Render`: Due to useSyncExternalStore not matching (which will
do another sync attempt)

Suspended Commit:

<img width="893" alt="Screenshot 2024-11-14 at 11 47 40 PM"
src="https://github.com/user-attachments/assets/b25a6a8b-a5e9-4d66-b325-57aef4bf9dad">

Errored with a second recovery attempt that also errors:

<img width="976" alt="Screenshot 2024-11-15 at 12 09 06 AM"
src="https://github.com/user-attachments/assets/9ce52cbb-b587-4f1e-8b67-e51d9073ae5b">

DiffTrain build for [3720870](3720870)
  • Loading branch information
sebmarkbage committed Nov 15, 2024
1 parent fcb79ce commit 06cc3b9
Show file tree
Hide file tree
Showing 34 changed files with 370 additions and 226 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8a41d6ceab8af642d8ab9ed04fc744a699f4ac09
3720870a979b48a1ea8776f64a190878b8558f2b
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8a41d6ceab8af642d8ab9ed04fc744a699f4ac09
3720870a979b48a1ea8776f64a190878b8558f2b
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-classic-8a41d6ce-20241114";
exports.version = "19.0.0-www-classic-3720870a-20241115";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-modern-8a41d6ce-20241114";
exports.version = "19.0.0-www-modern-3720870a-20241115";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -619,4 +619,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-8a41d6ce-20241114";
exports.version = "19.0.0-www-classic-3720870a-20241115";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -619,4 +619,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-8a41d6ce-20241114";
exports.version = "19.0.0-www-modern-3720870a-20241115";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-8a41d6ce-20241114";
exports.version = "19.0.0-www-classic-3720870a-20241115";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-8a41d6ce-20241114";
exports.version = "19.0.0-www-modern-3720870a-20241115";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
54 changes: 31 additions & 23 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -12321,16 +12321,17 @@ __DEV__ &&
break;
}
a: {
shouldTimeSlice = root;
switch (exitStatus) {
renderWasConcurrent = root;
shouldTimeSlice = exitStatus;
switch (shouldTimeSlice) {
case RootInProgress:
case RootFatalErrored:
throw Error("Root did not complete. This is a bug in React.");
case RootSuspendedWithDelay:
if ((lanes & 4194176) !== lanes) break;
case RootSuspendedAtTheShell:
markRootSuspended(
shouldTimeSlice,
renderWasConcurrent,
lanes,
workInProgressDeferredLane,
!workInProgressRootDidSkipSuspendedSiblings
Expand All @@ -12345,17 +12346,19 @@ __DEV__ &&
default:
throw Error("Unknown root exit status.");
}
shouldTimeSlice.finishedWork = forceSync;
shouldTimeSlice.finishedLanes = lanes;
renderWasConcurrent.finishedWork = forceSync;
renderWasConcurrent.finishedLanes = lanes;
if (null !== ReactSharedInternals.actQueue) {
lanes = shouldTimeSlice;
lanes = renderWasConcurrent;
forceSync = workInProgressRootRecoverableErrors;
shouldTimeSlice = workInProgressTransitions;
exitStatus = workInProgressRootDidIncludeRecursiveRenderUpdate;
renderWasConcurrent = workInProgressDeferredLane;
lanesThatJustErrored = workInProgressRootInterleavedUpdatedLanes;
originallyAttemptedLanes = workInProgressSuspendedRetryLanes;
var suspendedCommitReason = IMMEDIATE_COMMIT,
exitStatus = workInProgressTransitions;
renderWasConcurrent =
workInProgressRootDidIncludeRecursiveRenderUpdate;
lanesThatJustErrored = workInProgressDeferredLane;
originallyAttemptedLanes =
workInProgressRootInterleavedUpdatedLanes;
var suspendedRetryLanes = workInProgressSuspendedRetryLanes,
suspendedCommitReason = IMMEDIATE_COMMIT,
prevTransition = ReactSharedInternals.T,
previousUpdateLanePriority = currentUpdatePriority;
try {
Expand All @@ -12364,12 +12367,13 @@ __DEV__ &&
commitRootImpl(
lanes,
forceSync,
shouldTimeSlice,
exitStatus,
previousUpdateLanePriority,
renderWasConcurrent,
previousUpdateLanePriority,
lanesThatJustErrored,
originallyAttemptedLanes,
suspendedRetryLanes,
shouldTimeSlice,
suspendedCommitReason,
-0,
0
Expand All @@ -12381,24 +12385,24 @@ __DEV__ &&
} else {
if (
(lanes & 62914560) === lanes &&
(alwaysThrottleRetries || exitStatus === RootSuspended) &&
(alwaysThrottleRetries || shouldTimeSlice === RootSuspended) &&
((exitStatus =
globalMostRecentFallbackTime +
FALLBACK_THROTTLE_MS -
now$1()),
10 < exitStatus)
) {
markRootSuspended(
shouldTimeSlice,
renderWasConcurrent,
lanes,
workInProgressDeferredLane,
!workInProgressRootDidSkipSuspendedSiblings
);
if (0 !== getNextLanes(shouldTimeSlice, 0)) break a;
shouldTimeSlice.timeoutHandle = scheduleTimeout(
if (0 !== getNextLanes(renderWasConcurrent, 0)) break a;
renderWasConcurrent.timeoutHandle = scheduleTimeout(
commitRootWhenReady.bind(
null,
shouldTimeSlice,
renderWasConcurrent,
forceSync,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
Expand All @@ -12408,6 +12412,7 @@ __DEV__ &&
workInProgressRootInterleavedUpdatedLanes,
workInProgressSuspendedRetryLanes,
workInProgressRootDidSkipSuspendedSiblings,
shouldTimeSlice,
THROTTLED_COMMIT,
-0,
0
Expand All @@ -12417,7 +12422,7 @@ __DEV__ &&
break a;
}
commitRootWhenReady(
shouldTimeSlice,
renderWasConcurrent,
forceSync,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
Expand All @@ -12427,6 +12432,7 @@ __DEV__ &&
workInProgressRootInterleavedUpdatedLanes,
workInProgressSuspendedRetryLanes,
workInProgressRootDidSkipSuspendedSiblings,
shouldTimeSlice,
IMMEDIATE_COMMIT,
-0,
0
Expand Down Expand Up @@ -12457,6 +12463,7 @@ __DEV__ &&
updatedLanes,
suspendedRetryLanes,
didSkipSuspendedSiblings,
exitStatus,
suspendedCommitReason,
completedRenderStartTime,
completedRenderEndTime
Expand All @@ -12478,6 +12485,7 @@ __DEV__ &&
spawnedLane,
updatedLanes,
suspendedRetryLanes,
exitStatus,
suspendedCommitReason,
completedRenderStartTime,
completedRenderEndTime
Expand Down Expand Up @@ -16709,11 +16717,11 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-classic-8a41d6ce-20241114",
version: "19.0.0-www-classic-3720870a-20241115",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getInstanceFromNode,
reconcilerVersion: "19.0.0-www-classic-8a41d6ce-20241114"
reconcilerVersion: "19.0.0-www-classic-3720870a-20241115"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -16747,7 +16755,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-classic-8a41d6ce-20241114";
exports.version = "19.0.0-www-classic-3720870a-20241115";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
54 changes: 31 additions & 23 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -12125,16 +12125,17 @@ __DEV__ &&
break;
}
a: {
shouldTimeSlice = root;
switch (exitStatus) {
renderWasConcurrent = root;
shouldTimeSlice = exitStatus;
switch (shouldTimeSlice) {
case RootInProgress:
case RootFatalErrored:
throw Error("Root did not complete. This is a bug in React.");
case RootSuspendedWithDelay:
if ((lanes & 4194176) !== lanes) break;
case RootSuspendedAtTheShell:
markRootSuspended(
shouldTimeSlice,
renderWasConcurrent,
lanes,
workInProgressDeferredLane,
!workInProgressRootDidSkipSuspendedSiblings
Expand All @@ -12149,17 +12150,19 @@ __DEV__ &&
default:
throw Error("Unknown root exit status.");
}
shouldTimeSlice.finishedWork = forceSync;
shouldTimeSlice.finishedLanes = lanes;
renderWasConcurrent.finishedWork = forceSync;
renderWasConcurrent.finishedLanes = lanes;
if (null !== ReactSharedInternals.actQueue) {
lanes = shouldTimeSlice;
lanes = renderWasConcurrent;
forceSync = workInProgressRootRecoverableErrors;
shouldTimeSlice = workInProgressTransitions;
exitStatus = workInProgressRootDidIncludeRecursiveRenderUpdate;
renderWasConcurrent = workInProgressDeferredLane;
lanesThatJustErrored = workInProgressRootInterleavedUpdatedLanes;
originallyAttemptedLanes = workInProgressSuspendedRetryLanes;
var suspendedCommitReason = IMMEDIATE_COMMIT,
exitStatus = workInProgressTransitions;
renderWasConcurrent =
workInProgressRootDidIncludeRecursiveRenderUpdate;
lanesThatJustErrored = workInProgressDeferredLane;
originallyAttemptedLanes =
workInProgressRootInterleavedUpdatedLanes;
var suspendedRetryLanes = workInProgressSuspendedRetryLanes,
suspendedCommitReason = IMMEDIATE_COMMIT,
prevTransition = ReactSharedInternals.T,
previousUpdateLanePriority = currentUpdatePriority;
try {
Expand All @@ -12168,12 +12171,13 @@ __DEV__ &&
commitRootImpl(
lanes,
forceSync,
shouldTimeSlice,
exitStatus,
previousUpdateLanePriority,
renderWasConcurrent,
previousUpdateLanePriority,
lanesThatJustErrored,
originallyAttemptedLanes,
suspendedRetryLanes,
shouldTimeSlice,
suspendedCommitReason,
-0,
0
Expand All @@ -12185,24 +12189,24 @@ __DEV__ &&
} else {
if (
(lanes & 62914560) === lanes &&
(alwaysThrottleRetries || exitStatus === RootSuspended) &&
(alwaysThrottleRetries || shouldTimeSlice === RootSuspended) &&
((exitStatus =
globalMostRecentFallbackTime +
FALLBACK_THROTTLE_MS -
now$1()),
10 < exitStatus)
) {
markRootSuspended(
shouldTimeSlice,
renderWasConcurrent,
lanes,
workInProgressDeferredLane,
!workInProgressRootDidSkipSuspendedSiblings
);
if (0 !== getNextLanes(shouldTimeSlice, 0)) break a;
shouldTimeSlice.timeoutHandle = scheduleTimeout(
if (0 !== getNextLanes(renderWasConcurrent, 0)) break a;
renderWasConcurrent.timeoutHandle = scheduleTimeout(
commitRootWhenReady.bind(
null,
shouldTimeSlice,
renderWasConcurrent,
forceSync,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
Expand All @@ -12212,6 +12216,7 @@ __DEV__ &&
workInProgressRootInterleavedUpdatedLanes,
workInProgressSuspendedRetryLanes,
workInProgressRootDidSkipSuspendedSiblings,
shouldTimeSlice,
THROTTLED_COMMIT,
-0,
0
Expand All @@ -12221,7 +12226,7 @@ __DEV__ &&
break a;
}
commitRootWhenReady(
shouldTimeSlice,
renderWasConcurrent,
forceSync,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
Expand All @@ -12231,6 +12236,7 @@ __DEV__ &&
workInProgressRootInterleavedUpdatedLanes,
workInProgressSuspendedRetryLanes,
workInProgressRootDidSkipSuspendedSiblings,
shouldTimeSlice,
IMMEDIATE_COMMIT,
-0,
0
Expand Down Expand Up @@ -12261,6 +12267,7 @@ __DEV__ &&
updatedLanes,
suspendedRetryLanes,
didSkipSuspendedSiblings,
exitStatus,
suspendedCommitReason,
completedRenderStartTime,
completedRenderEndTime
Expand All @@ -12282,6 +12289,7 @@ __DEV__ &&
spawnedLane,
updatedLanes,
suspendedRetryLanes,
exitStatus,
suspendedCommitReason,
completedRenderStartTime,
completedRenderEndTime
Expand Down Expand Up @@ -16472,11 +16480,11 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-modern-8a41d6ce-20241114",
version: "19.0.0-www-modern-3720870a-20241115",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getInstanceFromNode,
reconcilerVersion: "19.0.0-www-modern-8a41d6ce-20241114"
reconcilerVersion: "19.0.0-www-modern-3720870a-20241115"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -16510,7 +16518,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-modern-8a41d6ce-20241114";
exports.version = "19.0.0-www-modern-3720870a-20241115";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Loading

0 comments on commit 06cc3b9

Please sign in to comment.