From 12afb847325691f4f58d9c468c4264c5429bcaf8 Mon Sep 17 00:00:00 2001 From: David Vacca <515103+mdvacca@users.noreply.github.com> Date: Tue, 3 Oct 2023 15:55:28 -0700 Subject: [PATCH] Move ReactHost to com.facebook.react (#39769) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39769 Move ReactHost to com.facebook.react changelog: [internal] internal Differential Revision: D49834870 fbshipit-source-id: e1a893bc4b323b2ca77374c3b68a4fbaf6855454 --- .../main/java/com/facebook/react/ReactActivityDelegate.java | 1 - .../src/main/java/com/facebook/react/ReactApplication.kt | 1 - .../src/main/java/com/facebook/react/ReactDelegate.java | 1 - .../main/java/com/facebook/react/{interfaces => }/ReactHost.kt | 3 ++- .../main/java/com/facebook/react/defaults/DefaultReactHost.kt | 2 +- .../main/java/com/facebook/react/runtime/ReactHostImpl.java | 2 +- .../app/src/main/java/com/helloworld/MainApplication.kt | 2 +- .../java/com/facebook/react/uiapp/RNTesterApplication.java | 2 +- 8 files changed, 6 insertions(+), 8 deletions(-) rename packages/react-native/ReactAndroid/src/main/java/com/facebook/react/{interfaces => }/ReactHost.kt (98%) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java index 087f3b34df66de..6fe6fdf2f42979 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java @@ -17,7 +17,6 @@ import com.facebook.infer.annotation.Assertions; import com.facebook.react.bridge.Callback; import com.facebook.react.config.ReactFeatureFlags; -import com.facebook.react.interfaces.ReactHost; import com.facebook.react.modules.core.PermissionListener; /** diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactApplication.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactApplication.kt index 3f572fa149eae4..5131e55c4c5a16 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactApplication.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactApplication.kt @@ -8,7 +8,6 @@ package com.facebook.react import com.facebook.react.common.annotations.UnstableReactNativeAPI -import com.facebook.react.interfaces.ReactHost @OptIn(UnstableReactNativeAPI::class) /** Interface that represents an instance of a React Native application */ diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java index de1ca03272207c..fab2a26dde2842 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java @@ -16,7 +16,6 @@ import com.facebook.infer.annotation.Assertions; import com.facebook.react.config.ReactFeatureFlags; import com.facebook.react.devsupport.DoubleTapReloadRecognizer; -import com.facebook.react.interfaces.ReactHost; import com.facebook.react.interfaces.fabric.ReactSurface; import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/interfaces/ReactHost.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactHost.kt similarity index 98% rename from packages/react-native/ReactAndroid/src/main/java/com/facebook/react/interfaces/ReactHost.kt rename to packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactHost.kt index 4c5ef17ae36481..9465464c1c8a7f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/interfaces/ReactHost.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactHost.kt @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -package com.facebook.react.interfaces +package com.facebook.react import android.app.Activity import android.content.Context @@ -15,6 +15,7 @@ import com.facebook.react.bridge.queue.ReactQueueConfiguration import com.facebook.react.common.LifecycleState import com.facebook.react.common.annotations.UnstableReactNativeAPI import com.facebook.react.devsupport.interfaces.DevSupportManager +import com.facebook.react.interfaces.TaskInterface import com.facebook.react.interfaces.fabric.ReactSurface import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHost.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHost.kt index cb8ce917c46680..d727a0bc6e61aa 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHost.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHost.kt @@ -8,11 +8,11 @@ package com.facebook.react.defaults import android.content.Context +import com.facebook.react.ReactHost import com.facebook.react.ReactPackage import com.facebook.react.bridge.JSBundleLoader import com.facebook.react.common.annotations.UnstableReactNativeAPI import com.facebook.react.fabric.ComponentFactory -import com.facebook.react.interfaces.ReactHost import com.facebook.react.interfaces.exceptionmanager.ReactJsExceptionHandler import com.facebook.react.runtime.JSCInstance import com.facebook.react.runtime.ReactHostImpl 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 a06f19d7ee44e8..b8ed249d140798 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 @@ -25,6 +25,7 @@ import com.facebook.infer.annotation.ThreadSafe; import com.facebook.react.JSEngineResolutionAlgorithm; import com.facebook.react.MemoryPressureRouter; +import com.facebook.react.ReactHost; import com.facebook.react.ReactInstanceEventListener; import com.facebook.react.bridge.Callback; import com.facebook.react.bridge.JSBundleLoader; @@ -48,7 +49,6 @@ import com.facebook.react.devsupport.interfaces.DevSupportManager; import com.facebook.react.fabric.ComponentFactory; import com.facebook.react.fabric.FabricUIManager; -import com.facebook.react.interfaces.ReactHost; import com.facebook.react.interfaces.TaskInterface; import com.facebook.react.interfaces.exceptionmanager.ReactJsExceptionHandler; import com.facebook.react.interfaces.fabric.ReactSurface; diff --git a/packages/react-native/template/android/app/src/main/java/com/helloworld/MainApplication.kt b/packages/react-native/template/android/app/src/main/java/com/helloworld/MainApplication.kt index 7314ad2aad3084..1d4c868ed580f9 100644 --- a/packages/react-native/template/android/app/src/main/java/com/helloworld/MainApplication.kt +++ b/packages/react-native/template/android/app/src/main/java/com/helloworld/MainApplication.kt @@ -3,6 +3,7 @@ package com.helloworld import android.app.Application import com.facebook.react.PackageList import com.facebook.react.ReactApplication +import com.facebook.react.ReactHost import com.facebook.react.ReactNativeHost import com.facebook.react.ReactPackage import com.facebook.react.common.annotations.UnstableReactNativeAPI @@ -10,7 +11,6 @@ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load import com.facebook.react.defaults.DefaultReactHost import com.facebook.react.defaults.DefaultReactNativeHost import com.facebook.react.flipper.ReactNativeFlipper -import com.facebook.react.interfaces.ReactHost import com.facebook.soloader.SoLoader @UnstableReactNativeAPI diff --git a/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.java b/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.java index 8bf2493c5a8945..542f8424f8804a 100644 --- a/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.java +++ b/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.java @@ -13,6 +13,7 @@ import com.facebook.fbreact.specs.SampleTurboModule; import com.facebook.react.JSEngineResolutionAlgorithm; import com.facebook.react.ReactApplication; +import com.facebook.react.ReactHost; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.TurboReactPackage; @@ -27,7 +28,6 @@ import com.facebook.react.defaults.DefaultReactNativeHost; import com.facebook.react.fabric.ComponentFactory; import com.facebook.react.flipper.ReactNativeFlipper; -import com.facebook.react.interfaces.ReactHost; import com.facebook.react.interfaces.exceptionmanager.ReactJsExceptionHandler; import com.facebook.react.module.model.ReactModuleInfo; import com.facebook.react.module.model.ReactModuleInfoProvider;