Skip to content

Commit

Permalink
Remove markRenderAbandoned
Browse files Browse the repository at this point in the history
  • Loading branch information
taneliang committed Jun 26, 2020
1 parent d3d0459 commit 4101fd7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 31 deletions.
13 changes: 0 additions & 13 deletions packages/react-reconciler/src/ReactFiberWorkLoop.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ import {
markRenderStarted,
markRenderYielded,
markRenderStopped,
markRenderAbandoned,
} from './SchedulingProfiling';

// The scheduler is imported here *only* to detect whether it's been mocked
Expand Down Expand Up @@ -475,18 +474,6 @@ export function scheduleUpdateOnFiber(
return null;
}

if (enableSchedulingProfiling) {
if (
workInProgressRoot !== null &&
// TODO: Confirm that this makes sense
!includesSomeLane(workInProgressRootRenderLanes, lane)
// Original criterion: expirationTime > renderExpirationTime
// Location: https://github.com/bvaughn/react/blob/root-event-marks/packages/react-reconciler/src/ReactFiberWorkLoop.js#L2846
) {
markRenderAbandoned();
}
}

// TODO: requestUpdateLanePriority also reads the priority. Pass the
// priority as an argument to that function and this one.
const priorityLevel = getCurrentPriorityLevel();
Expand Down
8 changes: 0 additions & 8 deletions packages/react-reconciler/src/SchedulingProfiling.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,6 @@ export function markRenderStarted(lanes: Lanes): void {
}
}

export function markRenderAbandoned(): void {
if (enableSchedulingProfiling) {
if (supportsUserTiming) {
performance.mark('--render-cancel');
}
}
}

export function markRenderYielded(): void {
if (enableSchedulingProfiling) {
if (supportsUserTiming) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,8 @@ describe('SchedulingProfiling', () => {
expect(Scheduler).toFlushUntilNextPaint([]);
}).toErrorDev('Cannot update during an existing state transition');

expect(marks.map(normalizeCodeLocInfo)).toEqual(
expect.arrayContaining([
'--render-cancel',
'--schedule-state-update-Example-1024-\n in Example (at **)',
]),
expect(marks.map(normalizeCodeLocInfo)).toContain(
'--schedule-state-update-Example-1024-\n in Example (at **)',
);
});

Expand All @@ -381,11 +378,8 @@ describe('SchedulingProfiling', () => {
expect(Scheduler).toFlushUntilNextPaint([]);
}).toErrorDev('Cannot update during an existing state transition');

expect(marks.map(normalizeCodeLocInfo)).toEqual(
expect.arrayContaining([
'--render-cancel',
'--schedule-forced-update-Example-1024-\n in Example (at **)',
]),
expect(marks.map(normalizeCodeLocInfo)).toContain(
'--schedule-forced-update-Example-1024-\n in Example (at **)',
);
});

Expand Down

0 comments on commit 4101fd7

Please sign in to comment.