From 0f0344984febba79d7545119f0c0328b951fee48 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 27 Jan 2025 06:26:35 -0800 Subject: [PATCH] ship useOptimisedViewPreallocationOnAndroid everywhere and remove gating (#48903) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/48903 changelog: [internal] Reviewed By: rubennorte Differential Revision: D68490542 fbshipit-source-id: f743e9c82328c5f06b431cffe77f9a28608535b9 --- .../react/fabric/FabricUIManager.java | 2 +- .../featureflags/ReactNativeFeatureFlags.kt | 8 +---- .../ReactNativeFeatureFlagsCxxAccessor.kt | 12 +------- .../ReactNativeFeatureFlagsCxxInterop.kt | 4 +-- .../ReactNativeFeatureFlagsDefaults.kt | 4 +-- .../ReactNativeFeatureFlagsLocalAccessor.kt | 13 +------- .../ReactNativeFeatureFlagsProvider.kt | 4 +-- .../react/fabric/FabricMountingManager.cpp | 8 +---- .../JReactNativeFeatureFlagsCxxInterop.cpp | 16 +--------- .../JReactNativeFeatureFlagsCxxInterop.h | 5 +--- .../featureflags/ReactNativeFeatureFlags.cpp | 6 +--- .../featureflags/ReactNativeFeatureFlags.h | 7 +---- .../ReactNativeFeatureFlagsAccessor.cpp | 30 ++++--------------- .../ReactNativeFeatureFlagsAccessor.h | 6 ++-- .../ReactNativeFeatureFlagsDefaults.h | 6 +--- .../ReactNativeFeatureFlagsDynamicProvider.h | 11 +------ .../ReactNativeFeatureFlagsProvider.h | 3 +- .../NativeReactNativeFeatureFlags.cpp | 7 +---- .../NativeReactNativeFeatureFlags.h | 4 +-- .../ReactNativeFeatureFlags.config.js | 10 ------- .../featureflags/ReactNativeFeatureFlags.js | 7 +---- .../specs/NativeReactNativeFeatureFlags.js | 3 +- 22 files changed, 27 insertions(+), 149 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java index 7c448904b12..84fd7a848c7 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java @@ -1374,7 +1374,7 @@ public class FabricUIManager mBinding.driveCxxAnimations(); } - if (ReactNativeFeatureFlags.useOptimisedViewPreallocationOnAndroid() && mBinding != null) { + if (mBinding != null) { mBinding.drainPreallocateViewsQueue(); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt index c852bd59b77..8f2c4884955 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<841c26f98395a48dad2ff748dd009f07>> + * @generated SignedSource<<69be45d967e3883a960c49d760fc2ca1>> */ /** @@ -244,12 +244,6 @@ public object ReactNativeFeatureFlags { @JvmStatic public fun useNativeViewConfigsInBridgelessMode(): Boolean = accessor.useNativeViewConfigsInBridgelessMode() - /** - * Moves more of the work in view preallocation to the main thread to free up JS thread. - */ - @JvmStatic - public fun useOptimisedViewPreallocationOnAndroid(): Boolean = accessor.useOptimisedViewPreallocationOnAndroid() - /** * Uses an optimized mechanism for event batching on Android that does not need to wait for a Choreographer frame callback. */ diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt index 6cdff72bbf4..1f06b7c3a1c 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<735455b25aae2fa07a5e36e478b78f0f>> + * @generated SignedSource<> */ /** @@ -56,7 +56,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces private var useEditTextStockAndroidFocusBehaviorCache: Boolean? = null private var useFabricInteropCache: Boolean? = null private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null - private var useOptimisedViewPreallocationOnAndroidCache: Boolean? = null private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null private var useRawPropsJsiValueCache: Boolean? = null private var useRuntimeShadowNodeReferenceUpdateCache: Boolean? = null @@ -387,15 +386,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces return cached } - override fun useOptimisedViewPreallocationOnAndroid(): Boolean { - var cached = useOptimisedViewPreallocationOnAndroidCache - if (cached == null) { - cached = ReactNativeFeatureFlagsCxxInterop.useOptimisedViewPreallocationOnAndroid() - useOptimisedViewPreallocationOnAndroidCache = cached - } - return cached - } - override fun useOptimizedEventBatchingOnAndroid(): Boolean { var cached = useOptimizedEventBatchingOnAndroidCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt index e269781d022..18fe23d0ccb 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6390e3da6c736f01254531394b566e39>> + * @generated SignedSource<> */ /** @@ -100,8 +100,6 @@ public object ReactNativeFeatureFlagsCxxInterop { @DoNotStrip @JvmStatic public external fun useNativeViewConfigsInBridgelessMode(): Boolean - @DoNotStrip @JvmStatic public external fun useOptimisedViewPreallocationOnAndroid(): Boolean - @DoNotStrip @JvmStatic public external fun useOptimizedEventBatchingOnAndroid(): Boolean @DoNotStrip @JvmStatic public external fun useRawPropsJsiValue(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt index 3fe85b3b1d9..ac9a8c7ffd4 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<588a6c3434cdf6ccb470cd8bb914fae0>> + * @generated SignedSource<<71ea4cd62cc16ed718fdc764ec97d0e8>> */ /** @@ -95,8 +95,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi override fun useNativeViewConfigsInBridgelessMode(): Boolean = false - override fun useOptimisedViewPreallocationOnAndroid(): Boolean = false - override fun useOptimizedEventBatchingOnAndroid(): Boolean = false override fun useRawPropsJsiValue(): Boolean = false diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt index a9e326fa037..8e48d4ccf37 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5d69e428af96cdbb839db2d22920c7fc>> + * @generated SignedSource<<2896efd81aed8e0100d61e739cb2ba04>> */ /** @@ -60,7 +60,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc private var useEditTextStockAndroidFocusBehaviorCache: Boolean? = null private var useFabricInteropCache: Boolean? = null private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null - private var useOptimisedViewPreallocationOnAndroidCache: Boolean? = null private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null private var useRawPropsJsiValueCache: Boolean? = null private var useRuntimeShadowNodeReferenceUpdateCache: Boolean? = null @@ -427,16 +426,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc return cached } - override fun useOptimisedViewPreallocationOnAndroid(): Boolean { - var cached = useOptimisedViewPreallocationOnAndroidCache - if (cached == null) { - cached = currentProvider.useOptimisedViewPreallocationOnAndroid() - accessedFeatureFlags.add("useOptimisedViewPreallocationOnAndroid") - useOptimisedViewPreallocationOnAndroidCache = cached - } - return cached - } - override fun useOptimizedEventBatchingOnAndroid(): Boolean { var cached = useOptimizedEventBatchingOnAndroidCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt index 65100a8c3ca..bb02af4a743 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6ec0906be44bb10e8b87bce7d70fdce2>> + * @generated SignedSource<<8f051d9cd1918cdf584de4d469f40ae9>> */ /** @@ -95,8 +95,6 @@ public interface ReactNativeFeatureFlagsProvider { @DoNotStrip public fun useNativeViewConfigsInBridgelessMode(): Boolean - @DoNotStrip public fun useOptimisedViewPreallocationOnAndroid(): Boolean - @DoNotStrip public fun useOptimizedEventBatchingOnAndroid(): Boolean @DoNotStrip public fun useRawPropsJsiValue(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp index d1ab3043e7d..5cdf7a4107a 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp @@ -925,15 +925,9 @@ void FabricMountingManager::maybePreallocateShadowNode( auto shadowView = ShadowView(shadowNode); - if (ReactNativeFeatureFlags::useOptimisedViewPreallocationOnAndroid()) { - // Optimised implementation where FabricUIManager.preallocateView is called - // from the main thread. + { std::lock_guard lock(preallocateMutex_); preallocatedViewsQueue_.push_back(std::move(shadowView)); - } else { - // Old implementation where FabricUIManager.preallocateView is called - // immediately. - preallocateShadowView(shadowView); } } diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp index 7c6e6033f07..ace19660f21 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0252081684dcdb8295018b34980fcac2>> + * @generated SignedSource<> */ /** @@ -255,12 +255,6 @@ class ReactNativeFeatureFlagsProviderHolder return method(javaProvider_); } - bool useOptimisedViewPreallocationOnAndroid() override { - static const auto method = - getReactNativeFeatureFlagsProviderJavaClass()->getMethod("useOptimisedViewPreallocationOnAndroid"); - return method(javaProvider_); - } - bool useOptimizedEventBatchingOnAndroid() override { static const auto method = getReactNativeFeatureFlagsProviderJavaClass()->getMethod("useOptimizedEventBatchingOnAndroid"); @@ -475,11 +469,6 @@ bool JReactNativeFeatureFlagsCxxInterop::useNativeViewConfigsInBridgelessMode( return ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode(); } -bool JReactNativeFeatureFlagsCxxInterop::useOptimisedViewPreallocationOnAndroid( - facebook::jni::alias_ref /*unused*/) { - return ReactNativeFeatureFlags::useOptimisedViewPreallocationOnAndroid(); -} - bool JReactNativeFeatureFlagsCxxInterop::useOptimizedEventBatchingOnAndroid( facebook::jni::alias_ref /*unused*/) { return ReactNativeFeatureFlags::useOptimizedEventBatchingOnAndroid(); @@ -644,9 +633,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() { makeNativeMethod( "useNativeViewConfigsInBridgelessMode", JReactNativeFeatureFlagsCxxInterop::useNativeViewConfigsInBridgelessMode), - makeNativeMethod( - "useOptimisedViewPreallocationOnAndroid", - JReactNativeFeatureFlagsCxxInterop::useOptimisedViewPreallocationOnAndroid), makeNativeMethod( "useOptimizedEventBatchingOnAndroid", JReactNativeFeatureFlagsCxxInterop::useOptimizedEventBatchingOnAndroid), diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h index d22897659aa..a29fac01804 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<94c5db58f8b59d4ccc16e4983d3c6f2e>> */ /** @@ -138,9 +138,6 @@ class JReactNativeFeatureFlagsCxxInterop static bool useNativeViewConfigsInBridgelessMode( facebook::jni::alias_ref); - static bool useOptimisedViewPreallocationOnAndroid( - facebook::jni::alias_ref); - static bool useOptimizedEventBatchingOnAndroid( facebook::jni::alias_ref); diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp index fe54d93834e..8b7211a0c18 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<097c771aa1ff769709f7d08a75da50b6>> + * @generated SignedSource<<1eb35511f4c5fd393c234c026709eb11>> */ /** @@ -170,10 +170,6 @@ bool ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode() { return getAccessor().useNativeViewConfigsInBridgelessMode(); } -bool ReactNativeFeatureFlags::useOptimisedViewPreallocationOnAndroid() { - return getAccessor().useOptimisedViewPreallocationOnAndroid(); -} - bool ReactNativeFeatureFlags::useOptimizedEventBatchingOnAndroid() { return getAccessor().useOptimizedEventBatchingOnAndroid(); } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h index 1f4ec54468d..2db4f4eb08f 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<25afc05f79ba873b70a39019ca245c39>> + * @generated SignedSource<<88118789d97156c16a7ab691ca181d00>> */ /** @@ -219,11 +219,6 @@ class ReactNativeFeatureFlags { */ RN_EXPORT static bool useNativeViewConfigsInBridgelessMode(); - /** - * Moves more of the work in view preallocation to the main thread to free up JS thread. - */ - RN_EXPORT static bool useOptimisedViewPreallocationOnAndroid(); - /** * Uses an optimized mechanism for event batching on Android that does not need to wait for a Choreographer frame callback. */ diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp index 527027131d2..a66e85dd2bd 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> */ /** @@ -677,24 +677,6 @@ bool ReactNativeFeatureFlagsAccessor::useNativeViewConfigsInBridgelessMode() { return flagValue.value(); } -bool ReactNativeFeatureFlagsAccessor::useOptimisedViewPreallocationOnAndroid() { - auto flagValue = useOptimisedViewPreallocationOnAndroid_.load(); - - if (!flagValue.has_value()) { - // This block is not exclusive but it is not necessary. - // If multiple threads try to initialize the feature flag, we would only - // be accessing the provider multiple times but the end state of this - // instance and the returned flag value would be the same. - - markFlagAsAccessed(36, "useOptimisedViewPreallocationOnAndroid"); - - flagValue = currentProvider_->useOptimisedViewPreallocationOnAndroid(); - useOptimisedViewPreallocationOnAndroid_ = flagValue; - } - - return flagValue.value(); -} - bool ReactNativeFeatureFlagsAccessor::useOptimizedEventBatchingOnAndroid() { auto flagValue = useOptimizedEventBatchingOnAndroid_.load(); @@ -704,7 +686,7 @@ bool ReactNativeFeatureFlagsAccessor::useOptimizedEventBatchingOnAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(37, "useOptimizedEventBatchingOnAndroid"); + markFlagAsAccessed(36, "useOptimizedEventBatchingOnAndroid"); flagValue = currentProvider_->useOptimizedEventBatchingOnAndroid(); useOptimizedEventBatchingOnAndroid_ = flagValue; @@ -722,7 +704,7 @@ bool ReactNativeFeatureFlagsAccessor::useRawPropsJsiValue() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(38, "useRawPropsJsiValue"); + markFlagAsAccessed(37, "useRawPropsJsiValue"); flagValue = currentProvider_->useRawPropsJsiValue(); useRawPropsJsiValue_ = flagValue; @@ -740,7 +722,7 @@ bool ReactNativeFeatureFlagsAccessor::useRuntimeShadowNodeReferenceUpdate() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(39, "useRuntimeShadowNodeReferenceUpdate"); + markFlagAsAccessed(38, "useRuntimeShadowNodeReferenceUpdate"); flagValue = currentProvider_->useRuntimeShadowNodeReferenceUpdate(); useRuntimeShadowNodeReferenceUpdate_ = flagValue; @@ -758,7 +740,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(40, "useTurboModuleInterop"); + markFlagAsAccessed(39, "useTurboModuleInterop"); flagValue = currentProvider_->useTurboModuleInterop(); useTurboModuleInterop_ = flagValue; @@ -776,7 +758,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModules() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(41, "useTurboModules"); + markFlagAsAccessed(40, "useTurboModules"); flagValue = currentProvider_->useTurboModules(); useTurboModules_ = flagValue; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h index 11010af3549..c920a430af6 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<29ce7fa71b300ff721db97d622c29e6a>> */ /** @@ -68,7 +68,6 @@ class ReactNativeFeatureFlagsAccessor { bool useEditTextStockAndroidFocusBehavior(); bool useFabricInterop(); bool useNativeViewConfigsInBridgelessMode(); - bool useOptimisedViewPreallocationOnAndroid(); bool useOptimizedEventBatchingOnAndroid(); bool useRawPropsJsiValue(); bool useRuntimeShadowNodeReferenceUpdate(); @@ -85,7 +84,7 @@ class ReactNativeFeatureFlagsAccessor { std::unique_ptr currentProvider_; bool wasOverridden_; - std::array, 42> accessedFeatureFlags_; + std::array, 41> accessedFeatureFlags_; std::atomic> commonTestFlag_; std::atomic> disableMountItemReorderingAndroid_; @@ -123,7 +122,6 @@ class ReactNativeFeatureFlagsAccessor { std::atomic> useEditTextStockAndroidFocusBehavior_; std::atomic> useFabricInterop_; std::atomic> useNativeViewConfigsInBridgelessMode_; - std::atomic> useOptimisedViewPreallocationOnAndroid_; std::atomic> useOptimizedEventBatchingOnAndroid_; std::atomic> useRawPropsJsiValue_; std::atomic> useRuntimeShadowNodeReferenceUpdate_; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h index 066a06b1741..09fc2d3d8de 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3bf74cbd626df283429e270fe45ff5b4>> + * @generated SignedSource<<3a526f2dc57cf7ace4597660e4b809c4>> */ /** @@ -171,10 +171,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider { return false; } - bool useOptimisedViewPreallocationOnAndroid() override { - return false; - } - bool useOptimizedEventBatchingOnAndroid() override { return false; } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h index 2d76223c77f..167a864dc79 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<94797dc944ce9355aeffc4b1c5825708>> + * @generated SignedSource<> */ /** @@ -369,15 +369,6 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef return ReactNativeFeatureFlagsDefaults::useNativeViewConfigsInBridgelessMode(); } - bool useOptimisedViewPreallocationOnAndroid() override { - auto value = values_["useOptimisedViewPreallocationOnAndroid"]; - if (!value.isNull()) { - return value.getBool(); - } - - return ReactNativeFeatureFlagsDefaults::useOptimisedViewPreallocationOnAndroid(); - } - bool useOptimizedEventBatchingOnAndroid() override { auto value = values_["useOptimizedEventBatchingOnAndroid"]; if (!value.isNull()) { diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h index 82a34fc4685..09bd6a9c3ac 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1b5ec1748790308cce8f5cdf7f3726d5>> + * @generated SignedSource<<89e9d4db655464901795f56f93583be8>> */ /** @@ -61,7 +61,6 @@ class ReactNativeFeatureFlagsProvider { virtual bool useEditTextStockAndroidFocusBehavior() = 0; virtual bool useFabricInterop() = 0; virtual bool useNativeViewConfigsInBridgelessMode() = 0; - virtual bool useOptimisedViewPreallocationOnAndroid() = 0; virtual bool useOptimizedEventBatchingOnAndroid() = 0; virtual bool useRawPropsJsiValue() = 0; virtual bool useRuntimeShadowNodeReferenceUpdate() = 0; diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp index 735ed4e0035..4bbbba6d751 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<6b314d87b09e65d8c70a0d3f4caf953a>> */ /** @@ -231,11 +231,6 @@ bool NativeReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode( return ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode(); } -bool NativeReactNativeFeatureFlags::useOptimisedViewPreallocationOnAndroid( - jsi::Runtime& /*runtime*/) { - return ReactNativeFeatureFlags::useOptimisedViewPreallocationOnAndroid(); -} - bool NativeReactNativeFeatureFlags::useOptimizedEventBatchingOnAndroid( jsi::Runtime& /*runtime*/) { return ReactNativeFeatureFlags::useOptimizedEventBatchingOnAndroid(); diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h index d0087ebe5f6..7b6eca3462a 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<3b3ce0cfc8578f517393b89dc76a9aac>> */ /** @@ -111,8 +111,6 @@ class NativeReactNativeFeatureFlags bool useNativeViewConfigsInBridgelessMode(jsi::Runtime& runtime); - bool useOptimisedViewPreallocationOnAndroid(jsi::Runtime& runtime); - bool useOptimizedEventBatchingOnAndroid(jsi::Runtime& runtime); bool useRawPropsJsiValue(jsi::Runtime& runtime); diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index 845e337e1bc..f3d64186f01 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -399,16 +399,6 @@ const definitions: FeatureFlagDefinitions = { purpose: 'experimentation', }, }, - useOptimisedViewPreallocationOnAndroid: { - defaultValue: false, - metadata: { - dateAdded: '2024-07-23', - description: - 'Moves more of the work in view preallocation to the main thread to free up JS thread.', - expectedReleaseValue: true, - purpose: 'experimentation', - }, - }, useOptimizedEventBatchingOnAndroid: { defaultValue: false, metadata: { diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index e24f8a036d1..b55d889d214 100644 --- a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7a6083ca926d6cdef5a840b1feff4913>> + * @generated SignedSource<> * @flow strict */ @@ -84,7 +84,6 @@ export type ReactNativeFeatureFlags = $ReadOnly<{ useEditTextStockAndroidFocusBehavior: Getter, useFabricInterop: Getter, useNativeViewConfigsInBridgelessMode: Getter, - useOptimisedViewPreallocationOnAndroid: Getter, useOptimizedEventBatchingOnAndroid: Getter, useRawPropsJsiValue: Getter, useRuntimeShadowNodeReferenceUpdate: Getter, @@ -309,10 +308,6 @@ export const useFabricInterop: Getter = createNativeFlagGetter('useFabr * When enabled, the native view configs are used in bridgeless mode. */ export const useNativeViewConfigsInBridgelessMode: Getter = createNativeFlagGetter('useNativeViewConfigsInBridgelessMode', false); -/** - * Moves more of the work in view preallocation to the main thread to free up JS thread. - */ -export const useOptimisedViewPreallocationOnAndroid: Getter = createNativeFlagGetter('useOptimisedViewPreallocationOnAndroid', false); /** * Uses an optimized mechanism for event batching on Android that does not need to wait for a Choreographer frame callback. */ diff --git a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js index 503e051a76d..eb63439b22d 100644 --- a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<506909b1ceaa8b29b0649014d1f24894>> + * @generated SignedSource<> * @flow strict */ @@ -61,7 +61,6 @@ export interface Spec extends TurboModule { +useEditTextStockAndroidFocusBehavior?: () => boolean; +useFabricInterop?: () => boolean; +useNativeViewConfigsInBridgelessMode?: () => boolean; - +useOptimisedViewPreallocationOnAndroid?: () => boolean; +useOptimizedEventBatchingOnAndroid?: () => boolean; +useRawPropsJsiValue?: () => boolean; +useRuntimeShadowNodeReferenceUpdate?: () => boolean;