Skip to content

Commit

Permalink
Apparently isBlockingLane doesn't include Sync lanes
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Sep 20, 2024
1 parent b26fa65 commit 2afc818
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions packages/react-reconciler/src/ReactFiberLane.js
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,10 @@ 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
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactFiberWorkLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -1718,7 +1718,7 @@ function resetWorkInProgressStack() {

function finalizeRender(lanes: Lanes, finalizationTime: number): void {
if (enableProfilerTimer && enableComponentPerformanceTrack) {
if (includesBlockingLane(lanes)) {
if (includesSyncLane(lanes) || includesBlockingLane(lanes)) {
clampBlockingTimers(finalizationTime);
}
if (includesTransitionLane(lanes)) {
Expand All @@ -1737,7 +1737,7 @@ function prepareFreshStack(root: FiberRoot, lanes: Lanes): Fiber {
// restart so we need to clamp that.
finalizeRender(workInProgressRootRenderLanes, renderStartTime);

if (includesBlockingLane(lanes)) {
if (includesSyncLane(lanes) || includesBlockingLane(lanes)) {
logBlockingStart(
blockingUpdateTime,
blockingEventTime,
Expand Down
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactProfilerTimer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import type {Fiber} from './ReactInternalTypes';

import type {Lane} from './ReactFiberLane';
import {isTransitionLane, isBlockingLane} from './ReactFiberLane';
import {isTransitionLane, isBlockingLane, isSyncLane} from './ReactFiberLane';

import {resolveEventType, resolveEventTimeStamp} from './ReactFiberConfig';

Expand Down Expand Up @@ -49,7 +49,7 @@ export function startUpdateTimerByLane(lane: Lane): void {
if (!enableProfilerTimer || !enableComponentPerformanceTrack) {
return;
}
if (isBlockingLane(lane)) {
if (isSyncLane(lane) || isBlockingLane(lane)) {
if (blockingUpdateTime < 0) {
blockingUpdateTime = now();
blockingEventTime = resolveEventTimeStamp();
Expand Down

0 comments on commit 2afc818

Please sign in to comment.