Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions packages/react-reconciler/src/ReactFiberLane.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,10 +611,6 @@ export function includesSyncLane(lanes: Lanes): boolean {
return (lanes & (SyncLane | SyncHydrationLane)) !== NoLanes;
}

export function isSyncLane(lanes: Lanes): boolean {
return (lanes & (SyncLane | SyncHydrationLane)) !== NoLanes;
}

export function includesNonIdleWork(lanes: Lanes): boolean {
return (lanes & NonIdleLanes) !== NoLanes;
}
Expand Down Expand Up @@ -681,6 +677,8 @@ export function includesLoadingIndicatorLanes(lanes: Lanes): boolean {

export function includesBlockingLane(lanes: Lanes): boolean {
const SyncDefaultLanes =
SyncHydrationLane |
SyncLane |
InputContinuousHydrationLane |
InputContinuousLane |
DefaultHydrationLane |
Expand All @@ -697,10 +695,13 @@ export function includesExpiredLane(root: FiberRoot, lanes: Lanes): boolean {

export function isBlockingLane(lane: Lane): boolean {
const SyncDefaultLanes =
SyncHydrationLane |
SyncLane |
InputContinuousHydrationLane |
InputContinuousLane |
DefaultHydrationLane |
DefaultLane;
DefaultLane |
GestureLane;
return (lane & SyncDefaultLanes) !== NoLanes;
}

Expand Down
13 changes: 4 additions & 9 deletions packages/react-reconciler/src/ReactFiberWorkLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -1898,7 +1898,7 @@ function resetWorkInProgressStack() {

function finalizeRender(lanes: Lanes, finalizationTime: number): void {
if (enableProfilerTimer && enableComponentPerformanceTrack) {
if (includesSyncLane(lanes) || includesBlockingLane(lanes)) {
if (includesBlockingLane(lanes)) {
clampBlockingTimers(finalizationTime);
}
if (includesTransitionLane(lanes)) {
Expand Down Expand Up @@ -1963,7 +1963,7 @@ function prepareFreshStack(root: FiberRoot, lanes: Lanes): Fiber {
const previousUpdateTask = workInProgressUpdateTask;

workInProgressUpdateTask = null;
if (includesSyncLane(lanes) || includesBlockingLane(lanes)) {
if (includesBlockingLane(lanes)) {
workInProgressUpdateTask = blockingUpdateTask;
const clampedUpdateTime =
blockingUpdateTime >= 0 && blockingUpdateTime < blockingClampTime
Expand All @@ -1987,10 +1987,7 @@ function prepareFreshStack(root: FiberRoot, lanes: Lanes): Fiber {
lanes,
previousUpdateTask,
);
} else if (
includesSyncLane(animatingLanes) ||
includesBlockingLane(animatingLanes)
) {
} else if (includesBlockingLane(animatingLanes)) {
// If this lane is still animating, log the time from previous render finishing to now as animating.
setCurrentTrackFromLanes(SyncLane);
logAnimatingPhase(
Expand Down Expand Up @@ -3719,10 +3716,8 @@ function finishedViewTransition(lanes: Lanes): void {
// If an affected track isn't in the middle of rendering or committing, log from the previous
// finished render until the end of the animation.
if (
(includesSyncLane(lanes) || includesBlockingLane(lanes)) &&
!includesSyncLane(workInProgressRootRenderLanes) &&
includesBlockingLane(lanes) &&
!includesBlockingLane(workInProgressRootRenderLanes) &&
!includesSyncLane(pendingEffectsLanes) &&
!includesBlockingLane(pendingEffectsLanes)
) {
setCurrentTrackFromLanes(SyncLane);
Expand Down
8 changes: 3 additions & 5 deletions packages/react-reconciler/src/ReactProfilerTimer.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ import type {CapturedValue} from './ReactCapturedValue';
import {
isTransitionLane,
isBlockingLane,
isSyncLane,
includesTransitionLane,
includesBlockingLane,
includesSyncLane,
NoLanes,
} from './ReactFiberLane';

Expand Down Expand Up @@ -114,7 +112,7 @@ export function startUpdateTimerByLane(
if (!enableProfilerTimer || !enableComponentPerformanceTrack) {
return;
}
if (isSyncLane(lane) || isBlockingLane(lane)) {
if (isBlockingLane(lane)) {
if (blockingUpdateTime < 0) {
blockingUpdateTime = now();
blockingUpdateTask = createTask(method);
Expand Down Expand Up @@ -220,7 +218,7 @@ export function startPingTimerByLanes(lanes: Lanes): void {
// Mark the update time and clamp anything before it because we don't want
// to show the event time for pings but we also don't want to clear it
// because we still need to track if this was a repeat.
if (includesSyncLane(lanes) || includesBlockingLane(lanes)) {
if (includesBlockingLane(lanes)) {
if (blockingUpdateTime < 0) {
blockingClampTime = blockingUpdateTime = now();
blockingUpdateTask = createTask('Promise Resolved');
Expand All @@ -239,7 +237,7 @@ export function trackSuspendedTime(lanes: Lanes, renderEndTime: number) {
if (!enableProfilerTimer || !enableComponentPerformanceTrack) {
return;
}
if (includesSyncLane(lanes) || includesBlockingLane(lanes)) {
if (includesBlockingLane(lanes)) {
blockingSuspendedTime = renderEndTime;
} else if (includesTransitionLane(lanes)) {
transitionSuspendedTime = renderEndTime;
Expand Down
Loading