Skip to content
Closed
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import com.facebook.react.bridge.ModuleHolder
import com.facebook.react.bridge.ModuleSpec
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.internal.featureflags.ReactNativeNewArchitectureFeatureFlags
import com.facebook.react.module.model.ReactModuleInfo
import com.facebook.react.module.model.ReactModuleInfoProvider
import com.facebook.react.uimanager.ViewManager
Expand Down Expand Up @@ -65,12 +64,9 @@ public abstract class BaseReactPackage : ReactPackage {
val reactModuleInfo = entry.value

// This Iterator is used to create the NativeModule registry. The NativeModule
// registry must not have TurboModules. Therefore, if TurboModules are enabled, and
// the current NativeModule is a TurboModule, we need to skip iterating over it.
if (
ReactNativeNewArchitectureFeatureFlags.useTurboModules() &&
reactModuleInfo.isTurboModule
) {
// registry must not have TurboModules. Therefore, if the current NativeModule is
// a TurboModule, we need to skip iterating over it.
if (reactModuleInfo.isTurboModule) {
continue
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public object DefaultNewArchitectureEntryPoint {
internal fun loadWithFeatureFlags(featureFlags: ReactNativeFeatureFlagsProvider) {
ReactNativeFeatureFlags.override(featureFlags)

privateTurboModulesEnabled = featureFlags.useTurboModules()
privateTurboModulesEnabled = true
privateBridgelessEnabled = featureFlags.enableBridgelessArchitecture()

val (isValid, errorMessage) =
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<<56c989556810840e2dd2a42b66d431dc>>
* @generated SignedSource<<8b35aa70eea734a8bfcbb7bd651ba8e2>>
*/

/**
Expand Down Expand Up @@ -109,7 +109,7 @@ public object ReactNativeFeatureFlags {
public fun enableAndroidTextMeasurementOptimizations(): Boolean = accessor.enableAndroidTextMeasurementOptimizations()

/**
* Feature flag to enable the new bridgeless architecture. Note: Enabling this will force enable the following flags: `useTurboModules` & `enableFabricRenderer`.
* Feature flag to enable the new bridgeless architecture.
*/
@JvmStatic
public fun enableBridgelessArchitecture(): Boolean = accessor.enableBridgelessArchitecture()
Expand Down Expand Up @@ -174,12 +174,6 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun enableFabricLogs(): Boolean = accessor.enableFabricLogs()

/**
* Enables the use of the Fabric renderer in the whole app.
*/
@JvmStatic
public fun enableFabricRenderer(): Boolean = accessor.enableFabricRenderer()

/**
* Enables font scale changes updating layout for measurable nodes.
*/
Expand Down Expand Up @@ -546,12 +540,6 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun useTurboModuleInterop(): Boolean = accessor.useTurboModuleInterop()

/**
* When enabled, NativeModules will be executed by using the TurboModule system
*/
@JvmStatic
public fun useTurboModules(): Boolean = accessor.useTurboModules()

/**
* Use std::unordered_map instead of TinyMap in the Differentiator for improved lookup performance.
*/
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<<43aa532756b07f0b754cd74eb4811664>>
* @generated SignedSource<<494ed85c58f80b4feb6fb9b83fe7a27e>>
*/

/**
Expand Down Expand Up @@ -44,7 +44,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var enableExclusivePropsUpdateAndroidCache: Boolean? = null
private var enableFabricCommitBranchingCache: Boolean? = null
private var enableFabricLogsCache: Boolean? = null
private var enableFabricRendererCache: Boolean? = null
private var enableFontScaleChangesUpdatingLayoutCache: Boolean? = null
private var enableIOSTextBaselineOffsetPerLineCache: Boolean? = null
private var enableIOSViewClipToPaddingBoxCache: Boolean? = null
Expand Down Expand Up @@ -106,7 +105,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var useSharedAnimatedBackendCache: Boolean? = null
private var useTraitHiddenOnAndroidCache: Boolean? = null
private var useTurboModuleInteropCache: Boolean? = null
private var useTurboModulesCache: Boolean? = null
private var useUnorderedMapInDifferentiatorCache: Boolean? = null
private var viewCullingOutsetRatioCache: Double? = null
private var viewTransitionEnabledCache: Boolean? = null
Expand Down Expand Up @@ -329,15 +327,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}

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

override fun enableFontScaleChangesUpdatingLayout(): Boolean {
var cached = enableFontScaleChangesUpdatingLayoutCache
if (cached == null) {
Expand Down Expand Up @@ -887,15 +876,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}

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

override fun useUnorderedMapInDifferentiator(): Boolean {
var cached = useUnorderedMapInDifferentiatorCache
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<<5cb98793989e603846a2008aa1a6af41>>
* @generated SignedSource<<16ca9a4b47da90ea71300eb37287e28b>>
*/

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

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

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

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

@DoNotStrip @JvmStatic public external fun enableIOSTextBaselineOffsetPerLine(): Boolean
Expand Down Expand Up @@ -200,8 +198,6 @@ public object ReactNativeFeatureFlagsCxxInterop {

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

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

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

@DoNotStrip @JvmStatic public external fun viewCullingOutsetRatio(): Double
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<<f4b6d9ed2f6ccff6ab01e53f6048423c>>
* @generated SignedSource<<10e6516b3c9cf53ae2e48c8b8cd51033>>
*/

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

override fun enableFabricLogs(): Boolean = false

override fun enableFabricRenderer(): Boolean = false

override fun enableFontScaleChangesUpdatingLayout(): Boolean = true

override fun enableIOSTextBaselineOffsetPerLine(): Boolean = false
Expand Down Expand Up @@ -195,8 +193,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi

override fun useTurboModuleInterop(): Boolean = false

override fun useTurboModules(): Boolean = false

override fun useUnorderedMapInDifferentiator(): Boolean = false

override fun viewCullingOutsetRatio(): Double = 0.0
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<<6ee1cc911c3ebb12b31151441dd43605>>
* @generated SignedSource<<441fe8be28d4521e1fe9fe7b87b74cf2>>
*/

/**
Expand Down Expand Up @@ -48,7 +48,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var enableExclusivePropsUpdateAndroidCache: Boolean? = null
private var enableFabricCommitBranchingCache: Boolean? = null
private var enableFabricLogsCache: Boolean? = null
private var enableFabricRendererCache: Boolean? = null
private var enableFontScaleChangesUpdatingLayoutCache: Boolean? = null
private var enableIOSTextBaselineOffsetPerLineCache: Boolean? = null
private var enableIOSViewClipToPaddingBoxCache: Boolean? = null
Expand Down Expand Up @@ -110,7 +109,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var useSharedAnimatedBackendCache: Boolean? = null
private var useTraitHiddenOnAndroidCache: Boolean? = null
private var useTurboModuleInteropCache: Boolean? = null
private var useTurboModulesCache: Boolean? = null
private var useUnorderedMapInDifferentiatorCache: Boolean? = null
private var viewCullingOutsetRatioCache: Double? = null
private var viewTransitionEnabledCache: Boolean? = null
Expand Down Expand Up @@ -357,16 +355,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}

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

override fun enableFontScaleChangesUpdatingLayout(): Boolean {
var cached = enableFontScaleChangesUpdatingLayoutCache
if (cached == null) {
Expand Down Expand Up @@ -977,16 +965,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}

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

override fun useUnorderedMapInDifferentiator(): Boolean {
var cached = useUnorderedMapInDifferentiatorCache
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<<2c5d2f88cf7150403cbed87aeadc0239>>
* @generated SignedSource<<0642a793f11832205a362e6d1ae6e081>>
*/

/**
Expand All @@ -27,15 +27,11 @@ public open class ReactNativeFeatureFlagsOverrides_RNOSS_Canary_Android : ReactN

override fun enableBridgelessArchitecture(): Boolean = true

override fun enableFabricRenderer(): Boolean = true

override fun enableIntersectionObserverByDefault(): Boolean = true

override fun enableSwiftUIBasedFilters(): Boolean = true

override fun useNativeViewConfigsInBridgelessMode(): Boolean = true

override fun useTurboModuleInterop(): Boolean = true

override fun useTurboModules(): Boolean = true
}
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<<9945400608426bf3aa1163b9f212d07c>>
* @generated SignedSource<<972dbaef144818484bafff334cf97ef2>>
*/

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

@DoNotStrip public fun enableFabricLogs(): Boolean

@DoNotStrip public fun enableFabricRenderer(): Boolean

@DoNotStrip public fun enableFontScaleChangesUpdatingLayout(): Boolean

@DoNotStrip public fun enableIOSTextBaselineOffsetPerLine(): Boolean
Expand Down Expand Up @@ -195,8 +193,6 @@ public interface ReactNativeFeatureFlagsProvider {

@DoNotStrip public fun useTurboModuleInterop(): Boolean

@DoNotStrip public fun useTurboModules(): Boolean

@DoNotStrip public fun useUnorderedMapInDifferentiator(): Boolean

@DoNotStrip public fun viewCullingOutsetRatio(): Double
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,4 @@ public object ReactNativeNewArchitectureFeatureFlags {
}
return ReactNativeFeatureFlags.useTurboModuleInterop()
}

@JvmStatic
public fun useTurboModules(): Boolean {
if (ReactBuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE) {
Assertions.assertCondition(
ReactNativeFeatureFlags.useTurboModules(),
"ReactNativeFeatureFlags.useTurboModules() should be set to TRUE when Strict Mode is enabled",
)
return true
}
return ReactNativeFeatureFlags.useTurboModules()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,4 @@ public open class ReactNativeNewArchitectureFeatureFlagsDefaults() :
override fun useNativeViewConfigsInBridgelessMode(): Boolean = true

override fun useTurboModuleInterop(): Boolean = true

override fun useTurboModules(): Boolean = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -856,11 +856,6 @@ public class ReactHostImpl(
ReactNativeNewArchitectureFeatureFlags.enableBridgelessArchitecture(),
"enableBridgelessArchitecture FeatureFlag must be set to start ReactNative.",
)

Assertions.assertCondition(
ReactNativeNewArchitectureFeatureFlags.useTurboModules(),
"useTurboModules FeatureFlag must be set to start ReactNative.",
)
}
if (ReactBuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE) {
Assertions.assertCondition(
Expand Down
Loading
Loading