Skip to content

Commit b4a715c

Browse files
mdvaccameta-codesync[bot]
authored andcommitted
Remove useTurboModules feature flag (#56901)
Summary: Pull Request resolved: #56901 The `useTurboModules` feature flag has been removed; it was always set to true on the canary release stage and there are no remaining callers (all inlined in earlier diffs of this stack). This diff: - Removes the `useTurboModules` entry from `ReactNativeFeatureFlags.config.js`. - Updates the description of `enableBridgelessArchitecture` (which referenced `useTurboModules`). - Regenerates the codegen output: the 7 Kotlin `generated` files in `ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/`, the C++ headers and implementations under `ReactCommon/react/featureflags/` and `ReactCommon/react/nativemodule/featureflags/`, the JNI bridge under `ReactAndroid/src/main/jni/react/featureflags/`, and the JS modules under `src/private/featureflags/`. The flag is in the `com.facebook.react.internal.featureflags` package and is excluded from `ReactAndroid.api` tracking; no API metadata regeneration is needed. Behavior is unchanged. Changelog: [General][Removed] - Remove the `useTurboModules` feature flag. TurboModules are now always enabled. Reviewed By: fkgozali Differential Revision: D105718208 fbshipit-source-id: 98c6c10ae88b4293cee8920275bad13212fbb54c
1 parent e375066 commit b4a715c

22 files changed

Lines changed: 31 additions & 154 deletions

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<6fceacd47d09747b6c5868fbb89dc642>>
7+
* @generated SignedSource<<8b35aa70eea734a8bfcbb7bd651ba8e2>>
88
*/
99

1010
/**
@@ -109,7 +109,7 @@ public object ReactNativeFeatureFlags {
109109
public fun enableAndroidTextMeasurementOptimizations(): Boolean = accessor.enableAndroidTextMeasurementOptimizations()
110110

111111
/**
112-
* Feature flag to enable the new bridgeless architecture. Note: Enabling this will force enable the following flag: `useTurboModules`.
112+
* Feature flag to enable the new bridgeless architecture.
113113
*/
114114
@JvmStatic
115115
public fun enableBridgelessArchitecture(): Boolean = accessor.enableBridgelessArchitecture()
@@ -540,12 +540,6 @@ public object ReactNativeFeatureFlags {
540540
@JvmStatic
541541
public fun useTurboModuleInterop(): Boolean = accessor.useTurboModuleInterop()
542542

543-
/**
544-
* When enabled, NativeModules will be executed by using the TurboModule system
545-
*/
546-
@JvmStatic
547-
public fun useTurboModules(): Boolean = accessor.useTurboModules()
548-
549543
/**
550544
* Use std::unordered_map instead of TinyMap in the Differentiator for improved lookup performance.
551545
*/

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<86466dcd0447728215ffc23ce0c9fd11>>
7+
* @generated SignedSource<<494ed85c58f80b4feb6fb9b83fe7a27e>>
88
*/
99

1010
/**
@@ -105,7 +105,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
105105
private var useSharedAnimatedBackendCache: Boolean? = null
106106
private var useTraitHiddenOnAndroidCache: Boolean? = null
107107
private var useTurboModuleInteropCache: Boolean? = null
108-
private var useTurboModulesCache: Boolean? = null
109108
private var useUnorderedMapInDifferentiatorCache: Boolean? = null
110109
private var viewCullingOutsetRatioCache: Double? = null
111110
private var viewTransitionEnabledCache: Boolean? = null
@@ -877,15 +876,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
877876
return cached
878877
}
879878

880-
override fun useTurboModules(): Boolean {
881-
var cached = useTurboModulesCache
882-
if (cached == null) {
883-
cached = ReactNativeFeatureFlagsCxxInterop.useTurboModules()
884-
useTurboModulesCache = cached
885-
}
886-
return cached
887-
}
888-
889879
override fun useUnorderedMapInDifferentiator(): Boolean {
890880
var cached = useUnorderedMapInDifferentiatorCache
891881
if (cached == null) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<674ece24434cc2fa93bca21dc806db2f>>
7+
* @generated SignedSource<<16ca9a4b47da90ea71300eb37287e28b>>
88
*/
99

1010
/**
@@ -198,8 +198,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
198198

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

201-
@DoNotStrip @JvmStatic public external fun useTurboModules(): Boolean
202-
203201
@DoNotStrip @JvmStatic public external fun useUnorderedMapInDifferentiator(): Boolean
204202

205203
@DoNotStrip @JvmStatic public external fun viewCullingOutsetRatio(): Double

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<fe71238401f38ad227665a6f0dd6087b>>
7+
* @generated SignedSource<<10e6516b3c9cf53ae2e48c8b8cd51033>>
88
*/
99

1010
/**
@@ -193,8 +193,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
193193

194194
override fun useTurboModuleInterop(): Boolean = false
195195

196-
override fun useTurboModules(): Boolean = true
197-
198196
override fun useUnorderedMapInDifferentiator(): Boolean = false
199197

200198
override fun viewCullingOutsetRatio(): Double = 0.0

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<413b2f3808dacfde7b9b059fba25ce13>>
7+
* @generated SignedSource<<441fe8be28d4521e1fe9fe7b87b74cf2>>
88
*/
99

1010
/**
@@ -109,7 +109,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
109109
private var useSharedAnimatedBackendCache: Boolean? = null
110110
private var useTraitHiddenOnAndroidCache: Boolean? = null
111111
private var useTurboModuleInteropCache: Boolean? = null
112-
private var useTurboModulesCache: Boolean? = null
113112
private var useUnorderedMapInDifferentiatorCache: Boolean? = null
114113
private var viewCullingOutsetRatioCache: Double? = null
115114
private var viewTransitionEnabledCache: Boolean? = null
@@ -966,16 +965,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
966965
return cached
967966
}
968967

969-
override fun useTurboModules(): Boolean {
970-
var cached = useTurboModulesCache
971-
if (cached == null) {
972-
cached = currentProvider.useTurboModules()
973-
accessedFeatureFlags.add("useTurboModules")
974-
useTurboModulesCache = cached
975-
}
976-
return cached
977-
}
978-
979968
override fun useUnorderedMapInDifferentiator(): Boolean {
980969
var cached = useUnorderedMapInDifferentiatorCache
981970
if (cached == null) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Canary_Android.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<e1acac73151ebf19ba401ecf6f40d1ff>>
7+
* @generated SignedSource<<0642a793f11832205a362e6d1ae6e081>>
88
*/
99

1010
/**
@@ -34,6 +34,4 @@ public open class ReactNativeFeatureFlagsOverrides_RNOSS_Canary_Android : ReactN
3434
override fun useNativeViewConfigsInBridgelessMode(): Boolean = true
3535

3636
override fun useTurboModuleInterop(): Boolean = true
37-
38-
override fun useTurboModules(): Boolean = true
3937
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<ba7d0cdd9404c120b189ba04b2506496>>
7+
* @generated SignedSource<<972dbaef144818484bafff334cf97ef2>>
88
*/
99

1010
/**
@@ -193,8 +193,6 @@ public interface ReactNativeFeatureFlagsProvider {
193193

194194
@DoNotStrip public fun useTurboModuleInterop(): Boolean
195195

196-
@DoNotStrip public fun useTurboModules(): Boolean
197-
198196
@DoNotStrip public fun useUnorderedMapInDifferentiator(): Boolean
199197

200198
@DoNotStrip public fun viewCullingOutsetRatio(): Double

packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<2eec37a74572edf4fe6a95c277555c98>>
7+
* @generated SignedSource<<bb79417efb0f63b2717ea8873b72da88>>
88
*/
99

1010
/**
@@ -549,12 +549,6 @@ class ReactNativeFeatureFlagsJavaProvider
549549
return method(javaProvider_);
550550
}
551551

552-
bool useTurboModules() override {
553-
static const auto method =
554-
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useTurboModules");
555-
return method(javaProvider_);
556-
}
557-
558552
bool useUnorderedMapInDifferentiator() override {
559553
static const auto method =
560554
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useUnorderedMapInDifferentiator");
@@ -1014,11 +1008,6 @@ bool JReactNativeFeatureFlagsCxxInterop::useTurboModuleInterop(
10141008
return ReactNativeFeatureFlags::useTurboModuleInterop();
10151009
}
10161010

1017-
bool JReactNativeFeatureFlagsCxxInterop::useTurboModules(
1018-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
1019-
return ReactNativeFeatureFlags::useTurboModules();
1020-
}
1021-
10221011
bool JReactNativeFeatureFlagsCxxInterop::useUnorderedMapInDifferentiator(
10231012
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
10241013
return ReactNativeFeatureFlags::useUnorderedMapInDifferentiator();
@@ -1330,9 +1319,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
13301319
makeNativeMethod(
13311320
"useTurboModuleInterop",
13321321
JReactNativeFeatureFlagsCxxInterop::useTurboModuleInterop),
1333-
makeNativeMethod(
1334-
"useTurboModules",
1335-
JReactNativeFeatureFlagsCxxInterop::useTurboModules),
13361322
makeNativeMethod(
13371323
"useUnorderedMapInDifferentiator",
13381324
JReactNativeFeatureFlagsCxxInterop::useUnorderedMapInDifferentiator),

packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<2f2079e166be5c7d3066239ede9bee31>>
7+
* @generated SignedSource<<3007628255a078dafc01eb16b3d55fbe>>
88
*/
99

1010
/**
@@ -285,9 +285,6 @@ class JReactNativeFeatureFlagsCxxInterop
285285
static bool useTurboModuleInterop(
286286
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
287287

288-
static bool useTurboModules(
289-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
290-
291288
static bool useUnorderedMapInDifferentiator(
292289
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
293290

packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<86375427ea016f8ce887ed066d1b21ac>>
7+
* @generated SignedSource<<5c308b51617953c21d3ae60dc8c530bb>>
88
*/
99

1010
/**
@@ -366,10 +366,6 @@ bool ReactNativeFeatureFlags::useTurboModuleInterop() {
366366
return getAccessor().useTurboModuleInterop();
367367
}
368368

369-
bool ReactNativeFeatureFlags::useTurboModules() {
370-
return getAccessor().useTurboModules();
371-
}
372-
373369
bool ReactNativeFeatureFlags::useUnorderedMapInDifferentiator() {
374370
return getAccessor().useUnorderedMapInDifferentiator();
375371
}

0 commit comments

Comments
 (0)