From 97fce318a6618bc883a8578f58b9083484c9e6d7 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 9 Feb 2021 18:32:20 +0000 Subject: [PATCH] Experiment: Infer the current event priority from the native event (#20748) * Add the feature flag * Add a host config method * Wire it up to the work loop * Export constants for third-party renderers * Document for third-party renderers --- packages/react-art/src/ReactARTHostConfig.js | 12 +++++++++ .../src/client/ReactDOMHostConfig.js | 17 ++++++++++++ .../src/events/ReactDOMEventListener.js | 2 +- .../src/ReactFabricHostConfig.js | 12 +++++++++ .../src/ReactNativeHostConfig.js | 12 +++++++++ .../src/createReactNoop.js | 4 +++ packages/react-reconciler/README.md | 26 +++++++++++++++++++ .../src/ReactFiberReconciler.js | 15 +++++++++++ .../src/ReactFiberReconciler.new.js | 9 +++++++ .../src/ReactFiberReconciler.old.js | 9 +++++++ .../src/ReactFiberWorkLoop.new.js | 24 +++++++++++++---- .../src/ReactFiberWorkLoop.old.js | 24 +++++++++++++---- .../src/forks/ReactFiberHostConfig.custom.js | 1 + .../src/ReactTestHostConfig.js | 12 +++++++++ packages/shared/ReactFeatureFlags.js | 2 ++ .../forks/ReactFeatureFlags.native-fb.js | 1 + .../forks/ReactFeatureFlags.native-oss.js | 1 + .../forks/ReactFeatureFlags.test-renderer.js | 1 + .../ReactFeatureFlags.test-renderer.native.js | 1 + .../ReactFeatureFlags.test-renderer.www.js | 1 + .../shared/forks/ReactFeatureFlags.testing.js | 1 + .../forks/ReactFeatureFlags.testing.www.js | 1 + .../forks/ReactFeatureFlags.www-dynamic.js | 1 + .../shared/forks/ReactFeatureFlags.www.js | 1 + 24 files changed, 179 insertions(+), 11 deletions(-) diff --git a/packages/react-art/src/ReactARTHostConfig.js b/packages/react-art/src/ReactARTHostConfig.js index 80b4a39f396bf..de20fe5182c6c 100644 --- a/packages/react-art/src/ReactARTHostConfig.js +++ b/packages/react-art/src/ReactARTHostConfig.js @@ -7,10 +7,18 @@ import Transform from 'art/core/transform'; import Mode from 'art/modes/current'; +import {enableNewReconciler} from 'shared/ReactFeatureFlags'; import invariant from 'shared/invariant'; import {TYPES, EVENT_TYPES, childrenAsString} from './ReactARTInternals'; +import {DefaultLanePriority as DefaultLanePriority_old} from 'react-reconciler/src/ReactFiberLane.old'; +import {DefaultLanePriority as DefaultLanePriority_new} from 'react-reconciler/src/ReactFiberLane.new'; + +const DefaultLanePriority = enableNewReconciler + ? DefaultLanePriority_new + : DefaultLanePriority_old; + const pooledTransform = new Transform(); const NO_CONTEXT = {}; @@ -340,6 +348,10 @@ export function shouldSetTextContent(type, props) { ); } +export function getCurrentEventPriority() { + return DefaultLanePriority; +} + // The ART renderer is secondary to the React DOM renderer. export const isPrimaryRenderer = false; diff --git a/packages/react-dom/src/client/ReactDOMHostConfig.js b/packages/react-dom/src/client/ReactDOMHostConfig.js index 9576b602fcc98..aca426ce08ecb 100644 --- a/packages/react-dom/src/client/ReactDOMHostConfig.js +++ b/packages/react-dom/src/client/ReactDOMHostConfig.js @@ -47,6 +47,7 @@ import {validateDOMNesting, updatedAncestorInfo} from './validateDOMNesting'; import { isEnabled as ReactBrowserEventEmitterIsEnabled, setEnabled as ReactBrowserEventEmitterSetEnabled, + getEventPriority, } from '../events/ReactDOMEventListener'; import {getChildNamespace} from '../shared/DOMNamespaces'; import { @@ -65,10 +66,18 @@ import { enableSuspenseServerRenderer, enableCreateEventHandleAPI, enableScopeAPI, + enableNewReconciler, } from 'shared/ReactFeatureFlags'; import {HostComponent, HostText} from 'react-reconciler/src/ReactWorkTags'; import {listenToAllSupportedEvents} from '../events/DOMPluginEventSystem'; +import {DefaultLanePriority as DefaultLanePriority_old} from 'react-reconciler/src/ReactFiberLane.old'; +import {DefaultLanePriority as DefaultLanePriority_new} from 'react-reconciler/src/ReactFiberLane.new'; + +const DefaultLanePriority = enableNewReconciler + ? DefaultLanePriority_new + : DefaultLanePriority_old; + export type Type = string; export type Props = { autoFocus?: boolean, @@ -372,6 +381,14 @@ export function createTextInstance( return textNode; } +export function getCurrentEventPriority(): * { + const currentEvent = window.event; + if (currentEvent === undefined) { + return DefaultLanePriority; + } + return getEventPriority(currentEvent.type); +} + export const isPrimaryRenderer = true; export const warnsIfNotActing = true; // This initialization code may run even on server environments diff --git a/packages/react-dom/src/events/ReactDOMEventListener.js b/packages/react-dom/src/events/ReactDOMEventListener.js index 74955b0c88eb0..358c303b7918b 100644 --- a/packages/react-dom/src/events/ReactDOMEventListener.js +++ b/packages/react-dom/src/events/ReactDOMEventListener.js @@ -348,7 +348,7 @@ export function attemptToDispatchEvent( return null; } -function getEventPriority(domEventName: DOMEventName) { +export function getEventPriority(domEventName: DOMEventName): * { switch (domEventName) { // Used by SimpleEventPlugin: case 'cancel': diff --git a/packages/react-native-renderer/src/ReactFabricHostConfig.js b/packages/react-native-renderer/src/ReactFabricHostConfig.js index 912f33633380b..27b7076377fc4 100644 --- a/packages/react-native-renderer/src/ReactFabricHostConfig.js +++ b/packages/react-native-renderer/src/ReactFabricHostConfig.js @@ -21,10 +21,18 @@ import type { import {mountSafeCallback_NOT_REALLY_SAFE} from './NativeMethodsMixinUtils'; import {create, diff} from './ReactNativeAttributePayload'; +import {enableNewReconciler} from 'shared/ReactFeatureFlags'; import invariant from 'shared/invariant'; import {dispatchEvent} from './ReactFabricEventEmitter'; +import {DefaultLanePriority as DefaultLanePriority_old} from 'react-reconciler/src/ReactFiberLane.old'; +import {DefaultLanePriority as DefaultLanePriority_new} from 'react-reconciler/src/ReactFiberLane.new'; + +const DefaultLanePriority = enableNewReconciler + ? DefaultLanePriority_new + : DefaultLanePriority_old; + // Modules provided by RN: import { ReactNativeViewConfigRegistry, @@ -339,6 +347,10 @@ export function shouldSetTextContent(type: string, props: Props): boolean { return false; } +export function getCurrentEventPriority(): * { + return DefaultLanePriority; +} + // The Fabric renderer is secondary to the existing React Native renderer. export const isPrimaryRenderer = false; diff --git a/packages/react-native-renderer/src/ReactNativeHostConfig.js b/packages/react-native-renderer/src/ReactNativeHostConfig.js index 86217bdc4d03d..7f11358556287 100644 --- a/packages/react-native-renderer/src/ReactNativeHostConfig.js +++ b/packages/react-native-renderer/src/ReactNativeHostConfig.js @@ -10,6 +10,7 @@ import type {TouchedViewDataAtPoint} from './ReactNativeTypes'; import invariant from 'shared/invariant'; +import {enableNewReconciler} from 'shared/ReactFeatureFlags'; // Modules provided by RN: import { @@ -26,6 +27,13 @@ import { } from './ReactNativeComponentTree'; import ReactNativeFiberHostComponent from './ReactNativeFiberHostComponent'; +import {DefaultLanePriority as DefaultLanePriority_old} from 'react-reconciler/src/ReactFiberLane.old'; +import {DefaultLanePriority as DefaultLanePriority_new} from 'react-reconciler/src/ReactFiberLane.new'; + +const DefaultLanePriority = enableNewReconciler + ? DefaultLanePriority_new + : DefaultLanePriority_old; + const {get: getViewConfigForType} = ReactNativeViewConfigRegistry; export type Type = string; @@ -261,6 +269,10 @@ export function shouldSetTextContent(type: string, props: Props): boolean { return false; } +export function getCurrentEventPriority(): * { + return DefaultLanePriority; +} + // ------------------- // Mutation // ------------------- diff --git a/packages/react-noop-renderer/src/createReactNoop.js b/packages/react-noop-renderer/src/createReactNoop.js index 5a71567ab62f1..34967ca3625ed 100644 --- a/packages/react-noop-renderer/src/createReactNoop.js +++ b/packages/react-noop-renderer/src/createReactNoop.js @@ -391,6 +391,10 @@ function createReactNoop(reconciler: Function, useMutation: boolean) { resetAfterCommit(): void {}, + getCurrentEventPriority() { + return NoopRenderer.DefaultEventPriority; + }, + now: Scheduler.unstable_now, isPrimaryRenderer: true, diff --git a/packages/react-reconciler/README.md b/packages/react-reconciler/README.md index 33bbdcfc7fd92..ce5fddb0eea91 100644 --- a/packages/react-reconciler/README.md +++ b/packages/react-reconciler/README.md @@ -211,6 +211,32 @@ You can proxy this to `queueMicrotask` or its equivalent in your environment. This is a property (not a function) that should be set to `true` if your renderer is the main one on the page. For example, if you're writing a renderer for the Terminal, it makes sense to set it to `true`, but if your renderer is used *on top of* React DOM or some other existing renderer, set it to `false`. +#### `getCurrentEventPriority` + +To implement this method, you'll need some constants available on the _returned_ `Renderer` object: + +```js +const HostConfig = { + // ... + getCurrentEventPriority() { + return MyRenderer.DefaultEventPriority; + }, + // ... +} + +const MyRenderer = Reconciler(HostConfig); +``` + +The constant you return depends on which event, if any, is being handled right now. (In the browser, you can check this using `window.event && window.event.type`). + +* **Discrete events:** If the active event is _directly caused by the user_ (such as mouse and keyboard events) and _each event in a sequence is intentional_ (e.g. `click`), return `MyRenderer.DiscreteEventPriority`. This tells React that they should interrupt any background work and cannot be batched across time. + +* **Continuous events:** If the active event is _directly caused by the user_ but _the user can't distinguish between individual events in a sequence_ (e.g. `mouseover`), return `MyRenderer.ContinuousEventPriority`. This tells React they should interrupt any background work but can be batched across time. + +* **Other events / No active event:** In all other cases, return `MyRenderer.DefaultEventPriority`. This tells React that this event is considered background work, and interactive events will be prioritized over it. + +You can consult the `getCurrentEventPriority()` implementation in `ReactDOMHostConfig.js` for a reference implementation. + ### Mutation Methods If you're using React in mutation mode (you probably do), you'll need to implement a few more methods. diff --git a/packages/react-reconciler/src/ReactFiberReconciler.js b/packages/react-reconciler/src/ReactFiberReconciler.js index 292d3aaf2a323..7493b73636a34 100644 --- a/packages/react-reconciler/src/ReactFiberReconciler.js +++ b/packages/react-reconciler/src/ReactFiberReconciler.js @@ -52,6 +52,9 @@ import { registerMutableSourceForHydration as registerMutableSourceForHydration_old, runWithPriority as runWithPriority_old, getCurrentUpdateLanePriority as getCurrentUpdateLanePriority_old, + DefaultEventPriority as DefaultEventPriority_old, + DiscreteEventPriority as DiscreteEventPriority_old, + ContinuousEventPriority as ContinuousEventPriority_old, } from './ReactFiberReconciler.old'; import { @@ -92,6 +95,9 @@ import { registerMutableSourceForHydration as registerMutableSourceForHydration_new, runWithPriority as runWithPriority_new, getCurrentUpdateLanePriority as getCurrentUpdateLanePriority_new, + DefaultEventPriority as DefaultEventPriority_new, + DiscreteEventPriority as DiscreteEventPriority_new, + ContinuousEventPriority as ContinuousEventPriority_new, } from './ReactFiberReconciler.new'; export const createContainer = enableNewReconciler @@ -168,6 +174,15 @@ export const createPortal = enableNewReconciler export const createComponentSelector = enableNewReconciler ? createComponentSelector_new : createComponentSelector_old; +export const DefaultEventPriority = enableNewReconciler + ? DefaultEventPriority_new + : DefaultEventPriority_old; +export const DiscreteEventPriority = enableNewReconciler + ? DiscreteEventPriority_new + : DiscreteEventPriority_old; +export const ContinuousEventPriority = enableNewReconciler + ? ContinuousEventPriority_new + : ContinuousEventPriority_old; //TODO: "psuedo" is spelled "pseudo" export const createHasPsuedoClassSelector = enableNewReconciler diff --git a/packages/react-reconciler/src/ReactFiberReconciler.new.js b/packages/react-reconciler/src/ReactFiberReconciler.new.js index 439f69634e9bb..039bb159fd7a9 100644 --- a/packages/react-reconciler/src/ReactFiberReconciler.new.js +++ b/packages/react-reconciler/src/ReactFiberReconciler.new.js @@ -94,6 +94,15 @@ import { } from './ReactFiberHotReloading.new'; import {markRenderScheduled} from './SchedulingProfiler'; +// Ideally host configs would import these constants from the reconciler +// entry point, but we can't do this because of a circular dependency. +// They are used by third-party renderers so they need to stay up to date. +export { + InputDiscreteLanePriority as DiscreteEventPriority, + InputContinuousLanePriority as ContinuousEventPriority, + DefaultLanePriority as DefaultEventPriority, +} from './ReactFiberLane.new'; + export {registerMutableSourceForHydration} from './ReactMutableSource.new'; export {createPortal} from './ReactPortal'; export { diff --git a/packages/react-reconciler/src/ReactFiberReconciler.old.js b/packages/react-reconciler/src/ReactFiberReconciler.old.js index f9e4a7cdf0d7c..012b4c7057350 100644 --- a/packages/react-reconciler/src/ReactFiberReconciler.old.js +++ b/packages/react-reconciler/src/ReactFiberReconciler.old.js @@ -94,6 +94,15 @@ import { } from './ReactFiberHotReloading.old'; import {markRenderScheduled} from './SchedulingProfiler'; +// Ideally host configs would import these constants from the reconciler +// entry point, but we can't do this because of a circular dependency. +// They are used by third-party renderers so they need to stay up to date. +export { + InputDiscreteLanePriority as DiscreteEventPriority, + InputContinuousLanePriority as ContinuousEventPriority, + DefaultLanePriority as DefaultEventPriority, +} from './ReactFiberLane.old'; + export {registerMutableSourceForHydration} from './ReactMutableSource.new'; export {createPortal} from './ReactPortal'; export { diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js index f2bcc19557ea5..e65e1dad45d6e 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js @@ -35,6 +35,7 @@ import { enableDoubleInvokingEffects, skipUnmountedBoundaries, enableTransitionEntanglement, + enableNativeEventPriorityInference, } from 'shared/ReactFeatureFlags'; import ReactSharedInternals from 'shared/ReactSharedInternals'; import invariant from 'shared/invariant'; @@ -94,6 +95,7 @@ import { afterActiveInstanceBlur, clearContainer, scheduleMicrotask, + getCurrentEventPriority, } from './ReactFiberHostConfig'; import { @@ -461,11 +463,23 @@ export function requestUpdateLane(fiber: Fiber): Lane { const currentLanePriority = getCurrentUpdateLanePriority(); lane = findUpdateLane(currentLanePriority, currentEventWipLanes); } else { - const schedulerLanePriority = schedulerPriorityToLanePriority( - schedulerPriority, - ); - - lane = findUpdateLane(schedulerLanePriority, currentEventWipLanes); + if (enableNativeEventPriorityInference) { + const eventLanePriority = getCurrentEventPriority(); + if (eventLanePriority === DefaultLanePriority) { + // TODO: move this case into the ReactDOM host config. + const schedulerLanePriority = schedulerPriorityToLanePriority( + schedulerPriority, + ); + lane = findUpdateLane(schedulerLanePriority, currentEventWipLanes); + } else { + lane = findUpdateLane(eventLanePriority, currentEventWipLanes); + } + } else { + const schedulerLanePriority = schedulerPriorityToLanePriority( + schedulerPriority, + ); + lane = findUpdateLane(schedulerLanePriority, currentEventWipLanes); + } } return lane; diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js index 7ca3f9032f002..58a957261a82f 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js @@ -35,6 +35,7 @@ import { enableDoubleInvokingEffects, skipUnmountedBoundaries, enableTransitionEntanglement, + enableNativeEventPriorityInference, } from 'shared/ReactFeatureFlags'; import ReactSharedInternals from 'shared/ReactSharedInternals'; import invariant from 'shared/invariant'; @@ -94,6 +95,7 @@ import { afterActiveInstanceBlur, clearContainer, scheduleMicrotask, + getCurrentEventPriority, } from './ReactFiberHostConfig'; import { @@ -461,11 +463,23 @@ export function requestUpdateLane(fiber: Fiber): Lane { const currentLanePriority = getCurrentUpdateLanePriority(); lane = findUpdateLane(currentLanePriority, currentEventWipLanes); } else { - const schedulerLanePriority = schedulerPriorityToLanePriority( - schedulerPriority, - ); - - lane = findUpdateLane(schedulerLanePriority, currentEventWipLanes); + if (enableNativeEventPriorityInference) { + const eventLanePriority = getCurrentEventPriority(); + if (eventLanePriority === DefaultLanePriority) { + // TODO: move this case into the ReactDOM host config. + const schedulerLanePriority = schedulerPriorityToLanePriority( + schedulerPriority, + ); + lane = findUpdateLane(schedulerLanePriority, currentEventWipLanes); + } else { + lane = findUpdateLane(eventLanePriority, currentEventWipLanes); + } + } else { + const schedulerLanePriority = schedulerPriorityToLanePriority( + schedulerPriority, + ); + lane = findUpdateLane(schedulerLanePriority, currentEventWipLanes); + } } return lane; diff --git a/packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js b/packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js index 14e43a8222989..0e19b6b70414d 100644 --- a/packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js +++ b/packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js @@ -73,6 +73,7 @@ export const afterActiveInstanceBlur = $$$hostConfig.afterActiveInstanceBlur; export const preparePortalMount = $$$hostConfig.preparePortalMount; export const prepareScopeUpdate = $$$hostConfig.preparePortalMount; export const getInstanceFromScope = $$$hostConfig.getInstanceFromScope; +export const getCurrentEventPriority = $$$hostConfig.getCurrentEventPriority; // ------------------- // Test selectors diff --git a/packages/react-test-renderer/src/ReactTestHostConfig.js b/packages/react-test-renderer/src/ReactTestHostConfig.js index 6110a0de8c58d..60de8a05a17ea 100644 --- a/packages/react-test-renderer/src/ReactTestHostConfig.js +++ b/packages/react-test-renderer/src/ReactTestHostConfig.js @@ -8,6 +8,14 @@ */ import {REACT_OPAQUE_ID_TYPE} from 'shared/ReactSymbols'; +import {enableNewReconciler} from 'shared/ReactFeatureFlags'; + +import {DefaultLanePriority as DefaultLanePriority_old} from 'react-reconciler/src/ReactFiberLane.old'; +import {DefaultLanePriority as DefaultLanePriority_new} from 'react-reconciler/src/ReactFiberLane.new'; + +const DefaultLanePriority = enableNewReconciler + ? DefaultLanePriority_new + : DefaultLanePriority_old; export type Type = string; export type Props = Object; @@ -213,6 +221,10 @@ export function createTextInstance( }; } +export function getCurrentEventPriority(): * { + return DefaultLanePriority; +} + export const isPrimaryRenderer = false; export const warnsIfNotActing = true; diff --git a/packages/shared/ReactFeatureFlags.js b/packages/shared/ReactFeatureFlags.js index 842bbe4dfa616..ebd12c335f842 100644 --- a/packages/shared/ReactFeatureFlags.js +++ b/packages/shared/ReactFeatureFlags.js @@ -151,3 +151,5 @@ export const disableSchedulerTimeoutInWorkLoop = false; export const enableTransitionEntanglement = false; export const enableDiscreteEventMicroTasks = false; + +export const enableNativeEventPriorityInference = false; diff --git a/packages/shared/forks/ReactFeatureFlags.native-fb.js b/packages/shared/forks/ReactFeatureFlags.native-fb.js index 1200892cee3f5..3cf047f78eaf9 100644 --- a/packages/shared/forks/ReactFeatureFlags.native-fb.js +++ b/packages/shared/forks/ReactFeatureFlags.native-fb.js @@ -59,6 +59,7 @@ export const enableRecursiveCommitTraversal = false; export const disableSchedulerTimeoutInWorkLoop = false; export const enableTransitionEntanglement = false; export const enableDiscreteEventMicroTasks = false; +export const enableNativeEventPriorityInference = false; // Flow magic to verify the exports of this file match the original version. // eslint-disable-next-line no-unused-vars diff --git a/packages/shared/forks/ReactFeatureFlags.native-oss.js b/packages/shared/forks/ReactFeatureFlags.native-oss.js index 3eb2d5e718f9a..56582bc85f8c3 100644 --- a/packages/shared/forks/ReactFeatureFlags.native-oss.js +++ b/packages/shared/forks/ReactFeatureFlags.native-oss.js @@ -58,6 +58,7 @@ export const enableRecursiveCommitTraversal = false; export const disableSchedulerTimeoutInWorkLoop = false; export const enableTransitionEntanglement = false; export const enableDiscreteEventMicroTasks = false; +export const enableNativeEventPriorityInference = false; // Flow magic to verify the exports of this file match the original version. // eslint-disable-next-line no-unused-vars diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.js index 0e95ccae41092..64a7493b11eaf 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.js @@ -58,6 +58,7 @@ export const enableRecursiveCommitTraversal = false; export const disableSchedulerTimeoutInWorkLoop = false; export const enableTransitionEntanglement = false; export const enableDiscreteEventMicroTasks = false; +export const enableNativeEventPriorityInference = false; // Flow magic to verify the exports of this file match the original version. // eslint-disable-next-line no-unused-vars diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js index ef7e948b2e189..e10accde90683 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js @@ -58,6 +58,7 @@ export const enableRecursiveCommitTraversal = false; export const disableSchedulerTimeoutInWorkLoop = false; export const enableTransitionEntanglement = false; export const enableDiscreteEventMicroTasks = false; +export const enableNativeEventPriorityInference = false; // Flow magic to verify the exports of this file match the original version. // eslint-disable-next-line no-unused-vars diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js index 756c38694ec7f..3a7336db3bfaa 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js @@ -58,6 +58,7 @@ export const enableRecursiveCommitTraversal = false; export const disableSchedulerTimeoutInWorkLoop = false; export const enableTransitionEntanglement = false; export const enableDiscreteEventMicroTasks = false; +export const enableNativeEventPriorityInference = false; // Flow magic to verify the exports of this file match the original version. // eslint-disable-next-line no-unused-vars diff --git a/packages/shared/forks/ReactFeatureFlags.testing.js b/packages/shared/forks/ReactFeatureFlags.testing.js index d2240049e0a4d..4adeafbf30171 100644 --- a/packages/shared/forks/ReactFeatureFlags.testing.js +++ b/packages/shared/forks/ReactFeatureFlags.testing.js @@ -58,6 +58,7 @@ export const enableRecursiveCommitTraversal = false; export const disableSchedulerTimeoutInWorkLoop = false; export const enableTransitionEntanglement = false; export const enableDiscreteEventMicroTasks = false; +export const enableNativeEventPriorityInference = false; // Flow magic to verify the exports of this file match the original version. // eslint-disable-next-line no-unused-vars diff --git a/packages/shared/forks/ReactFeatureFlags.testing.www.js b/packages/shared/forks/ReactFeatureFlags.testing.www.js index e80dfde724d28..88ce477eea3e5 100644 --- a/packages/shared/forks/ReactFeatureFlags.testing.www.js +++ b/packages/shared/forks/ReactFeatureFlags.testing.www.js @@ -58,6 +58,7 @@ export const enableRecursiveCommitTraversal = false; export const disableSchedulerTimeoutInWorkLoop = false; export const enableTransitionEntanglement = false; export const enableDiscreteEventMicroTasks = false; +export const enableNativeEventPriorityInference = false; // Flow magic to verify the exports of this file match the original version. // eslint-disable-next-line no-unused-vars diff --git a/packages/shared/forks/ReactFeatureFlags.www-dynamic.js b/packages/shared/forks/ReactFeatureFlags.www-dynamic.js index 47d8763d039b2..f0cb3c5eb1ca5 100644 --- a/packages/shared/forks/ReactFeatureFlags.www-dynamic.js +++ b/packages/shared/forks/ReactFeatureFlags.www-dynamic.js @@ -57,3 +57,4 @@ export const enableProfilerNestedUpdateScheduledHook = __VARIANT__; export const disableSchedulerTimeoutInWorkLoop = __VARIANT__; export const enableTransitionEntanglement = __VARIANT__; export const enableDiscreteEventMicroTasks = __VARIANT__; +export const enableNativeEventPriorityInference = __VARIANT__; diff --git a/packages/shared/forks/ReactFeatureFlags.www.js b/packages/shared/forks/ReactFeatureFlags.www.js index 640b0d6f3e303..a2970b0a166d4 100644 --- a/packages/shared/forks/ReactFeatureFlags.www.js +++ b/packages/shared/forks/ReactFeatureFlags.www.js @@ -33,6 +33,7 @@ export const { disableSchedulerTimeoutInWorkLoop, enableTransitionEntanglement, enableDiscreteEventMicroTasks, + enableNativeEventPriorityInference, } = dynamicFeatureFlags; // On WWW, __EXPERIMENTAL__ is used for a new modern build.