mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
48c7adc3bf
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/36402 ## Changelog: [Internal] - Makes `GlobalPerformanceLogger` (`IPerformanceLogger` API), additionally use the native WebPerformance implementation (`Performance` and `PerformanceObserver` APIs) to log points/timespans as marks/measures correspondingly. This will ultimately help to converge performance logging facilities across platforms and language boundaries. In a shorter term, it can serve as a good case study of using the Web Performance API implementation. Note that this implementation is disabled by default (controlled by the RN feature flag), and will be enabled separately via na experiment. Reviewed By: rubennorte Differential Revision: D43873560 fbshipit-source-id: 22e2d787c8f22d2f67556dfe4bf175743eca2caf
56 lines
1.8 KiB
JavaScript
56 lines
1.8 KiB
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow strict
|
|
* @format
|
|
*/
|
|
|
|
export type FeatureFlags = {|
|
|
/**
|
|
* Function used to enable / disabled Layout Animations in React Native.
|
|
* Default value = true.
|
|
*/
|
|
isLayoutAnimationEnabled: () => boolean,
|
|
/**
|
|
* Function used to enable / disable W3C pointer event emitting in React Native.
|
|
* If enabled you must also flip the equivalent native flags on each platform:
|
|
* iOS -> RCTSetDispatchW3CPointerEvents
|
|
* Android -> ReactFeatureFlags.dispatchPointerEvents
|
|
*/
|
|
shouldEmitW3CPointerEvents: () => boolean,
|
|
/**
|
|
* Function used to enable / disable Pressibility from using W3C Pointer Events
|
|
* for its hover callbacks
|
|
*/
|
|
shouldPressibilityUseW3CPointerEventsForHover: () => boolean,
|
|
/**
|
|
* Enables an experimental flush-queue debouncing in Animated.js.
|
|
*/
|
|
animatedShouldDebounceQueueFlush: () => boolean,
|
|
/**
|
|
* Enables an experimental mega-operation for Animated.js that replaces
|
|
* many calls to native with a single call into native, to reduce JSI/JNI
|
|
* traffic.
|
|
*/
|
|
animatedShouldUseSingleOp: () => boolean,
|
|
/**
|
|
* Enables GlobalPerformanceLogger replacement with a WebPerformance API based
|
|
* implementation
|
|
*/
|
|
isGlobalWebPerformanceLoggerEnabled: () => boolean,
|
|
|};
|
|
|
|
const ReactNativeFeatureFlags: FeatureFlags = {
|
|
isLayoutAnimationEnabled: () => true,
|
|
shouldEmitW3CPointerEvents: () => false,
|
|
shouldPressibilityUseW3CPointerEventsForHover: () => false,
|
|
animatedShouldDebounceQueueFlush: () => false,
|
|
animatedShouldUseSingleOp: () => false,
|
|
isGlobalWebPerformanceLoggerEnabled: () => false,
|
|
};
|
|
|
|
module.exports = ReactNativeFeatureFlags;
|