mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46270 Changelog: [internal] When analyzing traces, I noticed that we were using the choreographer to batch events in the native layer on Android. This approach isn't very efficient for 2 reasons: 1. The choreographer runs in specific intervals and there could be some delay between receiving the events and dispatching them from the choreographer. 2. A slow mount operation in the choreographer after receiving the event would completely block the dispatch for the whole duration of the operation. This could take as long as 100s of ms, so it can be very significant. This is especially relevant with layout events, which are dispatched using the same mechanism as input events. In this case, there are instances where we delay rendering in JS because we're doing an expensive mount in the UI thread. It makes sense to batch events in native so we don't do unnecessary work in JS to process them, but there's a better mechanism to do this. Instead of posting a frame callback in the choreographer, we can batch events using a new task in an Android handler running on the UI thread. This would run immediately after the job where the events are dispatched, after all the events are dispatched. This implements that mechanism behind a feature flag. Reviewed By: sammy-SC Differential Revision: D62004018 fbshipit-source-id: d8b78a75cf05d0d8c9dd867a82a776f8d293a683
78 lines
3.2 KiB
C++
78 lines
3.2 KiB
C++
/*
|
|
* 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.
|
|
*
|
|
* @generated SignedSource<<ea07dfe758e8d6f5eada26850dc492a0>>
|
|
*/
|
|
|
|
/**
|
|
* IMPORTANT: Do NOT modify this file directly.
|
|
*
|
|
* To change the definition of the flags, edit
|
|
* packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js.
|
|
*
|
|
* To regenerate this code, run the following script from the repo root:
|
|
* yarn featureflags-update
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
namespace facebook::react {
|
|
|
|
class ReactNativeFeatureFlagsProvider {
|
|
public:
|
|
virtual ~ReactNativeFeatureFlagsProvider() = default;
|
|
|
|
virtual bool commonTestFlag() = 0;
|
|
virtual bool allowRecursiveCommitsWithSynchronousMountOnAndroid() = 0;
|
|
virtual bool batchRenderingUpdatesInEventLoop() = 0;
|
|
virtual bool completeReactInstanceCreationOnBgThreadOnAndroid() = 0;
|
|
virtual bool destroyFabricSurfacesInReactInstanceManager() = 0;
|
|
virtual bool enableAlignItemsBaselineOnFabricIOS() = 0;
|
|
virtual bool enableAndroidMixBlendModeProp() = 0;
|
|
virtual bool enableBackgroundStyleApplicator() = 0;
|
|
virtual bool enableCleanTextInputYogaNode() = 0;
|
|
virtual bool enableEagerRootViewAttachment() = 0;
|
|
virtual bool enableEventEmitterRetentionDuringGesturesOnAndroid() = 0;
|
|
virtual bool enableFabricLogs() = 0;
|
|
virtual bool enableFabricRendererExclusively() = 0;
|
|
virtual bool enableGranularShadowTreeStateReconciliation() = 0;
|
|
virtual bool enableLayoutAnimationsOnIOS() = 0;
|
|
virtual bool enableLongTaskAPI() = 0;
|
|
virtual bool enableMicrotasks() = 0;
|
|
virtual bool enablePropsUpdateReconciliationAndroid() = 0;
|
|
virtual bool enableReportEventPaintTime() = 0;
|
|
virtual bool enableSynchronousStateUpdates() = 0;
|
|
virtual bool enableUIConsistency() = 0;
|
|
virtual bool enableViewRecycling() = 0;
|
|
virtual bool excludeYogaFromRawProps() = 0;
|
|
virtual bool fetchImagesInViewPreallocation() = 0;
|
|
virtual bool fixIncorrectScrollViewStateUpdateOnAndroid() = 0;
|
|
virtual bool fixMappingOfEventPrioritiesBetweenFabricAndReact() = 0;
|
|
virtual bool fixMissedFabricStateUpdatesOnAndroid() = 0;
|
|
virtual bool fixMountingCoordinatorReportedPendingTransactionsOnAndroid() = 0;
|
|
virtual bool forceBatchingMountItemsOnAndroid() = 0;
|
|
virtual bool fuseboxEnabledDebug() = 0;
|
|
virtual bool fuseboxEnabledRelease() = 0;
|
|
virtual bool initEagerTurboModulesOnNativeModulesQueueAndroid() = 0;
|
|
virtual bool lazyAnimationCallbacks() = 0;
|
|
virtual bool loadVectorDrawablesOnImages() = 0;
|
|
virtual bool setAndroidLayoutDirection() = 0;
|
|
virtual bool traceTurboModulePromiseRejectionsOnAndroid() = 0;
|
|
virtual bool useFabricInterop() = 0;
|
|
virtual bool useImmediateExecutorInAndroidBridgeless() = 0;
|
|
virtual bool useModernRuntimeScheduler() = 0;
|
|
virtual bool useNativeViewConfigsInBridgelessMode() = 0;
|
|
virtual bool useNewReactImageViewBackgroundDrawing() = 0;
|
|
virtual bool useOptimisedViewPreallocationOnAndroid() = 0;
|
|
virtual bool useOptimizedEventBatchingOnAndroid() = 0;
|
|
virtual bool useRuntimeShadowNodeReferenceUpdate() = 0;
|
|
virtual bool useRuntimeShadowNodeReferenceUpdateOnLayout() = 0;
|
|
virtual bool useStateAlignmentMechanism() = 0;
|
|
virtual bool useTurboModuleInterop() = 0;
|
|
};
|
|
|
|
} // namespace facebook::react
|