From 0036347cb5136883323ee47feefcf88a96e33040 Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Fri, 12 Jun 2020 15:38:10 -0400 Subject: [PATCH] Minor updates from review --- .../src/ReactFiberHooks.new.js | 72 +++++++++---------- .../src/ReactFiberHooks.old.js | 72 +++++++++---------- .../react-reconciler/src/ReactFiberLane.js | 10 +-- .../src/ReactFiberWorkLoop.new.js | 60 ++++++++-------- .../src/ReactFiberWorkLoop.old.js | 64 +++++++++-------- .../src/SchedulerWithReactIntegration.new.js | 10 +-- .../src/SchedulerWithReactIntegration.old.js | 10 +-- packages/shared/ReactFeatureFlags.js | 2 +- .../forks/ReactFeatureFlags.www-dynamic.js | 1 + 9 files changed, 147 insertions(+), 154 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberHooks.new.js b/packages/react-reconciler/src/ReactFiberHooks.new.js index 6e900f367a186..f9bfcf7db1a9e 100644 --- a/packages/react-reconciler/src/ReactFiberHooks.new.js +++ b/packages/react-reconciler/src/ReactFiberHooks.new.js @@ -30,15 +30,16 @@ import {NoMode, BlockingMode} from './ReactTypeOfMode'; import { NoLane, NoLanes, - DefaultLanePriority, + TransitionShortLanePriority, + TransitionLongLanePriority, InputContinuousLanePriority, isSubsetOfLanes, mergeLanes, removeLanes, markRootEntangled, markRootMutableRead, - getCurrentLanePriority, - setCurrentLanePriority, + getCurrentUpdateLanePriority, + setCurrentUpdateLanePriority, schedulerPriorityToLanePriority, } from './ReactFiberLane'; import {readContext} from './ReactFiberNewContext.new'; @@ -1503,43 +1504,36 @@ function rerenderDeferredValue( function startTransition(setPending, config, callback) { const priorityLevel = getCurrentPriorityLevel(); - const previousLanePriority = getCurrentLanePriority(); - try { - setCurrentLanePriority( - priorityLevel < UserBlockingPriority - ? InputContinuousLanePriority - : schedulerPriorityToLanePriority(priorityLevel), - ); - runWithPriority( - priorityLevel < UserBlockingPriority - ? UserBlockingPriority - : priorityLevel, - () => { - setPending(true); - }, - ); + const previousLanePriority = getCurrentUpdateLanePriority(); + setCurrentUpdateLanePriority(InputContinuousLanePriority); + runWithPriority( + priorityLevel < UserBlockingPriority ? UserBlockingPriority : priorityLevel, + () => { + setPending(true); + }, + ); - setCurrentLanePriority( - priorityLevel > NormalPriority - ? DefaultLanePriority - : schedulerPriorityToLanePriority(priorityLevel), - ); - runWithPriority( - priorityLevel > NormalPriority ? NormalPriority : priorityLevel, - () => { - const previousConfig = ReactCurrentBatchConfig.suspense; - ReactCurrentBatchConfig.suspense = config === undefined ? null : config; - try { - setPending(false); - callback(); - } finally { - ReactCurrentBatchConfig.suspense = previousConfig; - } - }, - ); - } finally { - setCurrentLanePriority(previousLanePriority); - } + setCurrentUpdateLanePriority( + config === undefined || + config.timeoutMs === undefined || + (config.timeoutMs | 0) < 10000 + ? TransitionShortLanePriority + : TransitionLongLanePriority, + ); + runWithPriority( + priorityLevel > NormalPriority ? NormalPriority : priorityLevel, + () => { + const previousConfig = ReactCurrentBatchConfig.suspense; + ReactCurrentBatchConfig.suspense = config === undefined ? null : config; + try { + setPending(false); + callback(); + } finally { + setCurrentUpdateLanePriority(previousLanePriority); + ReactCurrentBatchConfig.suspense = previousConfig; + } + }, + ); } function mountTransition( diff --git a/packages/react-reconciler/src/ReactFiberHooks.old.js b/packages/react-reconciler/src/ReactFiberHooks.old.js index 547ca261da021..fcf738d695547 100644 --- a/packages/react-reconciler/src/ReactFiberHooks.old.js +++ b/packages/react-reconciler/src/ReactFiberHooks.old.js @@ -30,15 +30,16 @@ import {NoMode, BlockingMode} from './ReactTypeOfMode'; import { NoLane, NoLanes, - DefaultLanePriority, + TransitionShortLanePriority, + TransitionLongLanePriority, InputContinuousLanePriority, isSubsetOfLanes, mergeLanes, removeLanes, markRootEntangled, markRootMutableRead, - getCurrentLanePriority, - setCurrentLanePriority, + getCurrentUpdateLanePriority, + setCurrentUpdateLanePriority, schedulerPriorityToLanePriority, } from './ReactFiberLane'; import {readContext} from './ReactFiberNewContext.old'; @@ -1503,43 +1504,36 @@ function rerenderDeferredValue( function startTransition(setPending, config, callback) { const priorityLevel = getCurrentPriorityLevel(); - const previousLanePriority = getCurrentLanePriority(); - try { - setCurrentLanePriority( - priorityLevel < UserBlockingPriority - ? InputContinuousLanePriority - : schedulerPriorityToLanePriority(priorityLevel), - ); - runWithPriority( - priorityLevel < UserBlockingPriority - ? UserBlockingPriority - : priorityLevel, - () => { - setPending(true); - }, - ); + const previousLanePriority = getCurrentUpdateLanePriority(); + setCurrentUpdateLanePriority(InputContinuousLanePriority); + runWithPriority( + priorityLevel < UserBlockingPriority ? UserBlockingPriority : priorityLevel, + () => { + setPending(true); + }, + ); - setCurrentLanePriority( - priorityLevel > NormalPriority - ? DefaultLanePriority - : schedulerPriorityToLanePriority(priorityLevel), - ); - runWithPriority( - priorityLevel > NormalPriority ? NormalPriority : priorityLevel, - () => { - const previousConfig = ReactCurrentBatchConfig.suspense; - ReactCurrentBatchConfig.suspense = config === undefined ? null : config; - try { - setPending(false); - callback(); - } finally { - ReactCurrentBatchConfig.suspense = previousConfig; - } - }, - ); - } finally { - setCurrentLanePriority(previousLanePriority); - } + setCurrentUpdateLanePriority( + config === undefined || + config.timeoutMs === undefined || + (config.timeoutMs | 0) < 10000 + ? TransitionShortLanePriority + : TransitionLongLanePriority, + ); + runWithPriority( + priorityLevel > NormalPriority ? NormalPriority : priorityLevel, + () => { + const previousConfig = ReactCurrentBatchConfig.suspense; + ReactCurrentBatchConfig.suspense = config === undefined ? null : config; + try { + setPending(false); + callback(); + } finally { + setCurrentUpdateLanePriority(previousLanePriority); + ReactCurrentBatchConfig.suspense = previousConfig; + } + }, + ); } function mountTransition( diff --git a/packages/react-reconciler/src/ReactFiberLane.js b/packages/react-reconciler/src/ReactFiberLane.js index 98f3ade7332d8..15c3520676514 100644 --- a/packages/react-reconciler/src/ReactFiberLane.js +++ b/packages/react-reconciler/src/ReactFiberLane.js @@ -120,14 +120,14 @@ export const OffscreenLane: Lane = /* */ 0b1000000000000000000 export const NoTimestamp = -1; -let currentLanePriority: LanePriority = NoLanePriority; +let currentUpdateLanePriority: LanePriority = NoLanePriority; -export function getCurrentLanePriority(): LanePriority { - return currentLanePriority; +export function getCurrentUpdateLanePriority(): LanePriority { + return currentUpdateLanePriority; } -export function setCurrentLanePriority(newLanePriority: LanePriority) { - currentLanePriority = newLanePriority; +export function setCurrentUpdateLanePriority(newLanePriority: LanePriority) { + currentUpdateLanePriority = newLanePriority; } // "Registers" used to "return" multiple values diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js index a285f9ebc9a8d..d9ff030233a7e 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js @@ -132,8 +132,8 @@ import { hasUpdatePriority, getNextLanes, returnNextLanesPriority, - setCurrentLanePriority, - getCurrentLanePriority, + setCurrentUpdateLanePriority, + getCurrentUpdateLanePriority, markStarvedLanesAsExpired, getLanesToRetrySynchronouslyOnError, markRootUpdated, @@ -423,9 +423,9 @@ export function requestUpdateLane( ); } else if ( enableCurrentLanePriority && - getCurrentLanePriority() !== NoLanePriority + getCurrentUpdateLanePriority() !== NoLanePriority ) { - const currentLanePriority = getCurrentLanePriority(); + const currentLanePriority = getCurrentUpdateLanePriority(); lane = findUpdateLane(currentLanePriority, currentEventWipLanes); } else { // TODO: If we're not inside `runWithPriority`, this returns the priority @@ -1078,12 +1078,12 @@ export function flushDiscreteUpdates() { export function deferredUpdates(fn: () => A): A { // TODO: Remove in favor of Scheduler.next - const previousLanePriority = getCurrentLanePriority(); + const previousLanePriority = getCurrentUpdateLanePriority(); try { - setCurrentLanePriority(DefaultLanePriority); + setCurrentUpdateLanePriority(DefaultLanePriority); return runWithPriority(NormalSchedulerPriority, fn); } finally { - setCurrentLanePriority(previousLanePriority); + setCurrentUpdateLanePriority(previousLanePriority); } } @@ -1139,16 +1139,16 @@ export function discreteUpdates( ): R { const prevExecutionContext = executionContext; executionContext |= DiscreteEventContext; - const previousLanePriority = getCurrentLanePriority(); + const previousLanePriority = getCurrentUpdateLanePriority(); try { - setCurrentLanePriority(InputDiscreteLanePriority); + setCurrentUpdateLanePriority(InputDiscreteLanePriority); // Should this return runWithPriority( UserBlockingSchedulerPriority, fn.bind(null, a, b, c, d), ); } finally { - setCurrentLanePriority(previousLanePriority); + setCurrentUpdateLanePriority(previousLanePriority); executionContext = prevExecutionContext; if (executionContext === NoContext) { // Flush the immediate callbacks that were scheduled during this batch @@ -1185,16 +1185,16 @@ export function flushSync(fn: A => R, a: A): R { return fn(a); } executionContext |= BatchedContext; - const previousLanePriority = getCurrentLanePriority(); + const previousLanePriority = getCurrentUpdateLanePriority(); try { - setCurrentLanePriority(SyncLanePriority); + setCurrentUpdateLanePriority(SyncLanePriority); if (fn) { return runWithPriority(ImmediateSchedulerPriority, fn.bind(null, a)); } else { return (undefined: $FlowFixMe); } } finally { - setCurrentLanePriority(previousLanePriority); + setCurrentUpdateLanePriority(previousLanePriority); executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch. // Note that this will happen even if batchedUpdates is higher up @@ -1206,12 +1206,12 @@ export function flushSync(fn: A => R, a: A): R { export function flushControlled(fn: () => mixed): void { const prevExecutionContext = executionContext; executionContext |= BatchedContext; - const previousLanePriority = getCurrentLanePriority(); + const previousLanePriority = getCurrentUpdateLanePriority(); try { - setCurrentLanePriority(SyncLanePriority); + setCurrentUpdateLanePriority(SyncLanePriority); runWithPriority(ImmediateSchedulerPriority, fn); } finally { - setCurrentLanePriority(previousLanePriority); + setCurrentUpdateLanePriority(previousLanePriority); executionContext = prevExecutionContext; if (executionContext === NoContext) { // Flush the immediate callbacks that were scheduled during this batch @@ -1802,20 +1802,17 @@ function resetChildLanes(completedWork: Fiber) { function commitRoot(root) { const renderPriorityLevel = getCurrentPriorityLevel(); - const previousLanePriority = getCurrentLanePriority(); - try { - setCurrentLanePriority(SyncLanePriority); - runWithPriority( - ImmediateSchedulerPriority, - commitRootImpl.bind(null, root, renderPriorityLevel), - ); - } finally { - setCurrentLanePriority(previousLanePriority); - } + runWithPriority( + ImmediateSchedulerPriority, + commitRootImpl.bind(null, root, renderPriorityLevel), + ); return null; } function commitRootImpl(root, renderPriorityLevel) { + const previousLanePriority = getCurrentUpdateLanePriority(); + setCurrentUpdateLanePriority(SyncLanePriority); + do { // `flushPassiveEffects` will call `flushSyncUpdateQueue` at the end, which // means `flushPassiveEffects` will sometimes result in additional @@ -2111,6 +2108,9 @@ function commitRootImpl(root, renderPriorityLevel) { // additional work on this root is scheduled. ensureRootIsScheduled(root, now()); + // Reset the priority to the previous non-sync value. + setCurrentUpdateLanePriority(previousLanePriority); + if (hasUncaughtError) { hasUncaughtError = false; const error = firstUncaughtError; @@ -2280,12 +2280,14 @@ export function flushPassiveEffects() { ? NormalSchedulerPriority : pendingPassiveEffectsRenderPriority; pendingPassiveEffectsRenderPriority = NoSchedulerPriority; - const previousLanePriority = getCurrentLanePriority(); + const previousLanePriority = getCurrentUpdateLanePriority(); try { - setCurrentLanePriority(schedulerPriorityToLanePriority(priorityLevel)); + setCurrentUpdateLanePriority( + schedulerPriorityToLanePriority(priorityLevel), + ); return runWithPriority(priorityLevel, flushPassiveEffectsImpl); } finally { - setCurrentLanePriority(previousLanePriority); + setCurrentUpdateLanePriority(previousLanePriority); } } } diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js index 9fbf0bf610e4a..a28985af76d37 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js @@ -26,7 +26,7 @@ import { enableSchedulerTracing, warnAboutUnmockedScheduler, deferRenderPhaseUpdateToNextBatch, - enableCurrentLanePriority, + enableCurrentUpdateLanePriority, } from 'shared/ReactFeatureFlags'; import ReactSharedInternals from 'shared/ReactSharedInternals'; import invariant from 'shared/invariant'; @@ -132,8 +132,8 @@ import { hasUpdatePriority, getNextLanes, returnNextLanesPriority, - setCurrentLanePriority, - getCurrentLanePriority, + setCurrentUpdateLanePriority, + getCurrentUpdateLanePriority, markStarvedLanesAsExpired, getLanesToRetrySynchronouslyOnError, markRootUpdated, @@ -422,10 +422,10 @@ export function requestUpdateLane( currentEventPendingLanes, ); } else if ( - enableCurrentLanePriority && - getCurrentLanePriority() !== NoLanePriority + enableCurrentUpdateLanePriority && + getCurrentUpdateLanePriority() !== NoLanePriority ) { - const currentLanePriority = getCurrentLanePriority(); + const currentLanePriority = getCurrentUpdateLanePriority(); lane = findUpdateLane(currentLanePriority, currentEventWipLanes); } else { // TODO: If we're not inside `runWithPriority`, this returns the priority @@ -1078,12 +1078,12 @@ export function flushDiscreteUpdates() { export function deferredUpdates(fn: () => A): A { // TODO: Remove in favor of Scheduler.next - const previousLanePriority = getCurrentLanePriority(); + const previousLanePriority = getCurrentUpdateLanePriority(); try { - setCurrentLanePriority(DefaultLanePriority); + setCurrentUpdateLanePriority(DefaultLanePriority); return runWithPriority(NormalSchedulerPriority, fn); } finally { - setCurrentLanePriority(previousLanePriority); + setCurrentUpdateLanePriority(previousLanePriority); } } @@ -1139,16 +1139,16 @@ export function discreteUpdates( ): R { const prevExecutionContext = executionContext; executionContext |= DiscreteEventContext; - const previousLanePriority = getCurrentLanePriority(); + const previousLanePriority = getCurrentUpdateLanePriority(); try { - setCurrentLanePriority(InputDiscreteLanePriority); + setCurrentUpdateLanePriority(InputDiscreteLanePriority); // Should this return runWithPriority( UserBlockingSchedulerPriority, fn.bind(null, a, b, c, d), ); } finally { - setCurrentLanePriority(previousLanePriority); + setCurrentUpdateLanePriority(previousLanePriority); executionContext = prevExecutionContext; if (executionContext === NoContext) { // Flush the immediate callbacks that were scheduled during this batch @@ -1185,16 +1185,16 @@ export function flushSync(fn: A => R, a: A): R { return fn(a); } executionContext |= BatchedContext; - const previousLanePriority = getCurrentLanePriority(); + const previousLanePriority = getCurrentUpdateLanePriority(); try { - setCurrentLanePriority(SyncLanePriority); + setCurrentUpdateLanePriority(SyncLanePriority); if (fn) { return runWithPriority(ImmediateSchedulerPriority, fn.bind(null, a)); } else { return (undefined: $FlowFixMe); } } finally { - setCurrentLanePriority(previousLanePriority); + setCurrentUpdateLanePriority(previousLanePriority); executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch. // Note that this will happen even if batchedUpdates is higher up @@ -1206,12 +1206,12 @@ export function flushSync(fn: A => R, a: A): R { export function flushControlled(fn: () => mixed): void { const prevExecutionContext = executionContext; executionContext |= BatchedContext; - const previousLanePriority = getCurrentLanePriority(); + const previousLanePriority = getCurrentUpdateLanePriority(); try { - setCurrentLanePriority(SyncLanePriority); + setCurrentUpdateLanePriority(SyncLanePriority); runWithPriority(ImmediateSchedulerPriority, fn); } finally { - setCurrentLanePriority(previousLanePriority); + setCurrentUpdateLanePriority(previousLanePriority); executionContext = prevExecutionContext; if (executionContext === NoContext) { // Flush the immediate callbacks that were scheduled during this batch @@ -1802,20 +1802,17 @@ function resetChildLanes(completedWork: Fiber) { function commitRoot(root) { const renderPriorityLevel = getCurrentPriorityLevel(); - const previousLanePriority = getCurrentLanePriority(); - try { - setCurrentLanePriority(SyncLanePriority); - runWithPriority( - ImmediateSchedulerPriority, - commitRootImpl.bind(null, root, renderPriorityLevel), - ); - } finally { - setCurrentLanePriority(previousLanePriority); - } + runWithPriority( + ImmediateSchedulerPriority, + commitRootImpl.bind(null, root, renderPriorityLevel), + ); return null; } function commitRootImpl(root, renderPriorityLevel) { + const previousLanePriority = getCurrentUpdateLanePriority(); + setCurrentUpdateLanePriority(SyncLanePriority); + do { // `flushPassiveEffects` will call `flushSyncUpdateQueue` at the end, which // means `flushPassiveEffects` will sometimes result in additional @@ -2111,6 +2108,9 @@ function commitRootImpl(root, renderPriorityLevel) { // additional work on this root is scheduled. ensureRootIsScheduled(root, now()); + // Reset the priority to the previous non-sync value. + setCurrentUpdateLanePriority(previousLanePriority); + if (hasUncaughtError) { hasUncaughtError = false; const error = firstUncaughtError; @@ -2280,12 +2280,14 @@ export function flushPassiveEffects() { ? NormalSchedulerPriority : pendingPassiveEffectsRenderPriority; pendingPassiveEffectsRenderPriority = NoSchedulerPriority; - const previousLanePriority = getCurrentLanePriority(); + const previousLanePriority = getCurrentUpdateLanePriority(); try { - setCurrentLanePriority(schedulerPriorityToLanePriority(priorityLevel)); + setCurrentUpdateLanePriority( + schedulerPriorityToLanePriority(priorityLevel), + ); return runWithPriority(priorityLevel, flushPassiveEffectsImpl); } finally { - setCurrentLanePriority(previousLanePriority); + setCurrentUpdateLanePriority(previousLanePriority); } } } diff --git a/packages/react-reconciler/src/SchedulerWithReactIntegration.new.js b/packages/react-reconciler/src/SchedulerWithReactIntegration.new.js index 869c509768fec..5054b45b21f15 100644 --- a/packages/react-reconciler/src/SchedulerWithReactIntegration.new.js +++ b/packages/react-reconciler/src/SchedulerWithReactIntegration.new.js @@ -17,8 +17,8 @@ import {enableSchedulerTracing} from 'shared/ReactFeatureFlags'; import invariant from 'shared/invariant'; import { SyncLanePriority, - getCurrentLanePriority, - setCurrentLanePriority, + getCurrentUpdateLanePriority, + setCurrentUpdateLanePriority, } from './ReactFiberLane'; const { @@ -176,11 +176,11 @@ function flushSyncCallbackQueueImpl() { // Prevent re-entrancy. isFlushingSyncQueue = true; let i = 0; - const previousLandPriority = getCurrentLanePriority(); + const previousLandPriority = getCurrentUpdateLanePriority(); try { const isSync = true; const queue = syncQueue; - setCurrentLanePriority(SyncLanePriority); + setCurrentUpdateLanePriority(SyncLanePriority); runWithPriority(ImmediatePriority, () => { for (; i < queue.length; i++) { let callback = queue[i]; @@ -202,7 +202,7 @@ function flushSyncCallbackQueueImpl() { ); throw error; } finally { - setCurrentLanePriority(previousLandPriority); + setCurrentUpdateLanePriority(previousLandPriority); isFlushingSyncQueue = false; } } diff --git a/packages/react-reconciler/src/SchedulerWithReactIntegration.old.js b/packages/react-reconciler/src/SchedulerWithReactIntegration.old.js index 869c509768fec..5054b45b21f15 100644 --- a/packages/react-reconciler/src/SchedulerWithReactIntegration.old.js +++ b/packages/react-reconciler/src/SchedulerWithReactIntegration.old.js @@ -17,8 +17,8 @@ import {enableSchedulerTracing} from 'shared/ReactFeatureFlags'; import invariant from 'shared/invariant'; import { SyncLanePriority, - getCurrentLanePriority, - setCurrentLanePriority, + getCurrentUpdateLanePriority, + setCurrentUpdateLanePriority, } from './ReactFiberLane'; const { @@ -176,11 +176,11 @@ function flushSyncCallbackQueueImpl() { // Prevent re-entrancy. isFlushingSyncQueue = true; let i = 0; - const previousLandPriority = getCurrentLanePriority(); + const previousLandPriority = getCurrentUpdateLanePriority(); try { const isSync = true; const queue = syncQueue; - setCurrentLanePriority(SyncLanePriority); + setCurrentUpdateLanePriority(SyncLanePriority); runWithPriority(ImmediatePriority, () => { for (; i < queue.length; i++) { let callback = queue[i]; @@ -202,7 +202,7 @@ function flushSyncCallbackQueueImpl() { ); throw error; } finally { - setCurrentLanePriority(previousLandPriority); + setCurrentUpdateLanePriority(previousLandPriority); isFlushingSyncQueue = false; } } diff --git a/packages/shared/ReactFeatureFlags.js b/packages/shared/ReactFeatureFlags.js index 0de1384b2a413..7e1a86d7f14c0 100644 --- a/packages/shared/ReactFeatureFlags.js +++ b/packages/shared/ReactFeatureFlags.js @@ -125,4 +125,4 @@ export const enableLegacyFBSupport = false; export const deferRenderPhaseUpdateToNextBatch = true; // Replacement for runWithPriority in React internals. -export const enableCurrentLanePriority = false; +export const enableCurrentUpdateLanePriority = true; diff --git a/packages/shared/forks/ReactFeatureFlags.www-dynamic.js b/packages/shared/forks/ReactFeatureFlags.www-dynamic.js index 03100167f3f07..3464e42cbb87a 100644 --- a/packages/shared/forks/ReactFeatureFlags.www-dynamic.js +++ b/packages/shared/forks/ReactFeatureFlags.www-dynamic.js @@ -18,6 +18,7 @@ export const disableInputAttributeSyncing = __VARIANT__; export const enableFilterEmptyStringAttributesDOM = __VARIANT__; export const enableLegacyFBSupport = __VARIANT__; export const enableDebugTracing = !__VARIANT__; +export const enableCurrentUpdateLanePriority = __VARIANT__; // This only has an effect in the new reconciler. But also, the new reconciler // is only enabled when __VARIANT__ is true. So this is set to the opposite of