81
logSuspendedWithDelayPhase,
82
logSuspenseThrottlePhase,
83
logSuspendedCommitPhase,
84
+ logSuspendedViewTransitionPhase,
85
logCommitPhase,
86
logPaintYieldPhase,
87
logStartViewTransitionYieldPhase,
705
let pendingDidIncludeRenderPhaseUpdate: boolean = false;
706
let pendingSuspendedCommitReason: SuspendedCommitReason = IMMEDIATE_COMMIT; // Profiling-only
707
let pendingDelayedCommitReason: DelayedCommitReason = IMMEDIATE_COMMIT; // Profiling-only
708
+let pendingSuspendedViewTransitionReason: null | string = null; // Profiling-only
709
710
// Use these to prevent an infinite loop of nested updates
711
const NESTED_UPDATE_LIMIT = 50;
3447
pendingEffectsRenderEndTime = completedRenderEndTime;
3448
pendingSuspendedCommitReason = suspendedCommitReason;
3449
pendingDelayedCommitReason = IMMEDIATE_COMMIT;
3450
+ pendingSuspendedViewTransitionReason = null;
3451
}
3452
3453
if (enableGestureTransition && isGestureRender(lanes)) {
3607
flushSpawnedWork,
3608
flushPassiveEffects,
3609
reportViewTransitionError,
3610
+ enableProfilerTimer ? suspendedViewTransition : (null: any),
3611
);
3612
} else {
3613
// Flush synchronously.
3628
onRecoverableError(error, makeErrorInfo(null));
3629
}
3630
3631
+function suspendedViewTransition(reason: string): void {
3632
+ if (enableProfilerTimer && enableComponentPerformanceTrack) {
3633
+ // We'll split the commit into two phases, because we're suspended in the middle.
3634
+ recordCommitEndTime();
3635
+ logCommitPhase(
3636
+ pendingSuspendedCommitReason === IMMEDIATE_COMMIT
3637
+ ? pendingEffectsRenderEndTime
3638
+ : commitStartTime,
3639
+ commitEndTime,
3640
+ commitErrors,
3641
+ pendingDelayedCommitReason === ABORTED_VIEW_TRANSITION_COMMIT,
3642
+ workInProgressUpdateTask,
3643
+ );
3644
+ pendingSuspendedViewTransitionReason = reason;
3645
+ pendingSuspendedCommitReason = SUSPENDED_COMMIT;
3646
+ }
3647
+}
3648
+
3649
function flushAfterMutationEffects(): void {
3650
if (pendingEffectsStatus !== PENDING_AFTER_MUTATION_PHASE) {
3651
return;
3710
}
3711
pendingEffectsStatus = NO_PENDING_EFFECTS;
3712
3713
+ if (enableProfilerTimer && enableComponentPerformanceTrack) {
3714
+ const suspendedViewTransitionReason = pendingSuspendedViewTransitionReason;
3715
+ if (suspendedViewTransitionReason !== null) {
3716
+ // We suspended in the middle of the commit for the view transition.
3717
+ // We'll start a new commit track now.
3718
+ recordCommitTime();
3719
+ logSuspendedViewTransitionPhase(
3720
+ commitEndTime, // The start is the end of the first commit part.
3721
+ commitStartTime, // The end is the start of the second commit part.
3722
+ suspendedViewTransitionReason,
3723
+ workInProgressUpdateTask,
3724
+ );
3725
+ }
3726
+ }
3727
+
3728
const root = pendingEffectsRoot;
3729
const finishedWork = pendingFinishedWork;
3730
const lanes = pendingEffectsLanes;