Skip to content

Commit 51c8a1b

Browse files
committed
Include SyncLane in includesBlockingLane helper
1 parent d91d28c commit 51c8a1b

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

packages/react-reconciler/src/ReactFiberLane.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,8 @@ export function includesLoadingIndicatorLanes(lanes: Lanes): boolean {
681681

682682
export function includesBlockingLane(lanes: Lanes): boolean {
683683
const SyncDefaultLanes =
684+
SyncHydrationLane |
685+
SyncLane |
684686
InputContinuousHydrationLane |
685687
InputContinuousLane |
686688
DefaultHydrationLane |
@@ -697,10 +699,13 @@ export function includesExpiredLane(root: FiberRoot, lanes: Lanes): boolean {
697699

698700
export function isBlockingLane(lane: Lane): boolean {
699701
const SyncDefaultLanes =
702+
SyncHydrationLane |
703+
SyncLane |
700704
InputContinuousHydrationLane |
701705
InputContinuousLane |
702706
DefaultHydrationLane |
703-
DefaultLane;
707+
DefaultLane |
708+
GestureLane;
704709
return (lane & SyncDefaultLanes) !== NoLanes;
705710
}
706711

packages/react-reconciler/src/ReactFiberWorkLoop.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,7 +1898,7 @@ function resetWorkInProgressStack() {
18981898

18991899
function finalizeRender(lanes: Lanes, finalizationTime: number): void {
19001900
if (enableProfilerTimer && enableComponentPerformanceTrack) {
1901-
if (includesSyncLane(lanes) || includesBlockingLane(lanes)) {
1901+
if (includesBlockingLane(lanes)) {
19021902
clampBlockingTimers(finalizationTime);
19031903
}
19041904
if (includesTransitionLane(lanes)) {
@@ -1963,7 +1963,7 @@ function prepareFreshStack(root: FiberRoot, lanes: Lanes): Fiber {
19631963
const previousUpdateTask = workInProgressUpdateTask;
19641964

19651965
workInProgressUpdateTask = null;
1966-
if (includesSyncLane(lanes) || includesBlockingLane(lanes)) {
1966+
if (includesBlockingLane(lanes)) {
19671967
workInProgressUpdateTask = blockingUpdateTask;
19681968
const clampedUpdateTime =
19691969
blockingUpdateTime >= 0 && blockingUpdateTime < blockingClampTime
@@ -1987,10 +1987,7 @@ function prepareFreshStack(root: FiberRoot, lanes: Lanes): Fiber {
19871987
lanes,
19881988
previousUpdateTask,
19891989
);
1990-
} else if (
1991-
includesSyncLane(animatingLanes) ||
1992-
includesBlockingLane(animatingLanes)
1993-
) {
1990+
} else if (includesBlockingLane(animatingLanes)) {
19941991
// If this lane is still animating, log the time from previous render finishing to now as animating.
19951992
setCurrentTrackFromLanes(SyncLane);
19961993
logAnimatingPhase(
@@ -3719,10 +3716,8 @@ function finishedViewTransition(lanes: Lanes): void {
37193716
// If an affected track isn't in the middle of rendering or committing, log from the previous
37203717
// finished render until the end of the animation.
37213718
if (
3722-
(includesSyncLane(lanes) || includesBlockingLane(lanes)) &&
3723-
!includesSyncLane(workInProgressRootRenderLanes) &&
3719+
includesBlockingLane(lanes) &&
37243720
!includesBlockingLane(workInProgressRootRenderLanes) &&
3725-
!includesSyncLane(pendingEffectsLanes) &&
37263721
!includesBlockingLane(pendingEffectsLanes)
37273722
) {
37283723
setCurrentTrackFromLanes(SyncLane);

packages/react-reconciler/src/ReactProfilerTimer.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
isSyncLane,
2222
includesTransitionLane,
2323
includesBlockingLane,
24-
includesSyncLane,
2524
NoLanes,
2625
} from './ReactFiberLane';
2726

@@ -220,7 +219,7 @@ export function startPingTimerByLanes(lanes: Lanes): void {
220219
// Mark the update time and clamp anything before it because we don't want
221220
// to show the event time for pings but we also don't want to clear it
222221
// because we still need to track if this was a repeat.
223-
if (includesSyncLane(lanes) || includesBlockingLane(lanes)) {
222+
if (includesBlockingLane(lanes)) {
224223
if (blockingUpdateTime < 0) {
225224
blockingClampTime = blockingUpdateTime = now();
226225
blockingUpdateTask = createTask('Promise Resolved');
@@ -239,7 +238,7 @@ export function trackSuspendedTime(lanes: Lanes, renderEndTime: number) {
239238
if (!enableProfilerTimer || !enableComponentPerformanceTrack) {
240239
return;
241240
}
242-
if (includesSyncLane(lanes) || includesBlockingLane(lanes)) {
241+
if (includesBlockingLane(lanes)) {
243242
blockingSuspendedTime = renderEndTime;
244243
} else if (includesTransitionLane(lanes)) {
245244
transitionSuspendedTime = renderEndTime;

0 commit comments

Comments
 (0)