Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<<cd8218c8b8588f3317bf63ce8d608548>>
* @generated SignedSource<<89627a52825452c8f6c0dd3725f61175>>
*/

/**
Expand Down Expand Up @@ -546,6 +546,12 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun useTraitHiddenOnAndroid(): Boolean = accessor.useTraitHiddenOnAndroid()

/**
* Use Trait::hidden slice-skip on iOS. When false, Hidden subtrees stay mounted and hide via UIView.hidden = YES (the path in UIView+ComponentViewProtocol since 2018) instead of REMOVE + DELETE.
*/
@JvmStatic
public fun useTraitHiddenOnIOS(): Boolean = accessor.useTraitHiddenOnIOS()

/**
* In Bridgeless mode, should legacy NativeModules use the TurboModule system?
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<4f9f5c1c46217ed6802abd5f786aac19>>
* @generated SignedSource<<e2704fec486263b5f74ab909f9d2f533>>
*/

/**
Expand Down Expand Up @@ -106,6 +106,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var useNestedScrollViewAndroidCache: Boolean? = null
private var useSharedAnimatedBackendCache: Boolean? = null
private var useTraitHiddenOnAndroidCache: Boolean? = null
private var useTraitHiddenOnIOSCache: Boolean? = null
private var useTurboModuleInteropCache: Boolean? = null
private var useTurboModulesCache: Boolean? = null
private var useUnorderedMapInDifferentiatorCache: Boolean? = null
Expand Down Expand Up @@ -887,6 +888,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}

override fun useTraitHiddenOnIOS(): Boolean {
var cached = useTraitHiddenOnIOSCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.useTraitHiddenOnIOS()
useTraitHiddenOnIOSCache = cached
}
return cached
}

override fun useTurboModuleInterop(): Boolean {
var cached = useTurboModuleInteropCache
if (cached == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<8916e9f4a938a69ff175c806db9835d4>>
* @generated SignedSource<<9a216ce4f720f39e338ba9eb40e3503d>>
*/

/**
Expand Down Expand Up @@ -200,6 +200,8 @@ public object ReactNativeFeatureFlagsCxxInterop {

@DoNotStrip @JvmStatic public external fun useTraitHiddenOnAndroid(): Boolean

@DoNotStrip @JvmStatic public external fun useTraitHiddenOnIOS(): Boolean

@DoNotStrip @JvmStatic public external fun useTurboModuleInterop(): Boolean

@DoNotStrip @JvmStatic public external fun useTurboModules(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<d2b14345bf627e35562530912b3aae1f>>
* @generated SignedSource<<d047393d9b77ab6bdf610f272ec376cd>>
*/

/**
Expand Down Expand Up @@ -195,6 +195,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi

override fun useTraitHiddenOnAndroid(): Boolean = false

override fun useTraitHiddenOnIOS(): Boolean = true

override fun useTurboModuleInterop(): Boolean = false

override fun useTurboModules(): Boolean = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<cbe90c2bf8ba9d34804d97c31edfd31a>>
* @generated SignedSource<<e23bcf89e2a15139f6a1511ebb7d6fc8>>
*/

/**
Expand Down Expand Up @@ -110,6 +110,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var useNestedScrollViewAndroidCache: Boolean? = null
private var useSharedAnimatedBackendCache: Boolean? = null
private var useTraitHiddenOnAndroidCache: Boolean? = null
private var useTraitHiddenOnIOSCache: Boolean? = null
private var useTurboModuleInteropCache: Boolean? = null
private var useTurboModulesCache: Boolean? = null
private var useUnorderedMapInDifferentiatorCache: Boolean? = null
Expand Down Expand Up @@ -977,6 +978,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}

override fun useTraitHiddenOnIOS(): Boolean {
var cached = useTraitHiddenOnIOSCache
if (cached == null) {
cached = currentProvider.useTraitHiddenOnIOS()
accessedFeatureFlags.add("useTraitHiddenOnIOS")
useTraitHiddenOnIOSCache = cached
}
return cached
}

override fun useTurboModuleInterop(): Boolean {
var cached = useTurboModuleInteropCache
if (cached == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<536a5156deea17740dd24782bf79feb4>>
* @generated SignedSource<<4ba890681ce63a02ddcd443223515323>>
*/

/**
Expand Down Expand Up @@ -195,6 +195,8 @@ public interface ReactNativeFeatureFlagsProvider {

@DoNotStrip public fun useTraitHiddenOnAndroid(): Boolean

@DoNotStrip public fun useTraitHiddenOnIOS(): Boolean

@DoNotStrip public fun useTurboModuleInterop(): Boolean

@DoNotStrip public fun useTurboModules(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<b99eaffc2d11a08a6efe32b2e2732965>>
* @generated SignedSource<<592d2f00a3b2ff81533cf74f27068819>>
*/

/**
Expand Down Expand Up @@ -555,6 +555,12 @@ class ReactNativeFeatureFlagsJavaProvider
return method(javaProvider_);
}

bool useTraitHiddenOnIOS() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useTraitHiddenOnIOS");
return method(javaProvider_);
}

bool useTurboModuleInterop() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useTurboModuleInterop");
Expand Down Expand Up @@ -1025,6 +1031,11 @@ bool JReactNativeFeatureFlagsCxxInterop::useTraitHiddenOnAndroid(
return ReactNativeFeatureFlags::useTraitHiddenOnAndroid();
}

bool JReactNativeFeatureFlagsCxxInterop::useTraitHiddenOnIOS(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::useTraitHiddenOnIOS();
}

bool JReactNativeFeatureFlagsCxxInterop::useTurboModuleInterop(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::useTurboModuleInterop();
Expand Down Expand Up @@ -1344,6 +1355,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"useTraitHiddenOnAndroid",
JReactNativeFeatureFlagsCxxInterop::useTraitHiddenOnAndroid),
makeNativeMethod(
"useTraitHiddenOnIOS",
JReactNativeFeatureFlagsCxxInterop::useTraitHiddenOnIOS),
makeNativeMethod(
"useTurboModuleInterop",
JReactNativeFeatureFlagsCxxInterop::useTurboModuleInterop),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<4be32bad403baeca1a28f19ad181c42c>>
* @generated SignedSource<<23eef56b233a38a30476600370621264>>
*/

/**
Expand Down Expand Up @@ -288,6 +288,9 @@ class JReactNativeFeatureFlagsCxxInterop
static bool useTraitHiddenOnAndroid(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

static bool useTraitHiddenOnIOS(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

static bool useTurboModuleInterop(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<b55a79c9f84947fa4c12b04f15cfeefb>>
* @generated SignedSource<<05ffdb0ed4ce2b2f2eed475127ff170a>>
*/

/**
Expand Down Expand Up @@ -370,6 +370,10 @@ bool ReactNativeFeatureFlags::useTraitHiddenOnAndroid() {
return getAccessor().useTraitHiddenOnAndroid();
}

bool ReactNativeFeatureFlags::useTraitHiddenOnIOS() {
return getAccessor().useTraitHiddenOnIOS();
}

bool ReactNativeFeatureFlags::useTurboModuleInterop() {
return getAccessor().useTurboModuleInterop();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<8e9b09843bf4a0312b254559a975f612>>
* @generated SignedSource<<21d1871f9323c4adc17695dcc141a60d>>
*/

/**
Expand Down Expand Up @@ -469,6 +469,11 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool useTraitHiddenOnAndroid();

/**
* Use Trait::hidden slice-skip on iOS. When false, Hidden subtrees stay mounted and hide via UIView.hidden = YES (the path in UIView+ComponentViewProtocol since 2018) instead of REMOVE + DELETE.
*/
RN_EXPORT static bool useTraitHiddenOnIOS();

/**
* In Bridgeless mode, should legacy NativeModules use the TurboModule system?
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<ac0901d62505522c1c6f7e251e845871>>
* @generated SignedSource<<6c5ecdf9466d74d3a4c66a7bacfc7043>>
*/

/**
Expand Down Expand Up @@ -1577,6 +1577,24 @@ bool ReactNativeFeatureFlagsAccessor::useTraitHiddenOnAndroid() {
return flagValue.value();
}

bool ReactNativeFeatureFlagsAccessor::useTraitHiddenOnIOS() {
auto flagValue = useTraitHiddenOnIOS_.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(86, "useTraitHiddenOnIOS");

flagValue = currentProvider_->useTraitHiddenOnIOS();
useTraitHiddenOnIOS_ = flagValue;
}

return flagValue.value();
}

bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() {
auto flagValue = useTurboModuleInterop_.load();

Expand All @@ -1586,7 +1604,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(86, "useTurboModuleInterop");
markFlagAsAccessed(87, "useTurboModuleInterop");

flagValue = currentProvider_->useTurboModuleInterop();
useTurboModuleInterop_ = flagValue;
Expand All @@ -1604,7 +1622,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(87, "useTurboModules");
markFlagAsAccessed(88, "useTurboModules");

flagValue = currentProvider_->useTurboModules();
useTurboModules_ = flagValue;
Expand All @@ -1622,7 +1640,7 @@ bool ReactNativeFeatureFlagsAccessor::useUnorderedMapInDifferentiator() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.

markFlagAsAccessed(88, "useUnorderedMapInDifferentiator");
markFlagAsAccessed(89, "useUnorderedMapInDifferentiator");

flagValue = currentProvider_->useUnorderedMapInDifferentiator();
useUnorderedMapInDifferentiator_ = flagValue;
Expand All @@ -1640,7 +1658,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(89, "viewCullingOutsetRatio");
markFlagAsAccessed(90, "viewCullingOutsetRatio");

flagValue = currentProvider_->viewCullingOutsetRatio();
viewCullingOutsetRatio_ = flagValue;
Expand All @@ -1658,7 +1676,7 @@ bool ReactNativeFeatureFlagsAccessor::viewTransitionEnabled() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.

markFlagAsAccessed(90, "viewTransitionEnabled");
markFlagAsAccessed(91, "viewTransitionEnabled");

flagValue = currentProvider_->viewTransitionEnabled();
viewTransitionEnabled_ = flagValue;
Expand All @@ -1676,7 +1694,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(91, "virtualViewPrerenderRatio");
markFlagAsAccessed(92, "virtualViewPrerenderRatio");

flagValue = currentProvider_->virtualViewPrerenderRatio();
virtualViewPrerenderRatio_ = flagValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<9334675799ea378311b8c675ed419b1d>>
* @generated SignedSource<<d34324172201668ef16dd273f62a65c7>>
*/

/**
Expand Down Expand Up @@ -118,6 +118,7 @@ class ReactNativeFeatureFlagsAccessor {
bool useNestedScrollViewAndroid();
bool useSharedAnimatedBackend();
bool useTraitHiddenOnAndroid();
bool useTraitHiddenOnIOS();
bool useTurboModuleInterop();
bool useTurboModules();
bool useUnorderedMapInDifferentiator();
Expand All @@ -135,7 +136,7 @@ class ReactNativeFeatureFlagsAccessor {
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
bool wasOverridden_;

std::array<std::atomic<const char*>, 92> accessedFeatureFlags_;
std::array<std::atomic<const char*>, 93> accessedFeatureFlags_;

std::atomic<std::optional<bool>> commonTestFlag_;
std::atomic<std::optional<bool>> cdpInteractionMetricsEnabled_;
Expand Down Expand Up @@ -223,6 +224,7 @@ class ReactNativeFeatureFlagsAccessor {
std::atomic<std::optional<bool>> useNestedScrollViewAndroid_;
std::atomic<std::optional<bool>> useSharedAnimatedBackend_;
std::atomic<std::optional<bool>> useTraitHiddenOnAndroid_;
std::atomic<std::optional<bool>> useTraitHiddenOnIOS_;
std::atomic<std::optional<bool>> useTurboModuleInterop_;
std::atomic<std::optional<bool>> useTurboModules_;
std::atomic<std::optional<bool>> useUnorderedMapInDifferentiator_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<4a2fd61cbcdb28042f09ccb03c970674>>
* @generated SignedSource<<7861725f5c1354b87caba6b7c0e406a7>>
*/

/**
Expand Down Expand Up @@ -371,6 +371,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
return false;
}

bool useTraitHiddenOnIOS() override {
return true;
}

bool useTurboModuleInterop() override {
return false;
}
Expand Down
Loading
Loading