From 7aed1fe6a08425ec3370cb14f653544b97f4db10 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 10 Apr 2025 17:57:13 -0700 Subject: [PATCH] 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 --- .../java/com/facebook/react/runtime/ReactHostImpl.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java index 5646b516fb4..f230b6ffccc 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java @@ -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(