Skip to content
Open
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 @@ -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 @@ -49,9 +49,7 @@ public open class ReactDelegate {
*
* @return true if Fabric is enabled for this Activity, false otherwise.
*/
protected var isFabricEnabled: Boolean =
ReactNativeNewArchitectureFeatureFlags.enableFabricRenderer()
private set
protected val isFabricEnabled: Boolean = true

/**
* Do not use this constructor as it's not accounting for New Architecture at all. You should use
Expand Down Expand Up @@ -95,7 +93,6 @@ public open class ReactDelegate {
launchOptions: Bundle?,
fabricEnabled: Boolean,
) {
this.isFabricEnabled = fabricEnabled
this.activity = activity
this.mainComponentName = appKey
this.launchOptions = launchOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,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<<794be726d31bf395558bb987d94c3205>>
* @generated SignedSource<<80d0515ac30df66c8e78da362de511c5>>
*/

/**
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 @@ -540,12 +534,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<<e91fab99f355307aac38de7a5c84e8dd>>
* @generated SignedSource<<d44ceaab2a12d7e8fefa5fce6ae6b5f7>>
*/

/**
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 @@ -105,7 +104,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 @@ -328,15 +326,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 @@ -877,15 +866,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<<9d1f725d5a1348a2b31ad4ea2242529c>>
* @generated SignedSource<<7c674bb73cd3968828ad1ff2b80d83cb>>
*/

/**
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 @@ -198,8 +196,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<<f63cf074bb6687c479e2f4059662ff76>>
* @generated SignedSource<<869443ae5e3a602f83256544938d30a0>>
*/

/**
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 @@ -193,8 +191,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<<27e88ec53841585796515db0406909dd>>
* @generated SignedSource<<ca23efddf4b35ace51e92e708b41bbd5>>
*/

/**
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 @@ -109,7 +108,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 @@ -356,16 +354,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 @@ -966,16 +954,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<<5670b927124074a4c59b692de8599cd5>>
* @generated SignedSource<<802a4cc818ca5333fe824c77f4ab10d4>>
*/

/**
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 @@ -193,8 +191,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 @@ -35,18 +35,6 @@ public object ReactNativeNewArchitectureFeatureFlags {
return ReactNativeFeatureFlags.enableBridgelessArchitecture()
}

@JvmStatic
public fun enableFabricRenderer(): Boolean {
if (ReactBuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE) {
Assertions.assertCondition(
ReactNativeFeatureFlags.enableFabricRenderer(),
"ReactNativeFeatureFlags.enableFabricRenderer() should be set to TRUE when Strict Mode is enabled",
)
return true
}
return ReactNativeFeatureFlags.enableFabricRenderer()
}

@JvmStatic
public fun useFabricInterop(): Boolean {
if (ReactBuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE) {
Expand All @@ -70,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 @@ -25,11 +25,7 @@ public open class ReactNativeNewArchitectureFeatureFlagsDefaults() :

override fun enableBridgelessArchitecture(): Boolean = true

override fun enableFabricRenderer(): 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 @@ -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