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<<3fee7079eaa30dca86e3cb366cdd261e>>
* @generated SignedSource<<132ff30c4a5ecf6b38dd0d6cc47d3abc>>
*/

/**
Expand Down Expand Up @@ -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?
*/
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<<7ea729886da71d6d117442c83736fc5f>>
* @generated SignedSource<<38838d89c61124afce1f13045593aeb4>>
*/

/**
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
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<<e72b92811e1f318291484d55f24f15b2>>
* @generated SignedSource<<ef75a380b395d88cb0551d3a44d9961d>>
*/

/**
Expand Down Expand Up @@ -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
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<<bd9b92174bcc46a6df01d0489b2aebc8>>
* @generated SignedSource<<c601ddc9bd62282f8079d0cb3578675d>>
*/

/**
Expand Down Expand Up @@ -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
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<<226b5967122a840a4b6ac3fa41d3fb90>>
* @generated SignedSource<<2fa1e7cd2e1d4009dfa09a5fd27a872a>>
*/

/**
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
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<<bdb7047972cb5fe84dcc11ea6409e603>>
* @generated SignedSource<<901e5678bff081bcb6b8e2d46364b977>>
*/

/**
Expand Down Expand Up @@ -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
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<<bd78270ae3d4461c8f54a9bfb9fc8b20>>
* @generated SignedSource<<285ec8cc3b3e5f55c5c31106b6df8717>>
*/

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

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

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

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

bool JReactNativeFeatureFlagsCxxInterop::useTurboModuleInterop(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::useTurboModuleInterop();
Expand Down Expand Up @@ -1165,6 +1176,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"useSharedAnimatedBackend",
JReactNativeFeatureFlagsCxxInterop::useSharedAnimatedBackend),
makeNativeMethod(
"useTraitHiddenOnAndroid",
JReactNativeFeatureFlagsCxxInterop::useTraitHiddenOnAndroid),
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<<d6f0bbc55218e36f040c04baa9eb6d8d>>
* @generated SignedSource<<34ad93365b68934d051b0de522a36014>>
*/

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

static bool useTraitHiddenOnAndroid(
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<<68811ae2e7fcb8b8b406097839f669dd>>
* @generated SignedSource<<5fe8801a343267a840956183ca93c757>>
*/

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

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

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<<93fb26b6c04daf8d35aec7bca867fa70>>
* @generated SignedSource<<67cb9ad627e865b24b380be1ef6e0db7>>
*/

/**
Expand Down Expand Up @@ -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?
*/
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<<ef2223fbbb85ea118a10f1147ac0efd3>>
* @generated SignedSource<<f6425bd8373ceb2a9d928fd94f1c9576>>
*/

/**
Expand Down Expand Up @@ -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();

Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
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<<aa2b0b9525391749b1e4fe5c20021919>>
* @generated SignedSource<<1c59c66275538ea4cd0bc47f1e038924>>
*/

/**
Expand Down Expand Up @@ -106,6 +106,7 @@ class ReactNativeFeatureFlagsAccessor {
bool useRawPropsJsiValue();
bool useShadowNodeStateOnClone();
bool useSharedAnimatedBackend();
bool useTraitHiddenOnAndroid();
bool useTurboModuleInterop();
bool useTurboModules();
double viewCullingOutsetRatio();
Expand All @@ -122,7 +123,7 @@ class ReactNativeFeatureFlagsAccessor {
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
bool wasOverridden_;

std::array<std::atomic<const char*>, 79> accessedFeatureFlags_;
std::array<std::atomic<const char*>, 80> accessedFeatureFlags_;

std::atomic<std::optional<bool>> commonTestFlag_;
std::atomic<std::optional<bool>> cdpInteractionMetricsEnabled_;
Expand Down Expand Up @@ -198,6 +199,7 @@ class ReactNativeFeatureFlagsAccessor {
std::atomic<std::optional<bool>> useRawPropsJsiValue_;
std::atomic<std::optional<bool>> useShadowNodeStateOnClone_;
std::atomic<std::optional<bool>> useSharedAnimatedBackend_;
std::atomic<std::optional<bool>> useTraitHiddenOnAndroid_;
std::atomic<std::optional<bool>> useTurboModuleInterop_;
std::atomic<std::optional<bool>> useTurboModules_;
std::atomic<std::optional<double>> viewCullingOutsetRatio_;
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<<3ddb240bc600ff3cfa0cfe5896c59b23>>
* @generated SignedSource<<5c430e6e6ac1a7272eae8f89f4052193>>
*/

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

bool useTraitHiddenOnAndroid() override {
return false;
}

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