diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java index e16cb596ee0e81..b0788f87da4990 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java @@ -55,8 +55,6 @@ import com.facebook.react.bridge.CatalystInstanceImpl; import com.facebook.react.bridge.JSBundleLoader; import com.facebook.react.bridge.JSExceptionHandler; -import com.facebook.react.bridge.JSIModulePackage; -import com.facebook.react.bridge.JSIModuleType; import com.facebook.react.bridge.JavaJSExecutor; import com.facebook.react.bridge.JavaScriptExecutor; import com.facebook.react.bridge.JavaScriptExecutorFactory; @@ -186,7 +184,6 @@ public interface ReactInstanceEventListener private volatile Boolean mHasStartedDestroying = false; private final MemoryPressureRouter mMemoryPressureRouter; private final @Nullable JSExceptionHandler mJSExceptionHandler; - private final @Nullable JSIModulePackage mJSIModulePackage; private final @Nullable UIManagerProvider mUIManagerProvider; private final @Nullable ReactPackageTurboModuleManagerDelegate.Builder mTMMDelegateBuilder; private List mViewManagers; @@ -235,7 +232,6 @@ public static ReactInstanceManagerBuilder builder() { @Nullable DevBundleDownloadListener devBundleDownloadListener, int minNumShakes, int minTimeLeftInFrameForNonBatchedOperationMs, - @Nullable JSIModulePackage jsiModulePackage, @Nullable UIManagerProvider uIManagerProvider, @Nullable Map customPackagerCommandHandlers, @Nullable ReactPackageTurboModuleManagerDelegate.Builder tmmDelegateBuilder, @@ -296,7 +292,6 @@ public void invokeDefaultOnBackPressed() { } mPackages.addAll(packages); } - mJSIModulePackage = jsiModulePackage; mUIManagerProvider = uIManagerProvider; // Instantiate ReactChoreographer in UI thread. @@ -1401,19 +1396,15 @@ private ReactApplicationContext createReactContext( } } - if (mJSIModulePackage != null) { - catalystInstance.addJSIModules( - mJSIModulePackage.getJSIModules( - reactContext, catalystInstance.getJavaScriptContextHolder())); - } if (mUIManagerProvider != null) { UIManager uiManager = mUIManagerProvider.createUIManager(reactContext); if (uiManager != null) { + catalystInstance.setFabricUIManager(uiManager); + + // Initialize the UIManager uiManager.initialize(); catalystInstance.setFabricUIManager(uiManager); } - } else if (ReactFeatureFlags.enableFabricRenderer) { - catalystInstance.getJSIModule(JSIModuleType.UIManager); } if (mBridgeIdleDebugListener != null) { catalystInstance.addBridgeIdleDebugListener(mBridgeIdleDebugListener); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java index 3ae051fbfefad0..d467ab93d0a124 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java @@ -20,7 +20,6 @@ import com.facebook.infer.annotation.Assertions; import com.facebook.react.bridge.JSBundleLoader; import com.facebook.react.bridge.JSExceptionHandler; -import com.facebook.react.bridge.JSIModulePackage; import com.facebook.react.bridge.JavaScriptExecutorFactory; import com.facebook.react.bridge.NotThreadSafeBridgeIdleDebugListener; import com.facebook.react.bridge.UIManagerProvider; @@ -68,7 +67,6 @@ public class ReactInstanceManagerBuilder { private @Nullable JavaScriptExecutorFactory mJavaScriptExecutorFactory; private int mMinNumShakes = 1; private int mMinTimeLeftInFrameForNonBatchedOperationMs = -1; - private @Nullable JSIModulePackage mJSIModulesPackage; private @Nullable UIManagerProvider mUIManagerProvider; private @Nullable Map mCustomPackagerCommandHandlers; private @Nullable ReactPackageTurboModuleManagerDelegate.Builder mTMMDelegateBuilder; @@ -79,12 +77,6 @@ public class ReactInstanceManagerBuilder { /* package protected */ ReactInstanceManagerBuilder() {} - public ReactInstanceManagerBuilder setJSIModulesPackage( - @Nullable JSIModulePackage jsiModulePackage) { - mJSIModulesPackage = jsiModulePackage; - return this; - } - /** Factory for desired implementation of JavaScriptExecutor. */ public ReactInstanceManagerBuilder setJavaScriptExecutorFactory( @Nullable JavaScriptExecutorFactory javaScriptExecutorFactory) { @@ -361,7 +353,6 @@ public ReactInstanceManager build() { mDevBundleDownloadListener, mMinNumShakes, mMinTimeLeftInFrameForNonBatchedOperationMs, - mJSIModulesPackage, mUIManagerProvider, mCustomPackagerCommandHandlers, mTMMDelegateBuilder, diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java index 3f1fb6f9462045..6551937866f7ed 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java @@ -10,7 +10,6 @@ import android.app.Application; import androidx.annotation.Nullable; import com.facebook.infer.annotation.Assertions; -import com.facebook.react.bridge.JSIModulePackage; import com.facebook.react.bridge.JavaScriptExecutorFactory; import com.facebook.react.bridge.ReactMarker; import com.facebook.react.bridge.ReactMarkerConstants; @@ -85,7 +84,6 @@ protected ReactInstanceManager createReactInstanceManager() { .setLazyViewManagersEnabled(getLazyViewManagersEnabled()) .setRedBoxHandler(getRedBoxHandler()) .setJavaScriptExecutorFactory(getJavaScriptExecutorFactory()) - .setJSIModulesPackage(getJSIModulePackage()) .setUIManagerProvider(getUIManagerProvider()) .setInitialLifecycleState(LifecycleState.BEFORE_CREATE) .setReactPackageTurboModuleManagerDelegateBuilder( @@ -127,10 +125,6 @@ protected final Application getApplication() { return mApplication; } - protected @Nullable JSIModulePackage getJSIModulePackage() { - return null; - } - protected @Nullable UIManagerProvider getUIManagerProvider() { return reactApplicationContext -> null; }