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 1a1a82236c03..81852d502dd4 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<<3fee7079eaa30dca86e3cb366cdd261e>> + * @generated SignedSource<<132ff30c4a5ecf6b38dd0d6cc47d3abc>> */ /** @@ -474,6 +474,12 @@ public object ReactNativeFeatureFlags { @JvmStatic public fun useSharedAnimatedBackend(): Boolean = accessor.useSharedAnimatedBackend() + /** + * Use Trait::hidden on Android + */ + @JvmStatic + public fun useTraitHiddenOnAndroid(): Boolean = accessor.useTraitHiddenOnAndroid() + /** * In Bridgeless mode, should legacy NativeModules use the TurboModule system? */ 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 9768edac38eb..69780c1932b5 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<<7ea729886da71d6d117442c83736fc5f>> + * @generated SignedSource<<38838d89c61124afce1f13045593aeb4>> */ /** @@ -94,6 +94,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces private var useRawPropsJsiValueCache: Boolean? = null private var useShadowNodeStateOnCloneCache: Boolean? = null private var useSharedAnimatedBackendCache: Boolean? = null + private var useTraitHiddenOnAndroidCache: Boolean? = null private var useTurboModuleInteropCache: Boolean? = null private var useTurboModulesCache: Boolean? = null private var viewCullingOutsetRatioCache: Double? = null @@ -766,6 +767,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces return cached } + override fun useTraitHiddenOnAndroid(): Boolean { + var cached = useTraitHiddenOnAndroidCache + if (cached == null) { + cached = ReactNativeFeatureFlagsCxxInterop.useTraitHiddenOnAndroid() + useTraitHiddenOnAndroidCache = cached + } + return cached + } + override fun useTurboModuleInterop(): Boolean { var cached = useTurboModuleInteropCache 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 062e2f38e45e..715c857c064f 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<> + * @generated SignedSource<> */ /** @@ -176,6 +176,8 @@ public object ReactNativeFeatureFlagsCxxInterop { @DoNotStrip @JvmStatic public external fun useSharedAnimatedBackend(): Boolean + @DoNotStrip @JvmStatic public external fun useTraitHiddenOnAndroid(): Boolean + @DoNotStrip @JvmStatic public external fun useTurboModuleInterop(): Boolean @DoNotStrip @JvmStatic public external fun useTurboModules(): 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 70f70c4dfc5b..ad3f72f5451e 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<> */ /** @@ -171,6 +171,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi override fun useSharedAnimatedBackend(): Boolean = false + override fun useTraitHiddenOnAndroid(): Boolean = false + override fun useTurboModuleInterop(): Boolean = false override fun useTurboModules(): 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 8ddd2243f84b..a40d37694d0d 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<<226b5967122a840a4b6ac3fa41d3fb90>> + * @generated SignedSource<<2fa1e7cd2e1d4009dfa09a5fd27a872a>> */ /** @@ -98,6 +98,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc private var useRawPropsJsiValueCache: Boolean? = null private var useShadowNodeStateOnCloneCache: Boolean? = null private var useSharedAnimatedBackendCache: Boolean? = null + private var useTraitHiddenOnAndroidCache: Boolean? = null private var useTurboModuleInteropCache: Boolean? = null private var useTurboModulesCache: Boolean? = null private var viewCullingOutsetRatioCache: Double? = null @@ -844,6 +845,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc return cached } + override fun useTraitHiddenOnAndroid(): Boolean { + var cached = useTraitHiddenOnAndroidCache + if (cached == null) { + cached = currentProvider.useTraitHiddenOnAndroid() + accessedFeatureFlags.add("useTraitHiddenOnAndroid") + useTraitHiddenOnAndroidCache = cached + } + return cached + } + override fun useTurboModuleInterop(): Boolean { var cached = useTurboModuleInteropCache 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 22b4885aeca9..468a619ec5df 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<> + * @generated SignedSource<<901e5678bff081bcb6b8e2d46364b977>> */ /** @@ -171,6 +171,8 @@ public interface ReactNativeFeatureFlagsProvider { @DoNotStrip public fun useSharedAnimatedBackend(): Boolean + @DoNotStrip public fun useTraitHiddenOnAndroid(): Boolean + @DoNotStrip public fun useTurboModuleInterop(): Boolean @DoNotStrip public fun useTurboModules(): 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 e9a691b7a424..65cd08f0044f 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<<285ec8cc3b3e5f55c5c31106b6df8717>> */ /** @@ -483,6 +483,12 @@ class ReactNativeFeatureFlagsJavaProvider return method(javaProvider_); } + bool useTraitHiddenOnAndroid() override { + static const auto method = + getReactNativeFeatureFlagsProviderJavaClass()->getMethod("useTraitHiddenOnAndroid"); + return method(javaProvider_); + } + bool useTurboModuleInterop() override { static const auto method = getReactNativeFeatureFlagsProviderJavaClass()->getMethod("useTurboModuleInterop"); @@ -887,6 +893,11 @@ bool JReactNativeFeatureFlagsCxxInterop::useSharedAnimatedBackend( return ReactNativeFeatureFlags::useSharedAnimatedBackend(); } +bool JReactNativeFeatureFlagsCxxInterop::useTraitHiddenOnAndroid( + facebook::jni::alias_ref /*unused*/) { + return ReactNativeFeatureFlags::useTraitHiddenOnAndroid(); +} + bool JReactNativeFeatureFlagsCxxInterop::useTurboModuleInterop( facebook::jni::alias_ref /*unused*/) { return ReactNativeFeatureFlags::useTurboModuleInterop(); @@ -1165,6 +1176,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() { makeNativeMethod( "useSharedAnimatedBackend", JReactNativeFeatureFlagsCxxInterop::useSharedAnimatedBackend), + makeNativeMethod( + "useTraitHiddenOnAndroid", + JReactNativeFeatureFlagsCxxInterop::useTraitHiddenOnAndroid), makeNativeMethod( "useTurboModuleInterop", JReactNativeFeatureFlagsCxxInterop::useTurboModuleInterop), 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 92c459282cca..32a967b440b7 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<<34ad93365b68934d051b0de522a36014>> */ /** @@ -252,6 +252,9 @@ class JReactNativeFeatureFlagsCxxInterop static bool useSharedAnimatedBackend( facebook::jni::alias_ref); + static bool useTraitHiddenOnAndroid( + facebook::jni::alias_ref); + static bool useTurboModuleInterop( 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 484d5c5931ee..eed12781ff94 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<<68811ae2e7fcb8b8b406097839f669dd>> + * @generated SignedSource<<5fe8801a343267a840956183ca93c757>> */ /** @@ -322,6 +322,10 @@ bool ReactNativeFeatureFlags::useSharedAnimatedBackend() { return getAccessor().useSharedAnimatedBackend(); } +bool ReactNativeFeatureFlags::useTraitHiddenOnAndroid() { + return getAccessor().useTraitHiddenOnAndroid(); +} + bool ReactNativeFeatureFlags::useTurboModuleInterop() { return getAccessor().useTurboModuleInterop(); } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h index 72303e02e7ba..b6b174c8e26d 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<<93fb26b6c04daf8d35aec7bca867fa70>> + * @generated SignedSource<<67cb9ad627e865b24b380be1ef6e0db7>> */ /** @@ -409,6 +409,11 @@ class ReactNativeFeatureFlags { */ RN_EXPORT static bool useSharedAnimatedBackend(); + /** + * Use Trait::hidden on Android + */ + RN_EXPORT static bool useTraitHiddenOnAndroid(); + /** * In Bridgeless mode, should legacy NativeModules use the TurboModule system? */ diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp index 731b32e946b1..5d7d8a5b3c2b 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<> */ /** @@ -1361,6 +1361,24 @@ bool ReactNativeFeatureFlagsAccessor::useSharedAnimatedBackend() { return flagValue.value(); } +bool ReactNativeFeatureFlagsAccessor::useTraitHiddenOnAndroid() { + auto flagValue = useTraitHiddenOnAndroid_.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(74, "useTraitHiddenOnAndroid"); + + flagValue = currentProvider_->useTraitHiddenOnAndroid(); + useTraitHiddenOnAndroid_ = flagValue; + } + + return flagValue.value(); +} + bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() { auto flagValue = useTurboModuleInterop_.load(); @@ -1370,7 +1388,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(74, "useTurboModuleInterop"); + markFlagAsAccessed(75, "useTurboModuleInterop"); flagValue = currentProvider_->useTurboModuleInterop(); useTurboModuleInterop_ = flagValue; @@ -1388,7 +1406,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(75, "useTurboModules"); + markFlagAsAccessed(76, "useTurboModules"); flagValue = currentProvider_->useTurboModules(); useTurboModules_ = flagValue; @@ -1406,7 +1424,7 @@ double ReactNativeFeatureFlagsAccessor::viewCullingOutsetRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(76, "viewCullingOutsetRatio"); + markFlagAsAccessed(77, "viewCullingOutsetRatio"); flagValue = currentProvider_->viewCullingOutsetRatio(); viewCullingOutsetRatio_ = flagValue; @@ -1424,7 +1442,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewHysteresisRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(77, "virtualViewHysteresisRatio"); + markFlagAsAccessed(78, "virtualViewHysteresisRatio"); flagValue = currentProvider_->virtualViewHysteresisRatio(); virtualViewHysteresisRatio_ = flagValue; @@ -1442,7 +1460,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewPrerenderRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(78, "virtualViewPrerenderRatio"); + markFlagAsAccessed(79, "virtualViewPrerenderRatio"); flagValue = currentProvider_->virtualViewPrerenderRatio(); virtualViewPrerenderRatio_ = flagValue; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h index fb07123384ab..0a555b5b3263 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<<1c59c66275538ea4cd0bc47f1e038924>> */ /** @@ -106,6 +106,7 @@ class ReactNativeFeatureFlagsAccessor { bool useRawPropsJsiValue(); bool useShadowNodeStateOnClone(); bool useSharedAnimatedBackend(); + bool useTraitHiddenOnAndroid(); bool useTurboModuleInterop(); bool useTurboModules(); double viewCullingOutsetRatio(); @@ -122,7 +123,7 @@ class ReactNativeFeatureFlagsAccessor { std::unique_ptr currentProvider_; bool wasOverridden_; - std::array, 79> accessedFeatureFlags_; + std::array, 80> accessedFeatureFlags_; std::atomic> commonTestFlag_; std::atomic> cdpInteractionMetricsEnabled_; @@ -198,6 +199,7 @@ class ReactNativeFeatureFlagsAccessor { std::atomic> useRawPropsJsiValue_; std::atomic> useShadowNodeStateOnClone_; std::atomic> useSharedAnimatedBackend_; + std::atomic> useTraitHiddenOnAndroid_; std::atomic> useTurboModuleInterop_; std::atomic> useTurboModules_; std::atomic> viewCullingOutsetRatio_; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h index 943253db83fe..b463244c948d 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<<3ddb240bc600ff3cfa0cfe5896c59b23>> + * @generated SignedSource<<5c430e6e6ac1a7272eae8f89f4052193>> */ /** @@ -323,6 +323,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider { return false; } + bool useTraitHiddenOnAndroid() override { + return false; + } + bool useTurboModuleInterop() override { return false; } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h index 91691c6778dc..ef67b0b2c806 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<<4201556d98b0bb67b6a982502e50591d>> + * @generated SignedSource<<52167b9f49cce6af156a38967019baff>> */ /** @@ -711,6 +711,15 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef return ReactNativeFeatureFlagsDefaults::useSharedAnimatedBackend(); } + bool useTraitHiddenOnAndroid() override { + auto value = values_["useTraitHiddenOnAndroid"]; + if (!value.isNull()) { + return value.getBool(); + } + + return ReactNativeFeatureFlagsDefaults::useTraitHiddenOnAndroid(); + } + bool useTurboModuleInterop() override { auto value = values_["useTurboModuleInterop"]; if (!value.isNull()) { diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h index 05aa88b96953..b31827888223 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<<26ec8e488a5366a6069efe717e3d29a0>> + * @generated SignedSource<> */ /** @@ -99,6 +99,7 @@ class ReactNativeFeatureFlagsProvider { virtual bool useRawPropsJsiValue() = 0; virtual bool useShadowNodeStateOnClone() = 0; virtual bool useSharedAnimatedBackend() = 0; + virtual bool useTraitHiddenOnAndroid() = 0; virtual bool useTurboModuleInterop() = 0; virtual bool useTurboModules() = 0; virtual double viewCullingOutsetRatio() = 0; diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp index 2aeb008b0436..9d4cb62f058a 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<<8d6ba2c295ca32ced7acd3a0679a3cab>> */ /** @@ -414,6 +414,11 @@ bool NativeReactNativeFeatureFlags::useSharedAnimatedBackend( return ReactNativeFeatureFlags::useSharedAnimatedBackend(); } +bool NativeReactNativeFeatureFlags::useTraitHiddenOnAndroid( + jsi::Runtime& /*runtime*/) { + return ReactNativeFeatureFlags::useTraitHiddenOnAndroid(); +} + bool NativeReactNativeFeatureFlags::useTurboModuleInterop( jsi::Runtime& /*runtime*/) { return ReactNativeFeatureFlags::useTurboModuleInterop(); diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h index bdf9bc2eb4c5..16d470427e0b 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<<71a5b931e802e2fd1dc345849147cbe1>> + * @generated SignedSource<<1c0cdfdfd5d77e602e4b44bb13e7be4b>> */ /** @@ -184,6 +184,8 @@ class NativeReactNativeFeatureFlags bool useSharedAnimatedBackend(jsi::Runtime& runtime); + bool useTraitHiddenOnAndroid(jsi::Runtime& runtime); + bool useTurboModuleInterop(jsi::Runtime& runtime); bool useTurboModules(jsi::Runtime& runtime); diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/internal/sliceChildShadowNodeViewPairs.cpp b/packages/react-native/ReactCommon/react/renderer/mounting/internal/sliceChildShadowNodeViewPairs.cpp index dd68d57d47d1..644d4e4d88a4 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/internal/sliceChildShadowNodeViewPairs.cpp +++ b/packages/react-native/ReactCommon/react/renderer/mounting/internal/sliceChildShadowNodeViewPairs.cpp @@ -56,13 +56,15 @@ static void sliceChildShadowNodeViewPairsRecursively( const CullingContext& cullingContext) { for (const auto& sharedChildShadowNode : shadowNode.getChildren()) { auto& childShadowNode = *sharedChildShadowNode; -#ifndef ANDROID // T153547836: Disabled on Android because the mounting infrastructure // is not fully ready yet. - if (childShadowNode.getTraits().check(ShadowNodeTraits::Trait::Hidden)) { + if ( +#ifdef ANDROID + ReactNativeFeatureFlags::useTraitHiddenOnAndroid() && +#endif + childShadowNode.getTraits().check(ShadowNodeTraits::Trait::Hidden)) { continue; } -#endif auto shadowView = ShadowView(childShadowNode); if (ReactNativeFeatureFlags::enableViewCulling()) { diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index 059c165f044d..f2b8083a880f 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -835,6 +835,16 @@ const definitions: FeatureFlagDefinitions = { }, ossReleaseStage: 'none', }, + useTraitHiddenOnAndroid: { + defaultValue: false, + metadata: { + dateAdded: '2025-10-9', + description: 'Use Trait::hidden on Android', + expectedReleaseValue: true, + purpose: 'experimentation', + }, + ossReleaseStage: 'none', + }, useTurboModuleInterop: { defaultValue: false, metadata: { diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index c4ee25633da2..8961f79ea247 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<<42fe3f524ad5d1e8a565ada8f9eebd24>> * @flow strict * @noformat */ @@ -124,6 +124,7 @@ export type ReactNativeFeatureFlags = $ReadOnly<{ useRawPropsJsiValue: Getter, useShadowNodeStateOnClone: Getter, useSharedAnimatedBackend: Getter, + useTraitHiddenOnAndroid: Getter, useTurboModuleInterop: Getter, useTurboModules: Getter, viewCullingOutsetRatio: Getter, @@ -506,6 +507,10 @@ export const useShadowNodeStateOnClone: Getter = createNativeFlagGetter * Use shared animation backend in C++ Animated */ export const useSharedAnimatedBackend: Getter = createNativeFlagGetter('useSharedAnimatedBackend', false); +/** + * Use Trait::hidden on Android + */ +export const useTraitHiddenOnAndroid: Getter = createNativeFlagGetter('useTraitHiddenOnAndroid', false); /** * In Bridgeless mode, should legacy NativeModules use the TurboModule system? */ diff --git a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js index bfd283654b81..115f2d00d058 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<<6a8ce216b333e02f58b43673db8bd0bb>> + * @generated SignedSource<<5a4824857285ef91a4e2f4aeb589cc5d>> * @flow strict * @noformat */ @@ -99,6 +99,7 @@ export interface Spec extends TurboModule { +useRawPropsJsiValue?: () => boolean; +useShadowNodeStateOnClone?: () => boolean; +useSharedAnimatedBackend?: () => boolean; + +useTraitHiddenOnAndroid?: () => boolean; +useTurboModuleInterop?: () => boolean; +useTurboModules?: () => boolean; +viewCullingOutsetRatio?: () => number;