From 114ab52953bea3d78785e25300e70cce56f307e9 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Wed, 10 Feb 2021 18:25:33 -0600 Subject: [PATCH] Make remaining empty lanes Transition lanes (#20793) Doesn't really have any effect now because we batch everything together anyway but will allow for more parallelism once we support that. --- .../src/ReactFiberLane.new.js | 64 ++++++++------- .../src/ReactFiberLane.old.js | 64 ++++++++------- .../__tests__/DebugTracing-test.internal.js | 61 +++++++------- .../SchedulingProfiler-test.internal.js | 81 ++++++++++--------- 4 files changed, 148 insertions(+), 122 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberLane.new.js b/packages/react-reconciler/src/ReactFiberLane.new.js index 20f89cc8dfe03..518db911ad822 100644 --- a/packages/react-reconciler/src/ReactFiberLane.new.js +++ b/packages/react-reconciler/src/ReactFiberLane.new.js @@ -87,38 +87,43 @@ export const SyncBatchedLane: Lane = /* */ 0b0000000000000000000 export const InputDiscreteHydrationLane: Lane = /* */ 0b0000000000000000000000000000100; const InputDiscreteLane: Lanes = /* */ 0b0000000000000000000000000001000; -const InputContinuousHydrationLane: Lane = /* */ 0b0000000000000000000000000100000; -const InputContinuousLane: Lanes = /* */ 0b0000000000000000000000001000000; - -export const DefaultHydrationLane: Lane = /* */ 0b0000000000000000000000100000000; -export const DefaultLane: Lanes = /* */ 0b0000000000000000000001000000000; - -const TransitionHydrationLane: Lane = /* */ 0b0000000000000000001000000000000; -const TransitionLanes: Lanes = /* */ 0b0000000001111111110000000000000; -const TransitionLane1: Lane = /* */ 0b0000000000000000010000000000000; -const TransitionLane2: Lane = /* */ 0b0000000000000000100000000000000; -const TransitionLane3: Lane = /* */ 0b0000000000000001000000000000000; -const TransitionLane4: Lane = /* */ 0b0000000000000010000000000000000; -const TransitionLane5: Lane = /* */ 0b0000000000000100000000000000000; -const TransitionLane6: Lane = /* */ 0b0000000000001000000000000000000; -const TransitionLane7: Lane = /* */ 0b0000000000010000000000000000000; -const TransitionLane8: Lane = /* */ 0b0000000000100000000000000000000; -const TransitionLane9: Lane = /* */ 0b0000000001000000000000000000000; - -const RetryLanes: Lanes = /* */ 0b0000011110000000000000000000000; -const RetryLane1: Lane = /* */ 0b0000000010000000000000000000000; -const RetryLane2: Lane = /* */ 0b0000000100000000000000000000000; -const RetryLane3: Lane = /* */ 0b0000001000000000000000000000000; -const RetryLane4: Lane = /* */ 0b0000010000000000000000000000000; +const InputContinuousHydrationLane: Lane = /* */ 0b0000000000000000000000000010000; +const InputContinuousLane: Lanes = /* */ 0b0000000000000000000000000100000; + +export const DefaultHydrationLane: Lane = /* */ 0b0000000000000000000000001000000; +export const DefaultLane: Lanes = /* */ 0b0000000000000000000000010000000; + +const TransitionLanes: Lanes = /* */ 0b0000000011111111111111100000000; +const TransitionHydrationLane: Lane = /* */ 0b0000000000000000000000100000000; +const TransitionLane1: Lane = /* */ 0b0000000000000000000001000000000; +const TransitionLane2: Lane = /* */ 0b0000000000000000000010000000000; +const TransitionLane3: Lane = /* */ 0b0000000000000000000100000000000; +const TransitionLane4: Lane = /* */ 0b0000000000000000001000000000000; +const TransitionLane5: Lane = /* */ 0b0000000000000000010000000000000; +const TransitionLane6: Lane = /* */ 0b0000000000000000100000000000000; +const TransitionLane7: Lane = /* */ 0b0000000000000001000000000000000; +const TransitionLane8: Lane = /* */ 0b0000000000000010000000000000000; +const TransitionLane9: Lane = /* */ 0b0000000000000100000000000000000; +const TransitionLane10: Lane = /* */ 0b0000000000001000000000000000000; +const TransitionLane11: Lane = /* */ 0b0000000000010000000000000000000; +const TransitionLane12: Lane = /* */ 0b0000000000100000000000000000000; +const TransitionLane13: Lane = /* */ 0b0000000001000000000000000000000; +const TransitionLane14: Lane = /* */ 0b0000000010000000000000000000000; + +const RetryLanes: Lanes = /* */ 0b0000111100000000000000000000000; +const RetryLane1: Lane = /* */ 0b0000000100000000000000000000000; +const RetryLane2: Lane = /* */ 0b0000001000000000000000000000000; +const RetryLane3: Lane = /* */ 0b0000010000000000000000000000000; +const RetryLane4: Lane = /* */ 0b0000100000000000000000000000000; export const SomeRetryLane: Lane = RetryLane1; -export const SelectiveHydrationLane: Lane = /* */ 0b0000100000000000000000000000000; +export const SelectiveHydrationLane: Lane = /* */ 0b0001000000000000000000000000000; -const NonIdleLanes = /* */ 0b0000111111111111111111111111111; +const NonIdleLanes = /* */ 0b0001111111111111111111111111111; -export const IdleHydrationLane: Lane = /* */ 0b0001000000000000000000000000000; -const IdleLane: Lanes = /* */ 0b0010000000000000000000000000000; +export const IdleHydrationLane: Lane = /* */ 0b0010000000000000000000000000000; +const IdleLane: Lanes = /* */ 0b0100000000000000000000000000000; export const OffscreenLane: Lane = /* */ 0b1000000000000000000000000000000; @@ -179,6 +184,11 @@ function getHighestPriorityLanes(lanes: Lanes | Lane): Lanes { case TransitionLane7: case TransitionLane8: case TransitionLane9: + case TransitionLane10: + case TransitionLane11: + case TransitionLane12: + case TransitionLane13: + case TransitionLane14: return_highestLanePriority = TransitionPriority; return lanes & TransitionLanes; case RetryLane1: diff --git a/packages/react-reconciler/src/ReactFiberLane.old.js b/packages/react-reconciler/src/ReactFiberLane.old.js index 6d452ab67b9c8..1b1f12c14861e 100644 --- a/packages/react-reconciler/src/ReactFiberLane.old.js +++ b/packages/react-reconciler/src/ReactFiberLane.old.js @@ -87,38 +87,43 @@ export const SyncBatchedLane: Lane = /* */ 0b0000000000000000000 export const InputDiscreteHydrationLane: Lane = /* */ 0b0000000000000000000000000000100; const InputDiscreteLane: Lanes = /* */ 0b0000000000000000000000000001000; -const InputContinuousHydrationLane: Lane = /* */ 0b0000000000000000000000000100000; -const InputContinuousLane: Lanes = /* */ 0b0000000000000000000000001000000; - -export const DefaultHydrationLane: Lane = /* */ 0b0000000000000000000000100000000; -export const DefaultLane: Lanes = /* */ 0b0000000000000000000001000000000; - -const TransitionHydrationLane: Lane = /* */ 0b0000000000000000001000000000000; -const TransitionLanes: Lanes = /* */ 0b0000000001111111110000000000000; -const TransitionLane1: Lane = /* */ 0b0000000000000000010000000000000; -const TransitionLane2: Lane = /* */ 0b0000000000000000100000000000000; -const TransitionLane3: Lane = /* */ 0b0000000000000001000000000000000; -const TransitionLane4: Lane = /* */ 0b0000000000000010000000000000000; -const TransitionLane5: Lane = /* */ 0b0000000000000100000000000000000; -const TransitionLane6: Lane = /* */ 0b0000000000001000000000000000000; -const TransitionLane7: Lane = /* */ 0b0000000000010000000000000000000; -const TransitionLane8: Lane = /* */ 0b0000000000100000000000000000000; -const TransitionLane9: Lane = /* */ 0b0000000001000000000000000000000; - -const RetryLanes: Lanes = /* */ 0b0000011110000000000000000000000; -const RetryLane1: Lane = /* */ 0b0000000010000000000000000000000; -const RetryLane2: Lane = /* */ 0b0000000100000000000000000000000; -const RetryLane3: Lane = /* */ 0b0000001000000000000000000000000; -const RetryLane4: Lane = /* */ 0b0000010000000000000000000000000; +const InputContinuousHydrationLane: Lane = /* */ 0b0000000000000000000000000010000; +const InputContinuousLane: Lanes = /* */ 0b0000000000000000000000000100000; + +export const DefaultHydrationLane: Lane = /* */ 0b0000000000000000000000001000000; +export const DefaultLane: Lanes = /* */ 0b0000000000000000000000010000000; + +const TransitionLanes: Lanes = /* */ 0b0000000011111111111111100000000; +const TransitionHydrationLane: Lane = /* */ 0b0000000000000000000000100000000; +const TransitionLane1: Lane = /* */ 0b0000000000000000000001000000000; +const TransitionLane2: Lane = /* */ 0b0000000000000000000010000000000; +const TransitionLane3: Lane = /* */ 0b0000000000000000000100000000000; +const TransitionLane4: Lane = /* */ 0b0000000000000000001000000000000; +const TransitionLane5: Lane = /* */ 0b0000000000000000010000000000000; +const TransitionLane6: Lane = /* */ 0b0000000000000000100000000000000; +const TransitionLane7: Lane = /* */ 0b0000000000000001000000000000000; +const TransitionLane8: Lane = /* */ 0b0000000000000010000000000000000; +const TransitionLane9: Lane = /* */ 0b0000000000000100000000000000000; +const TransitionLane10: Lane = /* */ 0b0000000000001000000000000000000; +const TransitionLane11: Lane = /* */ 0b0000000000010000000000000000000; +const TransitionLane12: Lane = /* */ 0b0000000000100000000000000000000; +const TransitionLane13: Lane = /* */ 0b0000000001000000000000000000000; +const TransitionLane14: Lane = /* */ 0b0000000010000000000000000000000; + +const RetryLanes: Lanes = /* */ 0b0000111100000000000000000000000; +const RetryLane1: Lane = /* */ 0b0000000100000000000000000000000; +const RetryLane2: Lane = /* */ 0b0000001000000000000000000000000; +const RetryLane3: Lane = /* */ 0b0000010000000000000000000000000; +const RetryLane4: Lane = /* */ 0b0000100000000000000000000000000; export const SomeRetryLane: Lane = RetryLane1; -export const SelectiveHydrationLane: Lane = /* */ 0b0000100000000000000000000000000; +export const SelectiveHydrationLane: Lane = /* */ 0b0001000000000000000000000000000; -const NonIdleLanes = /* */ 0b0000111111111111111111111111111; +const NonIdleLanes = /* */ 0b0001111111111111111111111111111; -export const IdleHydrationLane: Lane = /* */ 0b0001000000000000000000000000000; -const IdleLane: Lanes = /* */ 0b0010000000000000000000000000000; +export const IdleHydrationLane: Lane = /* */ 0b0010000000000000000000000000000; +const IdleLane: Lanes = /* */ 0b0100000000000000000000000000000; export const OffscreenLane: Lane = /* */ 0b1000000000000000000000000000000; @@ -179,6 +184,11 @@ function getHighestPriorityLanes(lanes: Lanes | Lane): Lanes { case TransitionLane7: case TransitionLane8: case TransitionLane9: + case TransitionLane10: + case TransitionLane11: + case TransitionLane12: + case TransitionLane13: + case TransitionLane14: return_highestLanePriority = TransitionPriority; return lanes & TransitionLanes; case RetryLane1: diff --git a/packages/react-reconciler/src/__tests__/DebugTracing-test.internal.js b/packages/react-reconciler/src/__tests__/DebugTracing-test.internal.js index 0fd0a6722d517..963660e39ca41 100644 --- a/packages/react-reconciler/src/__tests__/DebugTracing-test.internal.js +++ b/packages/react-reconciler/src/__tests__/DebugTracing-test.internal.js @@ -16,6 +16,9 @@ describe('DebugTracing', () => { let logs; + const DEFAULT_LANE_STRING = '0b0000000000000000000000010000000'; + const RETRY_LANE_STRING = '0b0000000100000000000000000000000'; + beforeEach(() => { jest.resetModules(); @@ -129,9 +132,9 @@ describe('DebugTracing', () => { expect(Scheduler).toFlushUntilNextPaint([]); expect(logs).toEqual([ - 'group: ⚛️ render (0b0000000010000000000000000000000)', + `group: ⚛️ render (${RETRY_LANE_STRING})`, 'log: ', - 'groupEnd: ⚛️ render (0b0000000010000000000000000000000)', + `groupEnd: ⚛️ render (${RETRY_LANE_STRING})`, ]); }); @@ -158,9 +161,9 @@ describe('DebugTracing', () => { expect(Scheduler).toFlushUntilNextPaint([]); expect(logs).toEqual([ - 'group: ⚛️ render (0b0000000000000000000001000000000)', + `group: ⚛️ render (${DEFAULT_LANE_STRING})`, 'log: ⚛️ Example suspended', - 'groupEnd: ⚛️ render (0b0000000000000000000001000000000)', + `groupEnd: ⚛️ render (${DEFAULT_LANE_STRING})`, ]); logs.splice(0); @@ -199,9 +202,9 @@ describe('DebugTracing', () => { expect(Scheduler).toFlushUntilNextPaint([]); expect(logs).toEqual([ - 'group: ⚛️ render (0b0000000000000000000001000000000)', + `group: ⚛️ render (${DEFAULT_LANE_STRING})`, 'log: ', - 'groupEnd: ⚛️ render (0b0000000000000000000001000000000)', + `groupEnd: ⚛️ render (${DEFAULT_LANE_STRING})`, ]); logs.splice(0); @@ -209,9 +212,9 @@ describe('DebugTracing', () => { expect(Scheduler).toFlushUntilNextPaint([]); expect(logs).toEqual([ - 'group: ⚛️ render (0b0000000010000000000000000000000)', + `group: ⚛️ render (${RETRY_LANE_STRING})`, 'log: ', - 'groupEnd: ⚛️ render (0b0000000010000000000000000000000)', + `groupEnd: ⚛️ render (${RETRY_LANE_STRING})`, ]); }); @@ -241,11 +244,11 @@ describe('DebugTracing', () => { expect(Scheduler).toFlushUntilNextPaint([]); expect(logs).toEqual([ - 'group: ⚛️ commit (0b0000000000000000000001000000000)', - 'group: ⚛️ layout effects (0b0000000000000000000001000000000)', + `group: ⚛️ commit (${DEFAULT_LANE_STRING})`, + `group: ⚛️ layout effects (${DEFAULT_LANE_STRING})`, 'log: ⚛️ Example updated state (0b0000000000000000000000000000001)', - 'groupEnd: ⚛️ layout effects (0b0000000000000000000001000000000)', - 'groupEnd: ⚛️ commit (0b0000000000000000000001000000000)', + `groupEnd: ⚛️ layout effects (${DEFAULT_LANE_STRING})`, + `groupEnd: ⚛️ commit (${DEFAULT_LANE_STRING})`, ]); }); @@ -277,10 +280,10 @@ describe('DebugTracing', () => { }).toErrorDev('Cannot update during an existing state transition'); expect(logs).toEqual([ - 'group: ⚛️ render (0b0000000000000000000001000000000)', - 'log: ⚛️ Example updated state (0b0000000000000000000001000000000)', - 'log: ⚛️ Example updated state (0b0000000000000000000001000000000)', - 'groupEnd: ⚛️ render (0b0000000000000000000001000000000)', + `group: ⚛️ render (${DEFAULT_LANE_STRING})`, + `log: ⚛️ Example updated state (${DEFAULT_LANE_STRING})`, + `log: ⚛️ Example updated state (${DEFAULT_LANE_STRING})`, + `groupEnd: ⚛️ render (${DEFAULT_LANE_STRING})`, ]); }); @@ -308,11 +311,11 @@ describe('DebugTracing', () => { expect(Scheduler).toFlushUntilNextPaint([]); expect(logs).toEqual([ - 'group: ⚛️ commit (0b0000000000000000000001000000000)', - 'group: ⚛️ layout effects (0b0000000000000000000001000000000)', + `group: ⚛️ commit (${DEFAULT_LANE_STRING})`, + `group: ⚛️ layout effects (${DEFAULT_LANE_STRING})`, 'log: ⚛️ Example updated state (0b0000000000000000000000000000001)', - 'groupEnd: ⚛️ layout effects (0b0000000000000000000001000000000)', - 'groupEnd: ⚛️ commit (0b0000000000000000000001000000000)', + `groupEnd: ⚛️ layout effects (${DEFAULT_LANE_STRING})`, + `groupEnd: ⚛️ commit (${DEFAULT_LANE_STRING})`, ]); }); @@ -335,9 +338,9 @@ describe('DebugTracing', () => { ); }); expect(logs).toEqual([ - 'group: ⚛️ passive effects (0b0000000000000000000001000000000)', - 'log: ⚛️ Example updated state (0b0000000000000000000001000000000)', - 'groupEnd: ⚛️ passive effects (0b0000000000000000000001000000000)', + `group: ⚛️ passive effects (${DEFAULT_LANE_STRING})`, + `log: ⚛️ Example updated state (${DEFAULT_LANE_STRING})`, + `groupEnd: ⚛️ passive effects (${DEFAULT_LANE_STRING})`, ]); }); @@ -361,10 +364,10 @@ describe('DebugTracing', () => { }); expect(logs).toEqual([ - 'group: ⚛️ render (0b0000000000000000000001000000000)', - 'log: ⚛️ Example updated state (0b0000000000000000000001000000000)', - 'log: ⚛️ Example updated state (0b0000000000000000000001000000000)', // debugRenderPhaseSideEffectsForStrictMode - 'groupEnd: ⚛️ render (0b0000000000000000000001000000000)', + `group: ⚛️ render (${DEFAULT_LANE_STRING})`, + `log: ⚛️ Example updated state (${DEFAULT_LANE_STRING})`, + `log: ⚛️ Example updated state (${DEFAULT_LANE_STRING})`, // debugRenderPhaseSideEffectsForStrictMode + `groupEnd: ⚛️ render (${DEFAULT_LANE_STRING})`, ]); }); @@ -389,9 +392,9 @@ describe('DebugTracing', () => { expect(Scheduler).toFlushUntilNextPaint([]); expect(logs).toEqual([ - 'group: ⚛️ render (0b0000000000000000000001000000000)', + `group: ⚛️ render (${DEFAULT_LANE_STRING})`, 'log: Hello from user code', - 'groupEnd: ⚛️ render (0b0000000000000000000001000000000)', + `groupEnd: ⚛️ render (${DEFAULT_LANE_STRING})`, ]); }); diff --git a/packages/react-reconciler/src/__tests__/SchedulingProfiler-test.internal.js b/packages/react-reconciler/src/__tests__/SchedulingProfiler-test.internal.js index 433f312fc7095..dd3528da50fe1 100644 --- a/packages/react-reconciler/src/__tests__/SchedulingProfiler-test.internal.js +++ b/packages/react-reconciler/src/__tests__/SchedulingProfiler-test.internal.js @@ -85,6 +85,9 @@ describe('SchedulingProfiler', () => { delete global.performance; }); + // This is coupled to implementation + const DEFAULT_LANE = 128; + // @gate !enableSchedulingProfiler it('should not mark if enableSchedulingProfiler is false', () => { ReactTestRenderer.create(
); @@ -118,7 +121,7 @@ describe('SchedulingProfiler', () => { expectMarksToEqual([ `--react-init-${ReactVersion}`, - '--schedule-render-512', + `--schedule-render-${DEFAULT_LANE}`, ]); clearPendingMarks(); @@ -126,10 +129,10 @@ describe('SchedulingProfiler', () => { expect(Scheduler).toFlushUntilNextPaint([]); expectMarksToEqual([ - '--render-start-512', + `--render-start-${DEFAULT_LANE}`, '--render-stop', - '--commit-start-512', - '--layout-effects-start-512', + `--commit-start-${DEFAULT_LANE}`, + `--layout-effects-start-${DEFAULT_LANE}`, '--layout-effects-stop', '--commit-stop', ]); @@ -153,8 +156,8 @@ describe('SchedulingProfiler', () => { expectMarksToEqual([ `--react-init-${ReactVersion}`, - '--schedule-render-512', - '--render-start-512', + `--schedule-render-${DEFAULT_LANE}`, + `--render-start-${DEFAULT_LANE}`, '--render-yield', ]); }); @@ -237,7 +240,7 @@ describe('SchedulingProfiler', () => { expectMarksToEqual([ `--react-init-${ReactVersion}`, - '--schedule-render-512', + `--schedule-render-${DEFAULT_LANE}`, ]); clearPendingMarks(); @@ -245,11 +248,11 @@ describe('SchedulingProfiler', () => { expect(Scheduler).toFlushUntilNextPaint([]); expectMarksToEqual([ - '--render-start-512', + `--render-start-${DEFAULT_LANE}`, '--suspense-suspend-0-Example', '--render-stop', - '--commit-start-512', - '--layout-effects-start-512', + `--commit-start-${DEFAULT_LANE}`, + `--layout-effects-start-${DEFAULT_LANE}`, '--layout-effects-stop', '--commit-stop', ]); @@ -276,7 +279,7 @@ describe('SchedulingProfiler', () => { expectMarksToEqual([ `--react-init-${ReactVersion}`, - '--schedule-render-512', + `--schedule-render-${DEFAULT_LANE}`, ]); clearPendingMarks(); @@ -284,11 +287,11 @@ describe('SchedulingProfiler', () => { expect(Scheduler).toFlushUntilNextPaint([]); expectMarksToEqual([ - '--render-start-512', + `--render-start-${DEFAULT_LANE}`, '--suspense-suspend-0-Example', '--render-stop', - '--commit-start-512', - '--layout-effects-start-512', + `--commit-start-${DEFAULT_LANE}`, + `--layout-effects-start-${DEFAULT_LANE}`, '--layout-effects-stop', '--commit-stop', ]); @@ -315,7 +318,7 @@ describe('SchedulingProfiler', () => { expectMarksToEqual([ `--react-init-${ReactVersion}`, - '--schedule-render-512', + `--schedule-render-${DEFAULT_LANE}`, ]); clearPendingMarks(); @@ -323,10 +326,10 @@ describe('SchedulingProfiler', () => { expect(Scheduler).toFlushUntilNextPaint([]); expectMarksToEqual([ - '--render-start-512', + `--render-start-${DEFAULT_LANE}`, '--render-stop', - '--commit-start-512', - '--layout-effects-start-512', + `--commit-start-${DEFAULT_LANE}`, + `--layout-effects-start-${DEFAULT_LANE}`, '--schedule-state-update-1-Example', '--layout-effects-stop', '--render-start-1', @@ -352,7 +355,7 @@ describe('SchedulingProfiler', () => { expectMarksToEqual([ `--react-init-${ReactVersion}`, - '--schedule-render-512', + `--schedule-render-${DEFAULT_LANE}`, ]); clearPendingMarks(); @@ -360,10 +363,10 @@ describe('SchedulingProfiler', () => { expect(Scheduler).toFlushUntilNextPaint([]); expectMarksToEqual([ - '--render-start-512', + `--render-start-${DEFAULT_LANE}`, '--render-stop', - '--commit-start-512', - '--layout-effects-start-512', + `--commit-start-${DEFAULT_LANE}`, + `--layout-effects-start-${DEFAULT_LANE}`, '--schedule-forced-update-1-Example', '--layout-effects-stop', '--render-start-1', @@ -390,7 +393,7 @@ describe('SchedulingProfiler', () => { expectMarksToEqual([ `--react-init-${ReactVersion}`, - '--schedule-render-512', + `--schedule-render-${DEFAULT_LANE}`, ]); clearPendingMarks(); @@ -399,7 +402,7 @@ describe('SchedulingProfiler', () => { expect(Scheduler).toFlushUntilNextPaint([]); }).toErrorDev('Cannot update during an existing state transition'); - expectMarksToContain('--schedule-state-update-512-Example'); + expectMarksToContain(`--schedule-state-update-${DEFAULT_LANE}-Example`); }); // @gate enableSchedulingProfiler @@ -418,7 +421,7 @@ describe('SchedulingProfiler', () => { expectMarksToEqual([ `--react-init-${ReactVersion}`, - '--schedule-render-512', + `--schedule-render-${DEFAULT_LANE}`, ]); clearPendingMarks(); @@ -427,7 +430,7 @@ describe('SchedulingProfiler', () => { expect(Scheduler).toFlushUntilNextPaint([]); }).toErrorDev('Cannot update during an existing state transition'); - expectMarksToContain('--schedule-forced-update-512-Example'); + expectMarksToContain(`--schedule-forced-update-${DEFAULT_LANE}-Example`); }); // @gate enableSchedulingProfiler @@ -444,7 +447,7 @@ describe('SchedulingProfiler', () => { expectMarksToEqual([ `--react-init-${ReactVersion}`, - '--schedule-render-512', + `--schedule-render-${DEFAULT_LANE}`, ]); clearPendingMarks(); @@ -452,10 +455,10 @@ describe('SchedulingProfiler', () => { expect(Scheduler).toFlushUntilNextPaint([]); expectMarksToEqual([ - '--render-start-512', + `--render-start-${DEFAULT_LANE}`, '--render-stop', - '--commit-start-512', - '--layout-effects-start-512', + `--commit-start-${DEFAULT_LANE}`, + `--layout-effects-start-${DEFAULT_LANE}`, '--schedule-state-update-1-Example', '--layout-effects-stop', '--render-start-1', @@ -484,19 +487,19 @@ describe('SchedulingProfiler', () => { expectMarksToEqual([ `--react-init-${ReactVersion}`, - '--schedule-render-512', - '--render-start-512', + `--schedule-render-${DEFAULT_LANE}`, + `--render-start-${DEFAULT_LANE}`, '--render-stop', - '--commit-start-512', - '--layout-effects-start-512', + `--commit-start-${DEFAULT_LANE}`, + `--layout-effects-start-${DEFAULT_LANE}`, '--layout-effects-stop', '--commit-stop', - '--passive-effects-start-512', - '--schedule-state-update-512-Example', + `--passive-effects-start-${DEFAULT_LANE}`, + `--schedule-state-update-${DEFAULT_LANE}-Example`, '--passive-effects-stop', - '--render-start-512', + `--render-start-${DEFAULT_LANE}`, '--render-stop', - '--commit-start-512', + `--commit-start-${DEFAULT_LANE}`, '--commit-stop', ]); }); @@ -515,6 +518,6 @@ describe('SchedulingProfiler', () => { ReactTestRenderer.create(, {unstable_isConcurrent: true}); }); - expectMarksToContain('--schedule-state-update-512-Example'); + expectMarksToContain(`--schedule-state-update-${DEFAULT_LANE}-Example`); }); });