diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java index 5075a22a411c57..617530307d1c81 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java @@ -51,7 +51,6 @@ public class MountItemDispatcher { private final ConcurrentLinkedQueue mPreMountItems = new ConcurrentLinkedQueue<>(); private boolean mInDispatch = false; - private int mReDispatchCounter = 0; private long mBatchedExecutionTime = 0L; private long mRunStartTime = 0L; @@ -119,61 +118,19 @@ public void tryDispatchMountItems() { if (ReactNativeFeatureFlags.forceBatchingMountItemsOnAndroid()) { mInDispatch = true; + } - try { - boolean didDispatchItems = true; - // Dispatch as many mount items as we find. Some mount items might - // trigger state updates that trigger more mount items. This will - // process them correctly. - while (didDispatchItems) { - didDispatchItems = dispatchMountItems(); - } - } finally { - mInDispatch = false; - } - - // We call didDispatchMountItems regardless of whether we actually dispatched anything, since - // NativeAnimatedModule relies on this for executing any animations that may have been - // scheduled - mItemDispatchListener.didDispatchMountItems(); - } else { - final boolean didDispatchItems; - try { - didDispatchItems = dispatchMountItems(); - } catch (Throwable e) { - mReDispatchCounter = 0; - throw e; - } finally { - // Clean up after running dispatchMountItems - even if an exception was thrown - mInDispatch = false; - } - - // We call didDispatchMountItems regardless of whether we actually dispatched anything, since - // NativeAnimatedModule relies on this for executing any animations that may have been - // scheduled - mItemDispatchListener.didDispatchMountItems(); - - if (!ReactNativeFeatureFlags.removeNestedCallsToDispatchMountItemsOnAndroid()) { - // Decide if we want to try reentering - if (mReDispatchCounter < 10 && didDispatchItems) { - // Executing twice in a row is normal. Only log after that point. - if (mReDispatchCounter > 2) { - ReactSoftExceptionLogger.logSoftException( - TAG, - new ReactNoCrashSoftException( - "Re-dispatched " - + mReDispatchCounter - + " times. This indicates setState (?) is likely being called too many" - + " times during mounting.")); - } - - mReDispatchCounter++; - tryDispatchMountItems(); - } - } - - mReDispatchCounter = 0; + try { + dispatchMountItems(); + } finally { + // Clean up after running dispatchMountItems - even if an exception was thrown + mInDispatch = false; } + + // We call didDispatchMountItems regardless of whether we actually dispatched anything, since + // NativeAnimatedModule relies on this for executing any animations that may have been + // scheduled + mItemDispatchListener.didDispatchMountItems(); } @UiThread @@ -213,10 +170,8 @@ public void dispatchMountItems(Queue mountItems) { */ @UiThread @ThreadConfined(UI) - private boolean dispatchMountItems() { - if (mReDispatchCounter == 0) { - mBatchedExecutionTime = 0; - } + private void dispatchMountItems() { + mBatchedExecutionTime = 0; mRunStartTime = SystemClock.uptimeMillis(); @@ -225,7 +180,7 @@ private boolean dispatchMountItems() { List mountItemsToDispatch = getAndResetMountItems(); if (mountItemsToDispatch == null && viewCommandMountItemsToDispatch == null) { - return false; + return; } mItemDispatchListener.willMountItems(mountItemsToDispatch); @@ -341,8 +296,6 @@ private boolean dispatchMountItems() { } mItemDispatchListener.didMountItems(mountItemsToDispatch); - - return true; } /* 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 387eff81aa0cba..6da3f111828555 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<> */ /** @@ -250,12 +250,6 @@ public object ReactNativeFeatureFlags { @JvmStatic public fun loadVectorDrawablesOnImages(): Boolean = accessor.loadVectorDrawablesOnImages() - /** - * Removes nested calls to MountItemDispatcher.dispatchMountItems on Android, so we do less work per frame on the UI thread. - */ - @JvmStatic - public fun removeNestedCallsToDispatchMountItemsOnAndroid(): Boolean = accessor.removeNestedCallsToDispatchMountItemsOnAndroid() - /** * Propagate layout direction to Android views. */ 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 a500c4806477a4..682f303c8dcde3 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<> + * @generated SignedSource<> */ /** @@ -57,7 +57,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso private var initEagerTurboModulesOnNativeModulesQueueAndroidCache: Boolean? = null private var lazyAnimationCallbacksCache: Boolean? = null private var loadVectorDrawablesOnImagesCache: Boolean? = null - private var removeNestedCallsToDispatchMountItemsOnAndroidCache: Boolean? = null private var setAndroidLayoutDirectionCache: Boolean? = null private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null private var useFabricInteropCache: Boolean? = null @@ -403,15 +402,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso return cached } - override fun removeNestedCallsToDispatchMountItemsOnAndroid(): Boolean { - var cached = removeNestedCallsToDispatchMountItemsOnAndroidCache - if (cached == null) { - cached = ReactNativeFeatureFlagsCxxInterop.removeNestedCallsToDispatchMountItemsOnAndroid() - removeNestedCallsToDispatchMountItemsOnAndroidCache = cached - } - return cached - } - override fun setAndroidLayoutDirection(): Boolean { var cached = setAndroidLayoutDirectionCache 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 2769fbf29a9b9b..27d4feade5f15f 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<<3cf8639dfd8a92a954a055c3ebdc749c>> + * @generated SignedSource<<2f1e29ca29c3679e5a87be1d0944efd9>> */ /** @@ -102,8 +102,6 @@ public object ReactNativeFeatureFlagsCxxInterop { @DoNotStrip @JvmStatic public external fun loadVectorDrawablesOnImages(): Boolean - @DoNotStrip @JvmStatic public external fun removeNestedCallsToDispatchMountItemsOnAndroid(): Boolean - @DoNotStrip @JvmStatic public external fun setAndroidLayoutDirection(): Boolean @DoNotStrip @JvmStatic public external fun traceTurboModulePromiseRejectionsOnAndroid(): 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 aeb8f9719a3e0c..c30d36d11f67e8 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<<9e0db1a47596fec77c29122620b8f633>> + * @generated SignedSource<> */ /** @@ -97,8 +97,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi override fun loadVectorDrawablesOnImages(): Boolean = false - override fun removeNestedCallsToDispatchMountItemsOnAndroid(): Boolean = false - override fun setAndroidLayoutDirection(): Boolean = true override fun traceTurboModulePromiseRejectionsOnAndroid(): 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 6e5cf4e613a6a8..c573dc34cdee55 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<<91c4268e7e88e2e3c1f3d50d149c0d2b>> + * @generated SignedSource<> */ /** @@ -61,7 +61,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces private var initEagerTurboModulesOnNativeModulesQueueAndroidCache: Boolean? = null private var lazyAnimationCallbacksCache: Boolean? = null private var loadVectorDrawablesOnImagesCache: Boolean? = null - private var removeNestedCallsToDispatchMountItemsOnAndroidCache: Boolean? = null private var setAndroidLayoutDirectionCache: Boolean? = null private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null private var useFabricInteropCache: Boolean? = null @@ -444,16 +443,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces return cached } - override fun removeNestedCallsToDispatchMountItemsOnAndroid(): Boolean { - var cached = removeNestedCallsToDispatchMountItemsOnAndroidCache - if (cached == null) { - cached = currentProvider.removeNestedCallsToDispatchMountItemsOnAndroid() - accessedFeatureFlags.add("removeNestedCallsToDispatchMountItemsOnAndroid") - removeNestedCallsToDispatchMountItemsOnAndroidCache = cached - } - return cached - } - override fun setAndroidLayoutDirection(): Boolean { var cached = setAndroidLayoutDirectionCache 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 c7e379e2761908..2ccc37065ce0f1 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<<193bb7803261004003d9009b44810c2c>> + * @generated SignedSource<<7abedfd47601a9edd4e2982ea1450590>> */ /** @@ -97,8 +97,6 @@ public interface ReactNativeFeatureFlagsProvider { @DoNotStrip public fun loadVectorDrawablesOnImages(): Boolean - @DoNotStrip public fun removeNestedCallsToDispatchMountItemsOnAndroid(): Boolean - @DoNotStrip public fun setAndroidLayoutDirection(): Boolean @DoNotStrip public fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean 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 d0d647091210f3..aad5890f839a2f 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<> + * @generated SignedSource<<9f5e1568b62ca76e5771fade759d42e5>> */ /** @@ -261,12 +261,6 @@ class ReactNativeFeatureFlagsProviderHolder return method(javaProvider_); } - bool removeNestedCallsToDispatchMountItemsOnAndroid() override { - static const auto method = - getReactNativeFeatureFlagsProviderJavaClass()->getMethod("removeNestedCallsToDispatchMountItemsOnAndroid"); - return method(javaProvider_); - } - bool setAndroidLayoutDirection() override { static const auto method = getReactNativeFeatureFlagsProviderJavaClass()->getMethod("setAndroidLayoutDirection"); @@ -522,11 +516,6 @@ bool JReactNativeFeatureFlagsCxxInterop::loadVectorDrawablesOnImages( return ReactNativeFeatureFlags::loadVectorDrawablesOnImages(); } -bool JReactNativeFeatureFlagsCxxInterop::removeNestedCallsToDispatchMountItemsOnAndroid( - facebook::jni::alias_ref /*unused*/) { - return ReactNativeFeatureFlags::removeNestedCallsToDispatchMountItemsOnAndroid(); -} - bool JReactNativeFeatureFlagsCxxInterop::setAndroidLayoutDirection( facebook::jni::alias_ref /*unused*/) { return ReactNativeFeatureFlags::setAndroidLayoutDirection(); @@ -724,9 +713,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() { makeNativeMethod( "loadVectorDrawablesOnImages", JReactNativeFeatureFlagsCxxInterop::loadVectorDrawablesOnImages), - makeNativeMethod( - "removeNestedCallsToDispatchMountItemsOnAndroid", - JReactNativeFeatureFlagsCxxInterop::removeNestedCallsToDispatchMountItemsOnAndroid), makeNativeMethod( "setAndroidLayoutDirection", JReactNativeFeatureFlagsCxxInterop::setAndroidLayoutDirection), 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 df77efd59d7c01..9ac211e782d525 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<<9b325f01aea83bc93db31c9a63bea3f7>> + * @generated SignedSource<<879ef38c2b34bc6cd15d6361abef1548>> */ /** @@ -141,9 +141,6 @@ class JReactNativeFeatureFlagsCxxInterop static bool loadVectorDrawablesOnImages( facebook::jni::alias_ref); - static bool removeNestedCallsToDispatchMountItemsOnAndroid( - facebook::jni::alias_ref); - static bool setAndroidLayoutDirection( 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 582209ed57dfd5..c303c99c0ced38 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<<14957b53f50e3ea943f0e3631475f336>> + * @generated SignedSource<<204e18de128eb47f29ef5383e592e181>> */ /** @@ -174,10 +174,6 @@ bool ReactNativeFeatureFlags::loadVectorDrawablesOnImages() { return getAccessor().loadVectorDrawablesOnImages(); } -bool ReactNativeFeatureFlags::removeNestedCallsToDispatchMountItemsOnAndroid() { - return getAccessor().removeNestedCallsToDispatchMountItemsOnAndroid(); -} - bool ReactNativeFeatureFlags::setAndroidLayoutDirection() { return getAccessor().setAndroidLayoutDirection(); } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h index f93a2ab227085b..877005a73c7bd9 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<> + * @generated SignedSource<<9170ab789417914123e11ecb836aaa9a>> */ /** @@ -224,11 +224,6 @@ class ReactNativeFeatureFlags { */ RN_EXPORT static bool loadVectorDrawablesOnImages(); - /** - * Removes nested calls to MountItemDispatcher.dispatchMountItems on Android, so we do less work per frame on the UI thread. - */ - RN_EXPORT static bool removeNestedCallsToDispatchMountItemsOnAndroid(); - /** * Propagate layout direction to Android views. */ diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp index b90049734e5892..d90b96250a262a 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<> */ /** @@ -695,24 +695,6 @@ bool ReactNativeFeatureFlagsAccessor::loadVectorDrawablesOnImages() { return flagValue.value(); } -bool ReactNativeFeatureFlagsAccessor::removeNestedCallsToDispatchMountItemsOnAndroid() { - auto flagValue = removeNestedCallsToDispatchMountItemsOnAndroid_.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(37, "removeNestedCallsToDispatchMountItemsOnAndroid"); - - flagValue = currentProvider_->removeNestedCallsToDispatchMountItemsOnAndroid(); - removeNestedCallsToDispatchMountItemsOnAndroid_ = flagValue; - } - - return flagValue.value(); -} - bool ReactNativeFeatureFlagsAccessor::setAndroidLayoutDirection() { auto flagValue = setAndroidLayoutDirection_.load(); @@ -722,7 +704,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(38, "setAndroidLayoutDirection"); + markFlagAsAccessed(37, "setAndroidLayoutDirection"); flagValue = currentProvider_->setAndroidLayoutDirection(); setAndroidLayoutDirection_ = flagValue; @@ -740,7 +722,7 @@ bool ReactNativeFeatureFlagsAccessor::traceTurboModulePromiseRejectionsOnAndroid // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(39, "traceTurboModulePromiseRejectionsOnAndroid"); + markFlagAsAccessed(38, "traceTurboModulePromiseRejectionsOnAndroid"); flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid(); traceTurboModulePromiseRejectionsOnAndroid_ = flagValue; @@ -758,7 +740,7 @@ bool ReactNativeFeatureFlagsAccessor::useFabricInterop() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(40, "useFabricInterop"); + markFlagAsAccessed(39, "useFabricInterop"); flagValue = currentProvider_->useFabricInterop(); useFabricInterop_ = flagValue; @@ -776,7 +758,7 @@ bool ReactNativeFeatureFlagsAccessor::useImmediateExecutorInAndroidBridgeless() // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(41, "useImmediateExecutorInAndroidBridgeless"); + markFlagAsAccessed(40, "useImmediateExecutorInAndroidBridgeless"); flagValue = currentProvider_->useImmediateExecutorInAndroidBridgeless(); useImmediateExecutorInAndroidBridgeless_ = flagValue; @@ -794,7 +776,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(42, "useModernRuntimeScheduler"); + markFlagAsAccessed(41, "useModernRuntimeScheduler"); flagValue = currentProvider_->useModernRuntimeScheduler(); useModernRuntimeScheduler_ = flagValue; @@ -812,7 +794,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(43, "useNativeViewConfigsInBridgelessMode"); + markFlagAsAccessed(42, "useNativeViewConfigsInBridgelessMode"); flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode(); useNativeViewConfigsInBridgelessMode_ = flagValue; @@ -830,7 +812,7 @@ bool ReactNativeFeatureFlagsAccessor::useOptimisedViewPreallocationOnAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(44, "useOptimisedViewPreallocationOnAndroid"); + markFlagAsAccessed(43, "useOptimisedViewPreallocationOnAndroid"); flagValue = currentProvider_->useOptimisedViewPreallocationOnAndroid(); useOptimisedViewPreallocationOnAndroid_ = flagValue; @@ -848,7 +830,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(45, "useOptimizedEventBatchingOnAndroid"); + markFlagAsAccessed(44, "useOptimizedEventBatchingOnAndroid"); flagValue = currentProvider_->useOptimizedEventBatchingOnAndroid(); useOptimizedEventBatchingOnAndroid_ = flagValue; @@ -866,7 +848,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(46, "useRuntimeShadowNodeReferenceUpdate"); + markFlagAsAccessed(45, "useRuntimeShadowNodeReferenceUpdate"); flagValue = currentProvider_->useRuntimeShadowNodeReferenceUpdate(); useRuntimeShadowNodeReferenceUpdate_ = flagValue; @@ -884,7 +866,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(47, "useTurboModuleInterop"); + markFlagAsAccessed(46, "useTurboModuleInterop"); flagValue = currentProvider_->useTurboModuleInterop(); useTurboModuleInterop_ = flagValue; @@ -902,7 +884,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(48, "useTurboModules"); + markFlagAsAccessed(47, "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 21b006acb711ce..a91cf698a9291d 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<<0c9cfdad6a33dd4044a5945befb45522>> + * @generated SignedSource<> */ /** @@ -69,7 +69,6 @@ class ReactNativeFeatureFlagsAccessor { bool initEagerTurboModulesOnNativeModulesQueueAndroid(); bool lazyAnimationCallbacks(); bool loadVectorDrawablesOnImages(); - bool removeNestedCallsToDispatchMountItemsOnAndroid(); bool setAndroidLayoutDirection(); bool traceTurboModulePromiseRejectionsOnAndroid(); bool useFabricInterop(); @@ -92,7 +91,7 @@ class ReactNativeFeatureFlagsAccessor { std::unique_ptr currentProvider_; bool wasOverridden_; - std::array, 49> accessedFeatureFlags_; + std::array, 48> accessedFeatureFlags_; std::atomic> commonTestFlag_; std::atomic> allowRecursiveCommitsWithSynchronousMountOnAndroid_; @@ -131,7 +130,6 @@ class ReactNativeFeatureFlagsAccessor { std::atomic> initEagerTurboModulesOnNativeModulesQueueAndroid_; std::atomic> lazyAnimationCallbacks_; std::atomic> loadVectorDrawablesOnImages_; - std::atomic> removeNestedCallsToDispatchMountItemsOnAndroid_; std::atomic> setAndroidLayoutDirection_; std::atomic> traceTurboModulePromiseRejectionsOnAndroid_; std::atomic> useFabricInterop_; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h index e34ca724d92ce5..5155dce2b4383a 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<> + * @generated SignedSource<<079a09e6be3d2154e1cb65d58cfe792f>> */ /** @@ -175,10 +175,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider { return false; } - bool removeNestedCallsToDispatchMountItemsOnAndroid() override { - return false; - } - bool setAndroidLayoutDirection() override { return true; } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h index ada671ac44dd87..1f899448871802 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<<7cc1ba6a89d06d8cabf1271a725e7379>> + * @generated SignedSource<> */ /** @@ -62,7 +62,6 @@ class ReactNativeFeatureFlagsProvider { virtual bool initEagerTurboModulesOnNativeModulesQueueAndroid() = 0; virtual bool lazyAnimationCallbacks() = 0; virtual bool loadVectorDrawablesOnImages() = 0; - virtual bool removeNestedCallsToDispatchMountItemsOnAndroid() = 0; virtual bool setAndroidLayoutDirection() = 0; virtual bool traceTurboModulePromiseRejectionsOnAndroid() = 0; virtual bool useFabricInterop() = 0; diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp index f336f66efdd66c..2e48f9cffabf38 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<<78ccaa6556b191a1e86aee8b74d8939f>> */ /** @@ -222,11 +222,6 @@ bool NativeReactNativeFeatureFlags::loadVectorDrawablesOnImages( return ReactNativeFeatureFlags::loadVectorDrawablesOnImages(); } -bool NativeReactNativeFeatureFlags::removeNestedCallsToDispatchMountItemsOnAndroid( - jsi::Runtime& /*runtime*/) { - return ReactNativeFeatureFlags::removeNestedCallsToDispatchMountItemsOnAndroid(); -} - bool NativeReactNativeFeatureFlags::setAndroidLayoutDirection( jsi::Runtime& /*runtime*/) { return ReactNativeFeatureFlags::setAndroidLayoutDirection(); diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h index f9b05d2421085a..53b51e736772b7 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<<83fc6efe6c6c5c52ffe081b9696919e1>> + * @generated SignedSource<<7abbf20a370e97c2ef0e59bef4f6164a>> */ /** @@ -109,8 +109,6 @@ class NativeReactNativeFeatureFlags bool loadVectorDrawablesOnImages(jsi::Runtime& runtime); - bool removeNestedCallsToDispatchMountItemsOnAndroid(jsi::Runtime& runtime); - bool setAndroidLayoutDirection(jsi::Runtime& runtime); bool traceTurboModulePromiseRejectionsOnAndroid(jsi::Runtime& runtime); diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index a3c9aaca5baea0..c3b8d503dfd929 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -353,15 +353,6 @@ const definitions: FeatureFlagDefinitions = { purpose: 'experimentation', }, }, - removeNestedCallsToDispatchMountItemsOnAndroid: { - defaultValue: false, - metadata: { - dateAdded: '2024-09-19', - description: - 'Removes nested calls to MountItemDispatcher.dispatchMountItems on Android, so we do less work per frame on the UI thread.', - purpose: 'experimentation', - }, - }, setAndroidLayoutDirection: { defaultValue: true, metadata: { diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index ece609b0c705dc..bcd9820e354b84 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<<1ef57002084a2e38a69b43b7d4d557a9>> + * @generated SignedSource<<0d6a473cc1c76dc73fe70eb557b6da60>> * @flow strict */ @@ -87,7 +87,6 @@ export type ReactNativeFeatureFlags = { initEagerTurboModulesOnNativeModulesQueueAndroid: Getter, lazyAnimationCallbacks: Getter, loadVectorDrawablesOnImages: Getter, - removeNestedCallsToDispatchMountItemsOnAndroid: Getter, setAndroidLayoutDirection: Getter, traceTurboModulePromiseRejectionsOnAndroid: Getter, useFabricInterop: Getter, @@ -334,10 +333,6 @@ export const lazyAnimationCallbacks: Getter = createNativeFlagGetter('l * Adds support for loading vector drawable assets in the Image component (only on Android) */ export const loadVectorDrawablesOnImages: Getter = createNativeFlagGetter('loadVectorDrawablesOnImages', false); -/** - * Removes nested calls to MountItemDispatcher.dispatchMountItems on Android, so we do less work per frame on the UI thread. - */ -export const removeNestedCallsToDispatchMountItemsOnAndroid: Getter = createNativeFlagGetter('removeNestedCallsToDispatchMountItemsOnAndroid', false); /** * Propagate layout direction to Android views. */ diff --git a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js index 6e05e33d418938..e2bb20b3ef210a 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<> + * @generated SignedSource<> * @flow strict */ @@ -60,7 +60,6 @@ export interface Spec extends TurboModule { +initEagerTurboModulesOnNativeModulesQueueAndroid?: () => boolean; +lazyAnimationCallbacks?: () => boolean; +loadVectorDrawablesOnImages?: () => boolean; - +removeNestedCallsToDispatchMountItemsOnAndroid?: () => boolean; +setAndroidLayoutDirection?: () => boolean; +traceTurboModulePromiseRejectionsOnAndroid?: () => boolean; +useFabricInterop?: () => boolean;