mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
* [Events] Add EventPriority enum React DOM's DispatchConfig for synthetic events has an `isDiscrete` field that affects how updates triggered by an event are scheduled. Events are either discrete or continuous. This commit adds an additional type of configuration where an event has user-blocking priority, but is not discrete. E.g. updates triggered by hover are more important than the default, but they don't need to be processed serially. Because there are now three types of event priority instead of two, I've replaced the `isDiscrete` boolean with an enum: `eventPriority`. This commit implements the new enum value but does not change any behavior. I'll enable it behind a feature flag in the next commit. I've only implemented this in the legacy event system. I'll leave Flare for a follow-up. * enableUserBlockingEvents feature flag Adds a feature flag to increase the priority of events like `mouseover`, without making them discrete.
46 lines
1.7 KiB
JavaScript
46 lines
1.7 KiB
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow
|
|
*/
|
|
|
|
import invariant from 'shared/invariant';
|
|
|
|
import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags';
|
|
import typeof * as FeatureFlagsShimType from './ReactFeatureFlags.native-oss';
|
|
|
|
export const debugRenderPhaseSideEffects = false;
|
|
export const debugRenderPhaseSideEffectsForStrictMode = false;
|
|
export const enableUserTimingAPI = __DEV__;
|
|
export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
|
|
export const warnAboutDeprecatedLifecycles = true;
|
|
export const enableProfilerTimer = __PROFILE__;
|
|
export const enableSchedulerTracing = __PROFILE__;
|
|
export const enableSuspenseServerRenderer = false;
|
|
export const disableJavaScriptURLs = false;
|
|
export const disableYielding = false;
|
|
export const disableInputAttributeSyncing = false;
|
|
export const enableStableConcurrentModeAPIs = false;
|
|
export const warnAboutShorthandPropertyCollision = false;
|
|
export const enableSchedulerDebugging = false;
|
|
export const warnAboutDeprecatedSetNativeProps = false;
|
|
export const enableEventAPI = false;
|
|
export const enableJSXTransformAPI = false;
|
|
export const warnAboutMissingMockScheduler = false;
|
|
export const revertPassiveEffectsChange = false;
|
|
export const enableUserBlockingEvents = false;
|
|
|
|
// Only used in www builds.
|
|
export function addUserTimingListener() {
|
|
invariant(false, 'Not implemented.');
|
|
}
|
|
|
|
// Flow magic to verify the exports of this file match the original version.
|
|
// eslint-disable-next-line no-unused-vars
|
|
type Check<_X, Y: _X, X: Y = _X> = null;
|
|
// eslint-disable-next-line no-unused-expressions
|
|
(null: Check<FeatureFlagsShimType, FeatureFlagsType>);
|