Ensure interop is disabled when ReactBuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE == true (#50604)

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

ReactBuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE asume Fabric and TurboModule interops are disabled, in this diff I'm adding an assertion to validate this at runtime

changelog: [internal] internal

Reviewed By: mlord93

Differential Revision: D71854550

fbshipit-source-id: a4b3acfe4c3227115300b100be4d6222d5eace8e
This commit is contained in:
David Vacca
2025-04-10 17:57:13 -07:00
committed by Facebook GitHub Bot
parent c962980363
commit 7aed1fe6a0
@@ -983,6 +983,16 @@ public class ReactHostImpl implements ReactHost {
ReactNativeFeatureFlags.useTurboModules(),
"useTurboModules FeatureFlag must be set to start ReactNative.");
}
if (ReactBuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE) {
Assertions.assertCondition(
!ReactNativeFeatureFlags.useFabricInterop(),
"useFabricInterop FeatureFlag must be false when"
+ " UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE == true.");
Assertions.assertCondition(
!ReactNativeFeatureFlags.useTurboModuleInterop(),
"useTurboModuleInterop FeatureFlag must be false when"
+ " UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE == true.");
}
mStartTask =
waitThenCallGetOrCreateReactInstanceTask()
.continueWithTask(