diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstancePackage.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstancePackage.java deleted file mode 100644 index 3d8634135c356d..00000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstancePackage.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -package com.facebook.react; - -import com.facebook.react.bridge.NativeModule; -import com.facebook.react.bridge.ReactApplicationContext; -import java.util.List; - -/** - * A simple wrapper for ReactPackage to make it aware of its {@link ReactInstanceManager} when - * creating native modules. This is useful when the package needs to ask the instance manager for - * more information, like {@link DevSupportManager}. - * - *

TODO(t11394819): Consolidate this with LazyReactPackage Use {@link ReactPackage} or {@link - * LazyReactPackage} and inject reactInstanceManager as a part of when plugins are initialized. - */ -@Deprecated -public abstract class ReactInstancePackage implements ReactPackage { - - public abstract List createNativeModules( - ReactApplicationContext reactContext, ReactInstanceManager reactInstanceManager); - - @Override - public List createNativeModules(ReactApplicationContext reactContext) { - throw new RuntimeException("ReactInstancePackage must be passed in the ReactInstanceManager."); - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackageHelper.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackageHelper.java index eb38ced52e1ca0..d95d433c55495f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackageHelper.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackageHelper.java @@ -33,14 +33,8 @@ static Iterable getNativeModuleIterator( ReactConstants.TAG, reactPackage.getClass().getSimpleName() + " is not a LazyReactPackage, falling back to old version."); - final List nativeModules; - if (reactPackage instanceof ReactInstancePackage) { - ReactInstancePackage reactInstancePackage = (ReactInstancePackage) reactPackage; - nativeModules = - reactInstancePackage.createNativeModules(reactApplicationContext, reactInstanceManager); - } else { - nativeModules = reactPackage.createNativeModules(reactApplicationContext); - } + final List nativeModules = + reactPackage.createNativeModules(reactApplicationContext); return () -> new Iterator() { int position = 0; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.java index 1424264ae8bdf5..ac9004ee885dc0 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.java @@ -85,11 +85,6 @@ protected ReactPackageTurboModuleManagerDelegate( continue; } - if (shouldSupportLegacyPackages() && reactPackage instanceof ReactInstancePackage) { - // TODO(T145105887): Output error that ReactPackage was used - continue; - } - if (shouldSupportLegacyPackages()) { // TODO(T145105887): Output warnings that ReactPackage was used final List nativeModules =