Clean up layout-only shadow node reference update feature flag (#46825)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46825

Changelog: [Internal]

Removing the `useRuntimeShadowNodeReferenceUpdateOnLayout` feature flag after releasing `useRuntimeShadowReferenceUpdate`.

Reviewed By: shwanton

Differential Revision: D63831444

fbshipit-source-id: 61fd800f5c9f933ce5c18d066a6b5984daed2647
This commit is contained in:
Nick Lefever
2024-10-07 06:11:36 -07:00
committed by Facebook GitHub Bot
parent 7316e3233d
commit 7510ba3c2a
19 changed files with 21 additions and 127 deletions
@@ -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<<47baae9ffdb4a5fa461ce2800ba53b02>>
* @generated SignedSource<<7d80322a6a37083c5e52e6914de49ce2>>
*/
/**
@@ -304,12 +304,6 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun useRuntimeShadowNodeReferenceUpdate(): Boolean = accessor.useRuntimeShadowNodeReferenceUpdate()
/**
* When enabled, cloning shadow nodes during layout will update the reference held by the current JS fiber tree.
*/
@JvmStatic
public fun useRuntimeShadowNodeReferenceUpdateOnLayout(): Boolean = accessor.useRuntimeShadowNodeReferenceUpdateOnLayout()
/**
* In Bridgeless mode, should legacy NativeModules use the TurboModule system?
*/
@@ -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<<03a0cabe6d50fe943f98299777790e72>>
* @generated SignedSource<<761d3e7b100a4f5ee6f8bda71f84918b>>
*/
/**
@@ -66,7 +66,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
private var useOptimisedViewPreallocationOnAndroidCache: Boolean? = null
private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
private var useRuntimeShadowNodeReferenceUpdateCache: Boolean? = null
private var useRuntimeShadowNodeReferenceUpdateOnLayoutCache: Boolean? = null
private var useTurboModuleInteropCache: Boolean? = null
private var useTurboModulesCache: Boolean? = null
@@ -484,15 +483,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
return cached
}
override fun useRuntimeShadowNodeReferenceUpdateOnLayout(): Boolean {
var cached = useRuntimeShadowNodeReferenceUpdateOnLayoutCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.useRuntimeShadowNodeReferenceUpdateOnLayout()
useRuntimeShadowNodeReferenceUpdateOnLayoutCache = cached
}
return cached
}
override fun useTurboModuleInterop(): Boolean {
var cached = useTurboModuleInteropCache
if (cached == null) {
@@ -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<<c64a6ab675deefabc00c7a2876de2bee>>
* @generated SignedSource<<1ed46e0bf712406c1bf6159e1bca3c15>>
*/
/**
@@ -120,8 +120,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
@DoNotStrip @JvmStatic public external fun useRuntimeShadowNodeReferenceUpdate(): Boolean
@DoNotStrip @JvmStatic public external fun useRuntimeShadowNodeReferenceUpdateOnLayout(): Boolean
@DoNotStrip @JvmStatic public external fun useTurboModuleInterop(): Boolean
@DoNotStrip @JvmStatic public external fun useTurboModules(): Boolean
@@ -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<<36b028f86ee9985386f7c1a8a576e348>>
* @generated SignedSource<<19cf402242ebd8b3a08dfb7c755b801b>>
*/
/**
@@ -115,8 +115,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
override fun useRuntimeShadowNodeReferenceUpdate(): Boolean = true
override fun useRuntimeShadowNodeReferenceUpdateOnLayout(): Boolean = false
override fun useTurboModuleInterop(): Boolean = false
override fun useTurboModules(): Boolean = false
@@ -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<<05002ec93dd47f1a1ca2716af08d9eed>>
* @generated SignedSource<<a307a1f9b5064547ce32f9519bbf27c4>>
*/
/**
@@ -70,7 +70,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
private var useOptimisedViewPreallocationOnAndroidCache: Boolean? = null
private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
private var useRuntimeShadowNodeReferenceUpdateCache: Boolean? = null
private var useRuntimeShadowNodeReferenceUpdateOnLayoutCache: Boolean? = null
private var useTurboModuleInteropCache: Boolean? = null
private var useTurboModulesCache: Boolean? = null
@@ -534,16 +533,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
return cached
}
override fun useRuntimeShadowNodeReferenceUpdateOnLayout(): Boolean {
var cached = useRuntimeShadowNodeReferenceUpdateOnLayoutCache
if (cached == null) {
cached = currentProvider.useRuntimeShadowNodeReferenceUpdateOnLayout()
accessedFeatureFlags.add("useRuntimeShadowNodeReferenceUpdateOnLayout")
useRuntimeShadowNodeReferenceUpdateOnLayoutCache = cached
}
return cached
}
override fun useTurboModuleInterop(): Boolean {
var cached = useTurboModuleInteropCache
if (cached == null) {
@@ -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<<b9c92af27a7e6e045af233880511147e>>
* @generated SignedSource<<bda9e94a5fe61a16e7d001ea3acfed0c>>
*/
/**
@@ -115,8 +115,6 @@ public interface ReactNativeFeatureFlagsProvider {
@DoNotStrip public fun useRuntimeShadowNodeReferenceUpdate(): Boolean
@DoNotStrip public fun useRuntimeShadowNodeReferenceUpdateOnLayout(): Boolean
@DoNotStrip public fun useTurboModuleInterop(): Boolean
@DoNotStrip public fun useTurboModules(): Boolean
@@ -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<<26d63ed84fb805148374dd23a637fdcf>>
* @generated SignedSource<<0ec332b341bc55ba1a0ab75f2ede82f6>>
*/
/**
@@ -315,12 +315,6 @@ class ReactNativeFeatureFlagsProviderHolder
return method(javaProvider_);
}
bool useRuntimeShadowNodeReferenceUpdateOnLayout() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useRuntimeShadowNodeReferenceUpdateOnLayout");
return method(javaProvider_);
}
bool useTurboModuleInterop() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useTurboModuleInterop");
@@ -567,11 +561,6 @@ bool JReactNativeFeatureFlagsCxxInterop::useRuntimeShadowNodeReferenceUpdate(
return ReactNativeFeatureFlags::useRuntimeShadowNodeReferenceUpdate();
}
bool JReactNativeFeatureFlagsCxxInterop::useRuntimeShadowNodeReferenceUpdateOnLayout(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::useRuntimeShadowNodeReferenceUpdateOnLayout();
}
bool JReactNativeFeatureFlagsCxxInterop::useTurboModuleInterop(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::useTurboModuleInterop();
@@ -737,9 +726,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"useRuntimeShadowNodeReferenceUpdate",
JReactNativeFeatureFlagsCxxInterop::useRuntimeShadowNodeReferenceUpdate),
makeNativeMethod(
"useRuntimeShadowNodeReferenceUpdateOnLayout",
JReactNativeFeatureFlagsCxxInterop::useRuntimeShadowNodeReferenceUpdateOnLayout),
makeNativeMethod(
"useTurboModuleInterop",
JReactNativeFeatureFlagsCxxInterop::useTurboModuleInterop),
@@ -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<<8cfb46b02812980196f70cfce43e4124>>
* @generated SignedSource<<a0c02cb18082c572be8d584737cea8fa>>
*/
/**
@@ -168,9 +168,6 @@ class JReactNativeFeatureFlagsCxxInterop
static bool useRuntimeShadowNodeReferenceUpdate(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool useRuntimeShadowNodeReferenceUpdateOnLayout(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool useTurboModuleInterop(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
@@ -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<<da9af24070e20310e81c38ffe608c345>>
* @generated SignedSource<<2cf7555474bd4808f9f451485da01d1a>>
*/
/**
@@ -205,10 +205,6 @@ bool ReactNativeFeatureFlags::useRuntimeShadowNodeReferenceUpdate() {
return getAccessor().useRuntimeShadowNodeReferenceUpdate();
}
bool ReactNativeFeatureFlags::useRuntimeShadowNodeReferenceUpdateOnLayout() {
return getAccessor().useRuntimeShadowNodeReferenceUpdateOnLayout();
}
bool ReactNativeFeatureFlags::useTurboModuleInterop() {
return getAccessor().useTurboModuleInterop();
}
@@ -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<<ee081daa4d26ef5c8e336bd35aad5de7>>
* @generated SignedSource<<c7dceca0eab479fd67c8e8e25656b1bf>>
*/
/**
@@ -267,11 +267,6 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool useRuntimeShadowNodeReferenceUpdate();
/**
* When enabled, cloning shadow nodes during layout will update the reference held by the current JS fiber tree.
*/
RN_EXPORT static bool useRuntimeShadowNodeReferenceUpdateOnLayout();
/**
* In Bridgeless mode, should legacy NativeModules use the TurboModule system?
*/
@@ -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<<af95a5c8a343cf00174a8149fe818950>>
* @generated SignedSource<<543c299c20c21d2d2e353c30645f94c7>>
*/
/**
@@ -857,24 +857,6 @@ bool ReactNativeFeatureFlagsAccessor::useRuntimeShadowNodeReferenceUpdate() {
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::useRuntimeShadowNodeReferenceUpdateOnLayout() {
auto flagValue = useRuntimeShadowNodeReferenceUpdateOnLayout_.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(46, "useRuntimeShadowNodeReferenceUpdateOnLayout");
flagValue = currentProvider_->useRuntimeShadowNodeReferenceUpdateOnLayout();
useRuntimeShadowNodeReferenceUpdateOnLayout_ = flagValue;
}
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() {
auto flagValue = useTurboModuleInterop_.load();
@@ -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;
@@ -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<<71e220a992b035e3e7ec39b54eb4cd6c>>
* @generated SignedSource<<ca86e53cf26c0103d12e8800fd427845>>
*/
/**
@@ -77,7 +77,6 @@ class ReactNativeFeatureFlagsAccessor {
bool useOptimisedViewPreallocationOnAndroid();
bool useOptimizedEventBatchingOnAndroid();
bool useRuntimeShadowNodeReferenceUpdate();
bool useRuntimeShadowNodeReferenceUpdateOnLayout();
bool useTurboModuleInterop();
bool useTurboModules();
@@ -90,7 +89,7 @@ class ReactNativeFeatureFlagsAccessor {
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
bool wasOverridden_;
std::array<std::atomic<const char*>, 49> accessedFeatureFlags_;
std::array<std::atomic<const char*>, 48> accessedFeatureFlags_;
std::atomic<std::optional<bool>> commonTestFlag_;
std::atomic<std::optional<bool>> allowRecursiveCommitsWithSynchronousMountOnAndroid_;
@@ -138,7 +137,6 @@ class ReactNativeFeatureFlagsAccessor {
std::atomic<std::optional<bool>> useOptimisedViewPreallocationOnAndroid_;
std::atomic<std::optional<bool>> useOptimizedEventBatchingOnAndroid_;
std::atomic<std::optional<bool>> useRuntimeShadowNodeReferenceUpdate_;
std::atomic<std::optional<bool>> useRuntimeShadowNodeReferenceUpdateOnLayout_;
std::atomic<std::optional<bool>> useTurboModuleInterop_;
std::atomic<std::optional<bool>> useTurboModules_;
};
@@ -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<<c1561801b55c88637509befb97d35877>>
* @generated SignedSource<<797150005bc7d5e76d4d004b54f8942b>>
*/
/**
@@ -211,10 +211,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
return true;
}
bool useRuntimeShadowNodeReferenceUpdateOnLayout() override {
return false;
}
bool useTurboModuleInterop() override {
return false;
}
@@ -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<<fe87cf0165da5f6d643dfba4cecbbe19>>
* @generated SignedSource<<49caf46d37d3321cd7c8a51385d15fc8>>
*/
/**
@@ -71,7 +71,6 @@ class ReactNativeFeatureFlagsProvider {
virtual bool useOptimisedViewPreallocationOnAndroid() = 0;
virtual bool useOptimizedEventBatchingOnAndroid() = 0;
virtual bool useRuntimeShadowNodeReferenceUpdate() = 0;
virtual bool useRuntimeShadowNodeReferenceUpdateOnLayout() = 0;
virtual bool useTurboModuleInterop() = 0;
virtual bool useTurboModules() = 0;
};
@@ -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<<785a20a1ed79dc6a5f74dccfda1c8429>>
* @generated SignedSource<<630740f6b6c7a145658494862c697ce6>>
*/
/**
@@ -267,11 +267,6 @@ bool NativeReactNativeFeatureFlags::useRuntimeShadowNodeReferenceUpdate(
return ReactNativeFeatureFlags::useRuntimeShadowNodeReferenceUpdate();
}
bool NativeReactNativeFeatureFlags::useRuntimeShadowNodeReferenceUpdateOnLayout(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::useRuntimeShadowNodeReferenceUpdateOnLayout();
}
bool NativeReactNativeFeatureFlags::useTurboModuleInterop(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::useTurboModuleInterop();
@@ -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<<0713247957f6ec9c4c024ab040fb89b5>>
* @generated SignedSource<<710fbb44aa7ffbc03d54b29b63aa0a73>>
*/
/**
@@ -127,8 +127,6 @@ class NativeReactNativeFeatureFlags
bool useRuntimeShadowNodeReferenceUpdate(jsi::Runtime& runtime);
bool useRuntimeShadowNodeReferenceUpdateOnLayout(jsi::Runtime& runtime);
bool useTurboModuleInterop(jsi::Runtime& runtime);
bool useTurboModules(jsi::Runtime& runtime);
@@ -431,15 +431,6 @@ const definitions: FeatureFlagDefinitions = {
purpose: 'experimentation',
},
},
useRuntimeShadowNodeReferenceUpdateOnLayout: {
defaultValue: false,
metadata: {
dateAdded: '2024-06-03',
description:
'When enabled, cloning shadow nodes during layout will update the reference held by the current JS fiber tree.',
purpose: 'experimentation',
},
},
useTurboModuleInterop: {
defaultValue: false,
metadata: {
@@ -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<<63f5264a08dcd36d44b7574d908b6d42>>
* @generated SignedSource<<6141605aee700061696d61dc3121862c>>
* @flow strict
*/
@@ -96,7 +96,6 @@ export type ReactNativeFeatureFlags = {
useOptimisedViewPreallocationOnAndroid: Getter<boolean>,
useOptimizedEventBatchingOnAndroid: Getter<boolean>,
useRuntimeShadowNodeReferenceUpdate: Getter<boolean>,
useRuntimeShadowNodeReferenceUpdateOnLayout: Getter<boolean>,
useTurboModuleInterop: Getter<boolean>,
useTurboModules: Getter<boolean>,
}
@@ -370,10 +369,6 @@ export const useOptimizedEventBatchingOnAndroid: Getter<boolean> = createNativeF
* When enabled, cloning shadow nodes within react native will update the reference held by the current JS fiber tree.
*/
export const useRuntimeShadowNodeReferenceUpdate: Getter<boolean> = createNativeFlagGetter('useRuntimeShadowNodeReferenceUpdate', true);
/**
* When enabled, cloning shadow nodes during layout will update the reference held by the current JS fiber tree.
*/
export const useRuntimeShadowNodeReferenceUpdateOnLayout: Getter<boolean> = createNativeFlagGetter('useRuntimeShadowNodeReferenceUpdateOnLayout', false);
/**
* In Bridgeless mode, should legacy NativeModules use the TurboModule system?
*/
@@ -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<<aa2a12756ea3c1bd2be05dab06b296d7>>
* @generated SignedSource<<c948481de027909f00fbbe4e4ea76b9b>>
* @flow strict
*/
@@ -69,7 +69,6 @@ export interface Spec extends TurboModule {
+useOptimisedViewPreallocationOnAndroid?: () => boolean;
+useOptimizedEventBatchingOnAndroid?: () => boolean;
+useRuntimeShadowNodeReferenceUpdate?: () => boolean;
+useRuntimeShadowNodeReferenceUpdateOnLayout?: () => boolean;
+useTurboModuleInterop?: () => boolean;
+useTurboModules?: () => boolean;
}