Skip to content

Commit

Permalink
Delete ReactInstancePackage (#41095)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #41095

I'm deleting this class becase ReactInstancePackage has been deprecated since 2018 and I analyzed internal meta codebase and OSS codebase and it seems it's not being used.

changelog: [Android][Breaking] Delete ReactInstancePackage

Reviewed By: philIip

Differential Revision: D50338299

fbshipit-source-id: 2824e58ff3bf9d17b605239dd9c9bea0adba93b8
  • Loading branch information
mdvacca authored and facebook-github-bot committed Oct 31, 2023
1 parent 5a57ec8 commit 7141c47
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ public void processPackage(ReactPackage reactPackage) {
((BaseReactPackage) reactPackage).getNativeModuleIterator(mReactApplicationContext);
} else {
moduleHolders =
ReactPackageHelper.getNativeModuleIterator(
reactPackage, mReactApplicationContext, mReactInstanceManager);
ReactPackageHelper.getNativeModuleIterator(reactPackage, mReactApplicationContext);
}

for (ModuleHolder moduleHolder : moduleHolders) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,13 @@ class ReactPackageHelper {
*/
/** package */
static Iterable<ModuleHolder> getNativeModuleIterator(
ReactPackage reactPackage,
ReactApplicationContext reactApplicationContext,
ReactInstanceManager reactInstanceManager) {
ReactPackage reactPackage, ReactApplicationContext reactApplicationContext) {
FLog.d(
ReactConstants.TAG,
reactPackage.getClass().getSimpleName()
+ " is not a LazyReactPackage, falling back to old version.");
final List<NativeModule> nativeModules;
if (reactPackage instanceof ReactInstancePackage) {
ReactInstancePackage reactInstancePackage = (ReactInstancePackage) reactPackage;
nativeModules =
reactInstancePackage.createNativeModules(reactApplicationContext, reactInstanceManager);
} else {
nativeModules = reactPackage.createNativeModules(reactApplicationContext);
}
final List<NativeModule> nativeModules =
reactPackage.createNativeModules(reactApplicationContext);
return () ->
new Iterator<ModuleHolder>() {
int position = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<NativeModule> nativeModules =
Expand Down

0 comments on commit 7141c47

Please sign in to comment.