Skip to content

Commit 0b35f4a

Browse files
committed
Flip useTurboModules default value to true (#56898)
Summary: Pull Request resolved: #56898 TurboModules have been the only supported NativeModule execution mode for all in-prod apps for a while; every internal override hardcodes `useTurboModules()` to `true`. Flip the underlying default in `ReactNativeFeatureFlags.config.js` from `false` to `true` so that any consumer that does not explicitly override the flag also gets the modern behavior. Generated files updated by `js1 featureflags --update`: - `ReactNativeFeatureFlagsDefaults.kt` (Kotlin default) - `ReactNativeFeatureFlagsDefaults.h` (C++ default) - `ReactNativeFeatureFlags.js` (JS default) No interface or accessor signatures changed. Changelog: [General][Changed] - The default value of the `useTurboModules` ReactNativeFeatureFlags flag is now `true` Differential Revision: D105718212
1 parent 9325d34 commit 0b35f4a

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

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

Lines changed: 2 additions & 2 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<<a2ee2a39f68b48278eaa301fee26af03>>
7+
* @generated SignedSource<<fe71238401f38ad227665a6f0dd6087b>>
88
*/
99

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

194194
override fun useTurboModuleInterop(): Boolean = false
195195

196-
override fun useTurboModules(): Boolean = false
196+
override fun useTurboModules(): Boolean = true
197197

198198
override fun useUnorderedMapInDifferentiator(): Boolean = false
199199

packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h

Lines changed: 2 additions & 2 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<<92f6cddfad7651ea742f956f40377d76>>
7+
* @generated SignedSource<<66079ebd2cb7c003b0fe5ce135b28645>>
88
*/
99

1010
/**
@@ -368,7 +368,7 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
368368
}
369369

370370
bool useTurboModules() override {
371-
return false;
371+
return true;
372372
}
373373

374374
bool useUnorderedMapInDifferentiator() override {

packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ const definitions: FeatureFlagDefinitions = {
957957
ossReleaseStage: 'canary',
958958
},
959959
useTurboModules: {
960-
defaultValue: false,
960+
defaultValue: true,
961961
metadata: {
962962
description:
963963
'When enabled, NativeModules will be executed by using the TurboModule system',

packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js

Lines changed: 2 additions & 2 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<<d76f42e46c039d6c07d021cbf906de35>>
7+
* @generated SignedSource<<002a219eed0f854feb2ada440cbee27e>>
88
* @flow strict
99
* @noformat
1010
*/
@@ -541,7 +541,7 @@ export const useTurboModuleInterop: Getter<boolean> = createNativeFlagGetter('us
541541
/**
542542
* When enabled, NativeModules will be executed by using the TurboModule system
543543
*/
544-
export const useTurboModules: Getter<boolean> = createNativeFlagGetter('useTurboModules', false);
544+
export const useTurboModules: Getter<boolean> = createNativeFlagGetter('useTurboModules', true);
545545
/**
546546
* Use std::unordered_map instead of TinyMap in the Differentiator for improved lookup performance.
547547
*/

0 commit comments

Comments
 (0)