From 8d575f1300a1c1a5296300b7be7f074afe9cfa06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Tue, 28 May 2024 06:14:58 -0700 Subject: [PATCH] Clean up androidEnablePendingFabricTransactions feature flag Summary: We tested this feature flag at Meta and it's neutral when used outside the event loop. We'll handle its effects on the event loop as part of the event loop experiment itself (when enabling paint blocking). Differential Revision: D57861195 --- .../featureflags/ReactNativeFeatureFlags.kt | 8 +-- .../ReactNativeFeatureFlagsCxxAccessor.kt | 12 +--- .../ReactNativeFeatureFlagsCxxInterop.kt | 4 +- .../ReactNativeFeatureFlagsDefaults.kt | 4 +- .../ReactNativeFeatureFlagsLocalAccessor.kt | 13 +---- .../ReactNativeFeatureFlagsProvider.kt | 4 +- .../src/main/jni/react/fabric/Binding.cpp | 19 ++----- .../JReactNativeFeatureFlagsCxxInterop.cpp | 16 +----- .../JReactNativeFeatureFlagsCxxInterop.h | 5 +- .../featureflags/ReactNativeFeatureFlags.cpp | 6 +- .../featureflags/ReactNativeFeatureFlags.h | 7 +-- .../ReactNativeFeatureFlagsAccessor.cpp | 56 +++++++------------ .../ReactNativeFeatureFlagsAccessor.h | 6 +- .../ReactNativeFeatureFlagsDefaults.h | 6 +- .../ReactNativeFeatureFlagsProvider.h | 3 +- .../NativeReactNativeFeatureFlags.cpp | 7 +-- .../NativeReactNativeFeatureFlags.h | 4 +- .../ReactNativeFeatureFlags.config.js | 5 -- .../featureflags/ReactNativeFeatureFlags.js | 7 +-- .../specs/NativeReactNativeFeatureFlags.js | 3 +- 20 files changed, 41 insertions(+), 154 deletions(-) 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 f105ae82dc16c0..55215a12376339 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<> + * @generated SignedSource<<84f45a19bf93a62da7ce904a2682fc51>> */ /** @@ -40,12 +40,6 @@ public object ReactNativeFeatureFlags { @JvmStatic public fun allowCollapsableChildren(): Boolean = accessor.allowCollapsableChildren() - /** - * To be used with batchRenderingUpdatesInEventLoop. When enbled, the Android mounting layer will concatenate pending transactions to ensure they're applied atomatically - */ - @JvmStatic - public fun androidEnablePendingFabricTransactions(): Boolean = accessor.androidEnablePendingFabricTransactions() - /** * When enabled, the RuntimeScheduler processing the event loop will batch all rendering updates and dispatch them together at the end of each iteration of the loop. */ 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 5c244134ba8fa7..a239ea008eea62 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<<53fb9cc52c068dd294507e060d06d75f>> + * @generated SignedSource<<2f84a5455d747e14324f7b79cbbdc763>> */ /** @@ -22,7 +22,6 @@ package com.facebook.react.internal.featureflags public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccessor { private var commonTestFlagCache: Boolean? = null private var allowCollapsableChildrenCache: Boolean? = null - private var androidEnablePendingFabricTransactionsCache: Boolean? = null private var batchRenderingUpdatesInEventLoopCache: Boolean? = null private var destroyFabricSurfacesInReactInstanceManagerCache: Boolean? = null private var enableBackgroundExecutorCache: Boolean? = null @@ -60,15 +59,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso return cached } - override fun androidEnablePendingFabricTransactions(): Boolean { - var cached = androidEnablePendingFabricTransactionsCache - if (cached == null) { - cached = ReactNativeFeatureFlagsCxxInterop.androidEnablePendingFabricTransactions() - androidEnablePendingFabricTransactionsCache = cached - } - return cached - } - override fun batchRenderingUpdatesInEventLoop(): Boolean { var cached = batchRenderingUpdatesInEventLoopCache 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 6db1ba0b62fc33..baa0a7304e17d4 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<<8df962abc44ac4368591f34862ccf69e>> + * @generated SignedSource<> */ /** @@ -32,8 +32,6 @@ public object ReactNativeFeatureFlagsCxxInterop { @DoNotStrip @JvmStatic public external fun allowCollapsableChildren(): Boolean - @DoNotStrip @JvmStatic public external fun androidEnablePendingFabricTransactions(): Boolean - @DoNotStrip @JvmStatic public external fun batchRenderingUpdatesInEventLoop(): Boolean @DoNotStrip @JvmStatic public external fun destroyFabricSurfacesInReactInstanceManager(): 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 074e3f04b29e54..bc7acde645fac8 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<> + * @generated SignedSource<<1ea3b574063dca0256494361423ce63e>> */ /** @@ -27,8 +27,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi override fun allowCollapsableChildren(): Boolean = true - override fun androidEnablePendingFabricTransactions(): Boolean = false - override fun batchRenderingUpdatesInEventLoop(): Boolean = false override fun destroyFabricSurfacesInReactInstanceManager(): 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 9b69f88000a270..713fa0ce5c58e1 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<<5abf40ebbabb3c0bebead668c1b24ff9>> + * @generated SignedSource<> */ /** @@ -26,7 +26,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces private var commonTestFlagCache: Boolean? = null private var allowCollapsableChildrenCache: Boolean? = null - private var androidEnablePendingFabricTransactionsCache: Boolean? = null private var batchRenderingUpdatesInEventLoopCache: Boolean? = null private var destroyFabricSurfacesInReactInstanceManagerCache: Boolean? = null private var enableBackgroundExecutorCache: Boolean? = null @@ -66,16 +65,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces return cached } - override fun androidEnablePendingFabricTransactions(): Boolean { - var cached = androidEnablePendingFabricTransactionsCache - if (cached == null) { - cached = currentProvider.androidEnablePendingFabricTransactions() - accessedFeatureFlags.add("androidEnablePendingFabricTransactions") - androidEnablePendingFabricTransactionsCache = cached - } - return cached - } - override fun batchRenderingUpdatesInEventLoop(): Boolean { var cached = batchRenderingUpdatesInEventLoopCache 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 52b44f8d1cf9c9..22d5675bf43f76 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<<0f008837f44348e62dba2a65e813d49e>> + * @generated SignedSource<<7a63b1fc14ccc86efb0929452755744d>> */ /** @@ -27,8 +27,6 @@ public interface ReactNativeFeatureFlagsProvider { @DoNotStrip public fun allowCollapsableChildren(): Boolean - @DoNotStrip public fun androidEnablePendingFabricTransactions(): Boolean - @DoNotStrip public fun batchRenderingUpdatesInEventLoop(): Boolean @DoNotStrip public fun destroyFabricSurfacesInReactInstanceManager(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp index da8507fd4d5361..e8aec3fb34a486 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp @@ -458,10 +458,6 @@ std::shared_ptr Binding::getMountingManager( void Binding::schedulerDidFinishTransaction( const MountingCoordinator::Shared& mountingCoordinator) { - if (!ReactNativeFeatureFlags::androidEnablePendingFabricTransactions()) { - return; - } - auto mountingTransaction = mountingCoordinator->pullTransaction(); if (!mountingTransaction.has_value()) { return; @@ -491,18 +487,11 @@ void Binding::schedulerShouldRenderTransactions( return; } - if (ReactNativeFeatureFlags::androidEnablePendingFabricTransactions()) { - std::unique_lock lock(pendingTransactionsMutex_); - for (auto& transaction : pendingTransactions_) { - mountingManager->executeMount(transaction); - } - pendingTransactions_.clear(); - } else { - auto mountingTransaction = mountingCoordinator->pullTransaction(); - if (mountingTransaction.has_value()) { - mountingManager->executeMount(*mountingTransaction); - } + std::unique_lock lock(pendingTransactionsMutex_); + for (auto& transaction : pendingTransactions_) { + mountingManager->executeMount(transaction); } + pendingTransactions_.clear(); } void Binding::schedulerDidRequestPreliminaryViewAllocation( 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 3f85c720cf672f..859b4dfedea0eb 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<<4267f2de5ad71437875b03a26ac80d13>> + * @generated SignedSource<<82d20aa409496b17df21a077088894a6>> */ /** @@ -51,12 +51,6 @@ class ReactNativeFeatureFlagsProviderHolder return method(javaProvider_); } - bool androidEnablePendingFabricTransactions() override { - static const auto method = - getReactNativeFeatureFlagsProviderJavaClass()->getMethod("androidEnablePendingFabricTransactions"); - return method(javaProvider_); - } - bool batchRenderingUpdatesInEventLoop() override { static const auto method = getReactNativeFeatureFlagsProviderJavaClass()->getMethod("batchRenderingUpdatesInEventLoop"); @@ -179,11 +173,6 @@ bool JReactNativeFeatureFlagsCxxInterop::allowCollapsableChildren( return ReactNativeFeatureFlags::allowCollapsableChildren(); } -bool JReactNativeFeatureFlagsCxxInterop::androidEnablePendingFabricTransactions( - facebook::jni::alias_ref /*unused*/) { - return ReactNativeFeatureFlags::androidEnablePendingFabricTransactions(); -} - bool JReactNativeFeatureFlagsCxxInterop::batchRenderingUpdatesInEventLoop( facebook::jni::alias_ref /*unused*/) { return ReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop(); @@ -297,9 +286,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() { makeNativeMethod( "allowCollapsableChildren", JReactNativeFeatureFlagsCxxInterop::allowCollapsableChildren), - makeNativeMethod( - "androidEnablePendingFabricTransactions", - JReactNativeFeatureFlagsCxxInterop::androidEnablePendingFabricTransactions), makeNativeMethod( "batchRenderingUpdatesInEventLoop", JReactNativeFeatureFlagsCxxInterop::batchRenderingUpdatesInEventLoop), 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 7f004183b96f21..108d20254702ba 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<<9d2fdfb02452bcedb14af85488d0b8c7>> + * @generated SignedSource<<08463d4f487df81332c79c8e85b4dac8>> */ /** @@ -36,9 +36,6 @@ class JReactNativeFeatureFlagsCxxInterop static bool allowCollapsableChildren( facebook::jni::alias_ref); - static bool androidEnablePendingFabricTransactions( - facebook::jni::alias_ref); - static bool batchRenderingUpdatesInEventLoop( 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 4a18b8aa484681..36e6f3f4ab3402 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<<44c54555ee69104a69d9e60b13ebccbf>> + * @generated SignedSource<> */ /** @@ -29,10 +29,6 @@ bool ReactNativeFeatureFlags::allowCollapsableChildren() { return getAccessor().allowCollapsableChildren(); } -bool ReactNativeFeatureFlags::androidEnablePendingFabricTransactions() { - return getAccessor().androidEnablePendingFabricTransactions(); -} - bool ReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop() { return getAccessor().batchRenderingUpdatesInEventLoop(); } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h index 795d880c623bfc..536cf1c6870ac4 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<<8fdad69a7bbf55bdf967292958de6f61>> + * @generated SignedSource<<705dba656bfb228227399bcda638c404>> */ /** @@ -47,11 +47,6 @@ class ReactNativeFeatureFlags { */ RN_EXPORT static bool allowCollapsableChildren(); - /** - * To be used with batchRenderingUpdatesInEventLoop. When enbled, the Android mounting layer will concatenate pending transactions to ensure they're applied atomatically - */ - RN_EXPORT static bool androidEnablePendingFabricTransactions(); - /** * When enabled, the RuntimeScheduler processing the event loop will batch all rendering updates and dispatch them together at the end of each iteration of the loop. */ diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp index d2d38da8f9444b..6f629799524b5d 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<<53617e29d537989ca3ac0f314a278e4b>> */ /** @@ -65,24 +65,6 @@ bool ReactNativeFeatureFlagsAccessor::allowCollapsableChildren() { return flagValue.value(); } -bool ReactNativeFeatureFlagsAccessor::androidEnablePendingFabricTransactions() { - auto flagValue = androidEnablePendingFabricTransactions_.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(2, "androidEnablePendingFabricTransactions"); - - flagValue = currentProvider_->androidEnablePendingFabricTransactions(); - androidEnablePendingFabricTransactions_ = flagValue; - } - - return flagValue.value(); -} - bool ReactNativeFeatureFlagsAccessor::batchRenderingUpdatesInEventLoop() { auto flagValue = batchRenderingUpdatesInEventLoop_.load(); @@ -92,7 +74,7 @@ bool ReactNativeFeatureFlagsAccessor::batchRenderingUpdatesInEventLoop() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(3, "batchRenderingUpdatesInEventLoop"); + markFlagAsAccessed(2, "batchRenderingUpdatesInEventLoop"); flagValue = currentProvider_->batchRenderingUpdatesInEventLoop(); batchRenderingUpdatesInEventLoop_ = flagValue; @@ -110,7 +92,7 @@ bool ReactNativeFeatureFlagsAccessor::destroyFabricSurfacesInReactInstanceManage // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(4, "destroyFabricSurfacesInReactInstanceManager"); + markFlagAsAccessed(3, "destroyFabricSurfacesInReactInstanceManager"); flagValue = currentProvider_->destroyFabricSurfacesInReactInstanceManager(); destroyFabricSurfacesInReactInstanceManager_ = flagValue; @@ -128,7 +110,7 @@ bool ReactNativeFeatureFlagsAccessor::enableBackgroundExecutor() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(5, "enableBackgroundExecutor"); + markFlagAsAccessed(4, "enableBackgroundExecutor"); flagValue = currentProvider_->enableBackgroundExecutor(); enableBackgroundExecutor_ = flagValue; @@ -146,7 +128,7 @@ bool ReactNativeFeatureFlagsAccessor::enableCleanTextInputYogaNode() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(6, "enableCleanTextInputYogaNode"); + markFlagAsAccessed(5, "enableCleanTextInputYogaNode"); flagValue = currentProvider_->enableCleanTextInputYogaNode(); enableCleanTextInputYogaNode_ = flagValue; @@ -164,7 +146,7 @@ bool ReactNativeFeatureFlagsAccessor::enableGranularShadowTreeStateReconciliatio // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(7, "enableGranularShadowTreeStateReconciliation"); + markFlagAsAccessed(6, "enableGranularShadowTreeStateReconciliation"); flagValue = currentProvider_->enableGranularShadowTreeStateReconciliation(); enableGranularShadowTreeStateReconciliation_ = flagValue; @@ -182,7 +164,7 @@ bool ReactNativeFeatureFlagsAccessor::enableMicrotasks() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(8, "enableMicrotasks"); + markFlagAsAccessed(7, "enableMicrotasks"); flagValue = currentProvider_->enableMicrotasks(); enableMicrotasks_ = flagValue; @@ -200,7 +182,7 @@ bool ReactNativeFeatureFlagsAccessor::enableSynchronousStateUpdates() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(9, "enableSynchronousStateUpdates"); + markFlagAsAccessed(8, "enableSynchronousStateUpdates"); flagValue = currentProvider_->enableSynchronousStateUpdates(); enableSynchronousStateUpdates_ = flagValue; @@ -218,7 +200,7 @@ bool ReactNativeFeatureFlagsAccessor::enableUIConsistency() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(10, "enableUIConsistency"); + markFlagAsAccessed(9, "enableUIConsistency"); flagValue = currentProvider_->enableUIConsistency(); enableUIConsistency_ = flagValue; @@ -236,7 +218,7 @@ bool ReactNativeFeatureFlagsAccessor::fixStoppedSurfaceRemoveDeleteTreeUIFrameCa // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(11, "fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak"); + markFlagAsAccessed(10, "fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak"); flagValue = currentProvider_->fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak(); fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak_ = flagValue; @@ -254,7 +236,7 @@ bool ReactNativeFeatureFlagsAccessor::forceBatchingMountItemsOnAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(12, "forceBatchingMountItemsOnAndroid"); + markFlagAsAccessed(11, "forceBatchingMountItemsOnAndroid"); flagValue = currentProvider_->forceBatchingMountItemsOnAndroid(); forceBatchingMountItemsOnAndroid_ = flagValue; @@ -272,7 +254,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxEnabledDebug() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(13, "fuseboxEnabledDebug"); + markFlagAsAccessed(12, "fuseboxEnabledDebug"); flagValue = currentProvider_->fuseboxEnabledDebug(); fuseboxEnabledDebug_ = flagValue; @@ -290,7 +272,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxEnabledRelease() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(14, "fuseboxEnabledRelease"); + markFlagAsAccessed(13, "fuseboxEnabledRelease"); flagValue = currentProvider_->fuseboxEnabledRelease(); fuseboxEnabledRelease_ = flagValue; @@ -308,7 +290,7 @@ bool ReactNativeFeatureFlagsAccessor::lazyAnimationCallbacks() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(15, "lazyAnimationCallbacks"); + markFlagAsAccessed(14, "lazyAnimationCallbacks"); flagValue = currentProvider_->lazyAnimationCallbacks(); lazyAnimationCallbacks_ = flagValue; @@ -326,7 +308,7 @@ bool ReactNativeFeatureFlagsAccessor::preventDoubleTextMeasure() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(16, "preventDoubleTextMeasure"); + markFlagAsAccessed(15, "preventDoubleTextMeasure"); flagValue = currentProvider_->preventDoubleTextMeasure(); preventDoubleTextMeasure_ = flagValue; @@ -344,7 +326,7 @@ bool ReactNativeFeatureFlagsAccessor::setAndroidLayoutDirection() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(17, "setAndroidLayoutDirection"); + markFlagAsAccessed(16, "setAndroidLayoutDirection"); flagValue = currentProvider_->setAndroidLayoutDirection(); setAndroidLayoutDirection_ = flagValue; @@ -362,7 +344,7 @@ bool ReactNativeFeatureFlagsAccessor::useModernRuntimeScheduler() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(18, "useModernRuntimeScheduler"); + markFlagAsAccessed(17, "useModernRuntimeScheduler"); flagValue = currentProvider_->useModernRuntimeScheduler(); useModernRuntimeScheduler_ = flagValue; @@ -380,7 +362,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeViewConfigsInBridgelessMode() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(19, "useNativeViewConfigsInBridgelessMode"); + markFlagAsAccessed(18, "useNativeViewConfigsInBridgelessMode"); flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode(); useNativeViewConfigsInBridgelessMode_ = flagValue; @@ -398,7 +380,7 @@ bool ReactNativeFeatureFlagsAccessor::useStateAlignmentMechanism() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(20, "useStateAlignmentMechanism"); + markFlagAsAccessed(19, "useStateAlignmentMechanism"); flagValue = currentProvider_->useStateAlignmentMechanism(); useStateAlignmentMechanism_ = flagValue; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h index 690b040adb4270..737edf512bced9 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<> */ /** @@ -33,7 +33,6 @@ class ReactNativeFeatureFlagsAccessor { bool commonTestFlag(); bool allowCollapsableChildren(); - bool androidEnablePendingFabricTransactions(); bool batchRenderingUpdatesInEventLoop(); bool destroyFabricSurfacesInReactInstanceManager(); bool enableBackgroundExecutor(); @@ -62,11 +61,10 @@ class ReactNativeFeatureFlagsAccessor { std::unique_ptr currentProvider_; bool wasOverridden_; - std::array, 21> accessedFeatureFlags_; + std::array, 20> accessedFeatureFlags_; std::atomic> commonTestFlag_; std::atomic> allowCollapsableChildren_; - std::atomic> androidEnablePendingFabricTransactions_; std::atomic> batchRenderingUpdatesInEventLoop_; std::atomic> destroyFabricSurfacesInReactInstanceManager_; std::atomic> enableBackgroundExecutor_; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h index 8cd4f7dbb51e32..be4a861b46e17d 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<<6535d6d14ba4387ea73d129f064548e0>> + * @generated SignedSource<> */ /** @@ -35,10 +35,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider { return true; } - bool androidEnablePendingFabricTransactions() override { - return false; - } - bool batchRenderingUpdatesInEventLoop() override { return false; } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h index 200470674e4451..2056aee1d4e37c 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<> + * @generated SignedSource<> */ /** @@ -27,7 +27,6 @@ class ReactNativeFeatureFlagsProvider { virtual bool commonTestFlag() = 0; virtual bool allowCollapsableChildren() = 0; - virtual bool androidEnablePendingFabricTransactions() = 0; virtual bool batchRenderingUpdatesInEventLoop() = 0; virtual bool destroyFabricSurfacesInReactInstanceManager() = 0; virtual bool enableBackgroundExecutor() = 0; diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp index b81e089497d49c..dec93c10b9a8ba 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<> */ /** @@ -47,11 +47,6 @@ bool NativeReactNativeFeatureFlags::allowCollapsableChildren( return ReactNativeFeatureFlags::allowCollapsableChildren(); } -bool NativeReactNativeFeatureFlags::androidEnablePendingFabricTransactions( - jsi::Runtime& /*runtime*/) { - return ReactNativeFeatureFlags::androidEnablePendingFabricTransactions(); -} - bool NativeReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop( jsi::Runtime& /*runtime*/) { return ReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop(); diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h index 2a0680470a2452..788007a224b599 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<<38587efd4ed8e4ad7cca2e96eda6632f>> + * @generated SignedSource<> */ /** @@ -39,8 +39,6 @@ class NativeReactNativeFeatureFlags bool allowCollapsableChildren(jsi::Runtime& runtime); - bool androidEnablePendingFabricTransactions(jsi::Runtime& runtime); - bool batchRenderingUpdatesInEventLoop(jsi::Runtime& runtime); bool destroyFabricSurfacesInReactInstanceManager(jsi::Runtime& runtime); diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index 4d1b7881fbf5b2..3ef416eab5d75d 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -44,11 +44,6 @@ const definitions: FeatureFlagDefinitions = { description: 'Enables the differentiator to understand the "collapsableChildren" prop', }, - androidEnablePendingFabricTransactions: { - defaultValue: false, - description: - "To be used with batchRenderingUpdatesInEventLoop. When enbled, the Android mounting layer will concatenate pending transactions to ensure they're applied atomatically", - }, batchRenderingUpdatesInEventLoop: { defaultValue: false, description: diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index d945a4ddc6ecbc..8991cdf4fd3b31 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<> + * @generated SignedSource<<0a8bc71d703e92e1aaba25203e0211b3>> * @flow strict-local */ @@ -42,7 +42,6 @@ export type ReactNativeFeatureFlags = { ...ReactNativeFeatureFlagsJsOnly, commonTestFlag: Getter, allowCollapsableChildren: Getter, - androidEnablePendingFabricTransactions: Getter, batchRenderingUpdatesInEventLoop: Getter, destroyFabricSurfacesInReactInstanceManager: Getter, enableBackgroundExecutor: Getter, @@ -111,10 +110,6 @@ export const commonTestFlag: Getter = createNativeFlagGetter('commonTes * Enables the differentiator to understand the "collapsableChildren" prop */ export const allowCollapsableChildren: Getter = createNativeFlagGetter('allowCollapsableChildren', true); -/** - * To be used with batchRenderingUpdatesInEventLoop. When enbled, the Android mounting layer will concatenate pending transactions to ensure they're applied atomatically - */ -export const androidEnablePendingFabricTransactions: Getter = createNativeFlagGetter('androidEnablePendingFabricTransactions', false); /** * When enabled, the RuntimeScheduler processing the event loop will batch all rendering updates and dispatch them together at the end of each iteration of the loop. */ diff --git a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js index 046b3403864eff..3818226c0daed5 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<<30b0640e8893abd282c4694d7463e90e>> + * @generated SignedSource<<13b6d24c994e1ac758d2a76f759f5363>> * @flow strict-local */ @@ -25,7 +25,6 @@ import * as TurboModuleRegistry from '../../../../Libraries/TurboModule/TurboMod export interface Spec extends TurboModule { +commonTestFlag?: () => boolean; +allowCollapsableChildren?: () => boolean; - +androidEnablePendingFabricTransactions?: () => boolean; +batchRenderingUpdatesInEventLoop?: () => boolean; +destroyFabricSurfacesInReactInstanceManager?: () => boolean; +enableBackgroundExecutor?: () => boolean;