From 812d29d9b61ed528b28bff3d2f11dc0dbd0bb35b Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 19 Oct 2023 09:25:00 -0700 Subject: [PATCH 1/3] Reduce visibility of DebugCorePackage (#41014) Summary: DebugCorePackage is only used from com.facebook.react, there are no interesting usages internally at Meta or in OSS, so I'm reducing the visibility to package. bypass-github-export-checks changelog: [Android][Breaking] Reducing visibility of DebugCorePackage Reviewed By: christophpurrer Differential Revision: D50338294 --- .../src/main/java/com/facebook/react/DebugCorePackage.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/DebugCorePackage.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/DebugCorePackage.java index 7381eb0ee1f74b..0168fce4f5ba7f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/DebugCorePackage.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/DebugCorePackage.java @@ -36,7 +36,8 @@ nativeModules = { JSCHeapCapture.class, }) -public class DebugCorePackage extends TurboReactPackage implements ViewManagerOnDemandReactPackage { +/* package */ +class DebugCorePackage extends TurboReactPackage implements ViewManagerOnDemandReactPackage { private @Nullable Map mViewManagers; public DebugCorePackage() {} From 357b4294415dfcedd238b3e3a4d9c72fe34f1637 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 19 Oct 2023 09:25:00 -0700 Subject: [PATCH 2/3] Deprecate CompositeReactPackageTurboModuleManagerDelegate Summary: Deprecate CompositeReactPackageTurboModuleManagerDelegate bypass-github-export-checks changelog: [Android][Changed] Deprecate CompositeReactPackageTurboModuleManagerDelegate Reviewed By: RSNara Differential Revision: D50338303 --- .../react/CompositeReactPackageTurboModuleManagerDelegate.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/CompositeReactPackageTurboModuleManagerDelegate.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/CompositeReactPackageTurboModuleManagerDelegate.java index aebaa4cba4dde2..89d695a24d92df 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/CompositeReactPackageTurboModuleManagerDelegate.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/CompositeReactPackageTurboModuleManagerDelegate.java @@ -16,6 +16,9 @@ import java.util.Collections; import java.util.List; +@Deprecated( + since = + "CompositeReactPackageTurboModuleManagerDelegate is deprecated and will be deleted in the future. Please use ReactPackage interface or BaseReactPackage instead.") @DoNotStrip public class CompositeReactPackageTurboModuleManagerDelegate extends ReactPackageTurboModuleManagerDelegate { From 0c39d410ee0f942ca52af1e61a726e2262efc701 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 19 Oct 2023 09:25:00 -0700 Subject: [PATCH 3/3] Fix logging of error in MainReactPackage.getReactModuleInfoProvider() Summary: This was probably caused by a copy paste, I'm fixing the log message to describe the proper class. bypass-github-export-checks changelog: [internal] internal Reviewed By: RSNara Differential Revision: D50338296 --- .../java/com/facebook/react/shell/MainReactPackage.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java index 729694dd9b5996..dac68508acaa0f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java @@ -303,10 +303,12 @@ public ReactModuleInfoProvider getReactModuleInfoProvider() { return () -> reactModuleInfoMap; } catch (InstantiationException e) { throw new RuntimeException( - "No ReactModuleInfoProvider for CoreModulesPackage$$ReactModuleInfoProvider", e); + "No ReactModuleInfoProvider for com.facebook.react.shell.MainReactPackage$$ReactModuleInfoProvider", + e); } catch (IllegalAccessException e) { throw new RuntimeException( - "No ReactModuleInfoProvider for CoreModulesPackage$$ReactModuleInfoProvider", e); + "No ReactModuleInfoProvider for com.facebook.react.shell.MainReactPackage$$ReactModuleInfoProvider", + e); } } }