diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api index 8708804f63c0..95a02e8acd17 100644 --- a/packages/react-native/ReactAndroid/api/ReactAndroid.api +++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api @@ -1865,13 +1865,9 @@ public final class com/facebook/react/defaults/DefaultReactHost { public static final fun getDefaultReactHost (Landroid/content/Context;Lcom/facebook/react/ReactNativeHost;Lcom/facebook/react/runtime/JSRuntimeFactory;)Lcom/facebook/react/ReactHost; public static final fun getDefaultReactHost (Landroid/content/Context;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/runtime/JSRuntimeFactory;ZLjava/util/List;)Lcom/facebook/react/ReactHost; public static final fun getDefaultReactHost (Landroid/content/Context;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/runtime/JSRuntimeFactory;ZLjava/util/List;Lkotlin/jvm/functions/Function1;Lcom/facebook/react/runtime/BindingsInstaller;)Lcom/facebook/react/ReactHost; - public static final fun getDefaultReactHost (Landroid/content/Context;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/util/List;)Lcom/facebook/react/ReactHost; - public static final fun getDefaultReactHost (Landroid/content/Context;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/util/List;Lkotlin/jvm/functions/Function1;Lcom/facebook/react/runtime/BindingsInstaller;)Lcom/facebook/react/ReactHost; public static synthetic fun getDefaultReactHost$default (Landroid/content/Context;Lcom/facebook/react/ReactNativeHost;Lcom/facebook/react/runtime/JSRuntimeFactory;ILjava/lang/Object;)Lcom/facebook/react/ReactHost; public static synthetic fun getDefaultReactHost$default (Landroid/content/Context;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/runtime/JSRuntimeFactory;ZLjava/util/List;ILjava/lang/Object;)Lcom/facebook/react/ReactHost; public static synthetic fun getDefaultReactHost$default (Landroid/content/Context;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/runtime/JSRuntimeFactory;ZLjava/util/List;Lkotlin/jvm/functions/Function1;Lcom/facebook/react/runtime/BindingsInstaller;ILjava/lang/Object;)Lcom/facebook/react/ReactHost; - public static synthetic fun getDefaultReactHost$default (Landroid/content/Context;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/util/List;ILjava/lang/Object;)Lcom/facebook/react/ReactHost; - public static synthetic fun getDefaultReactHost$default (Landroid/content/Context;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/util/List;Lkotlin/jvm/functions/Function1;Lcom/facebook/react/runtime/BindingsInstaller;ILjava/lang/Object;)Lcom/facebook/react/ReactHost; } public abstract class com/facebook/react/defaults/DefaultReactNativeHost : com/facebook/react/ReactNativeHost { 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 bc11a5791a34..712f29cd03cd 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 @@ -154,129 +154,6 @@ public object DefaultReactHost { return reactHost as ReactHost } - /** - * Util function to create a default [ReactHost] to be used in your application. This method is - * used by the New App template. - * - * @param context the Android [Context] to use for creating the [ReactHost] - * @param packageList the list of [ReactPackage]s to use for creating the [ReactHost] - * @param jsMainModulePath the path to your app's main module on Metro. Usually `index` or - * `index.` - * @param jsBundleAssetPath the path to the JS bundle relative to the assets directory. Will be - * composed in a `asset://...` URL - * @param jsBundleFilePath the path to the JS bundle on the filesystem. Will be composed in a - * `file://...` URL - * @param isHermesEnabled whether to use Hermes as the JS engine, default to true. - * @param useDevSupport whether to enable dev support, default to ReactBuildConfig.DEBUG. - * @param cxxReactPackageProviders a list of cxxreactpackage providers (to register c++ turbo - * modules) - * @param exceptionHandler Callback that can be used by React Native host applications to react to - * exceptions thrown by the internals of React Native. - * @param bindingsInstaller that can be used for installing bindings. - */ - @Deprecated( - message = "Use `getDefaultReactHost` with `jsRuntimeFactory` instead", - replaceWith = - ReplaceWith( - """ - fun getDefaultReactHost( - context: Context, - packageList: List, - jsMainModulePath: String, - jsBundleAssetPath: String, - jsBundleFilePath: String?, - jsRuntimeFactory: JSRuntimeFactory?, - useDevSupport: Boolean, - cxxReactPackageProviders: List<(ReactContext) -> CxxReactPackage>, - exceptionHandler: (Exception) -> Unit, - bindingsInstaller: BindingsInstaller?, - ): ReactHost - """ - ), - ) - @JvmStatic - public fun getDefaultReactHost( - context: Context, - packageList: List, - jsMainModulePath: String = "index", - jsBundleAssetPath: String = "index", - jsBundleFilePath: String? = null, - isHermesEnabled: Boolean = true, - useDevSupport: Boolean = ReactBuildConfig.DEBUG, - cxxReactPackageProviders: List<(ReactContext) -> CxxReactPackage> = emptyList(), - exceptionHandler: (Exception) -> Unit = { throw it }, - bindingsInstaller: BindingsInstaller? = null, - ): ReactHost = - getDefaultReactHost( - context, - packageList, - jsMainModulePath, - jsBundleAssetPath, - jsBundleFilePath, - HermesInstance(), - useDevSupport, - cxxReactPackageProviders, - exceptionHandler, - bindingsInstaller, - ) - - /** - * Util function to create a default [ReactHost] to be used in your application. This method is - * used by the New App template. - * - * @param context the Android [Context] to use for creating the [ReactHost] - * @param packageList the list of [ReactPackage]s to use for creating the [ReactHost] - * @param jsMainModulePath the path to your app's main module on Metro. Usually `index` or - * `index.` - * @param jsBundleAssetPath the path to the JS bundle relative to the assets directory. Will be - * composed in a `asset://...` URL - * @param jsBundleFilePath the path to the JS bundle on the filesystem. Will be composed in a - * `file://...` URL - * @param isHermesEnabled whether to use Hermes as the JS engine, default to true. - * @param useDevSupport whether to enable dev support, default to ReactBuildConfig.DEBUG. - * @param cxxReactPackageProviders a list of cxxreactpackage providers (to register c++ turbo - * modules) - */ - @Deprecated( - message = "Use `getDefaultReactHost` with `jsRuntimeFactory` instead", - replaceWith = - ReplaceWith( - """ - fun getDefaultReactHost( - context: Context, - packageList: List, - jsMainModulePath: String, - jsBundleAssetPath: String, - jsBundleFilePath: String?, - jsRuntimeFactory: JSRuntimeFactory?, - useDevSupport: Boolean, - cxxReactPackageProviders: List<(ReactContext) -> CxxReactPackage>, - ): ReactHost - """ - ), - ) - @JvmStatic - public fun getDefaultReactHost( - context: Context, - packageList: List, - jsMainModulePath: String = "index", - jsBundleAssetPath: String = "index", - jsBundleFilePath: String? = null, - isHermesEnabled: Boolean = true, - useDevSupport: Boolean = ReactBuildConfig.DEBUG, - cxxReactPackageProviders: List<(ReactContext) -> CxxReactPackage> = emptyList(), - ): ReactHost = - getDefaultReactHost( - context, - packageList, - jsMainModulePath, - jsBundleAssetPath, - jsBundleFilePath, - HermesInstance(), - useDevSupport, - cxxReactPackageProviders, - ) - /** * Util function to create a default [ReactHost] to be used in your application. This method is * used by the New App template.