Skip to content

Commit d35ddb5

Browse files
cortinicofacebook-github-bot
authored andcommitted
Delete unused DefaultReactHost.getDefaultReactHost() overload (#53396)
Summary: Pull Request resolved: #53396 This overload for `getDefaultReactHost` is missing the last 2 parameters and provides the same default as the full method. In OSS is unused as we used the one with `ReactNativeHost`. I'm removing it as it's causing an overload resolution failure internally. This won't be a breaking change for Kotlin users are the signatures are compatibles, but it will be breaking for Java users. I've verified that there are no OSS users. Developers should use Kotlin default parameters + the method `getDefaultReactHost()` with all the params + defaults for ease of use of this API. Changelog: [Android] [Removed] - Delete unused `DefaultReactHost.getDefaultReactHost()` overload Reviewed By: mdvacca Differential Revision: D80704987 fbshipit-source-id: 0b3a61aad3f18cde77bac78e3ba413d7f9166ede
1 parent 8e514a8 commit d35ddb5

File tree

2 files changed

+0
-46
lines changed

2 files changed

+0
-46
lines changed

packages/react-native/ReactAndroid/api/ReactAndroid.api

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,10 +1863,8 @@ public class com/facebook/react/defaults/DefaultReactActivityDelegate : com/face
18631863
public final class com/facebook/react/defaults/DefaultReactHost {
18641864
public static final field INSTANCE Lcom/facebook/react/defaults/DefaultReactHost;
18651865
public static final fun getDefaultReactHost (Landroid/content/Context;Lcom/facebook/react/ReactNativeHost;Lcom/facebook/react/runtime/JSRuntimeFactory;)Lcom/facebook/react/ReactHost;
1866-
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;
18671866
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;
18681867
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;
1869-
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;
18701868
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;
18711869
}
18721870

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHost.kt

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -35,50 +35,6 @@ import java.lang.Exception
3535
public object DefaultReactHost {
3636
private var reactHost: ReactHost? = null
3737

38-
/**
39-
* Util function to create a default [ReactHost] to be used in your application. This method is
40-
* used by the New App template.
41-
*
42-
* @param context the Android [Context] to use for creating the [ReactHost]
43-
* @param packageList the list of [ReactPackage]s to use for creating the [ReactHost]
44-
* @param jsMainModulePath the path to your app's main module on Metro. Usually `index` or
45-
* `index.<platform>`
46-
* @param jsBundleAssetPath the path to the JS bundle relative to the assets directory. Will be
47-
* composed in a `asset://...` URL
48-
* @param jsBundleFilePath the path to the JS bundle on the filesystem. Will be composed in a
49-
* `file://...` URL
50-
* @param jsRuntimeFactory the JS engine to use for executing [ReactHost], default to Hermes.
51-
* @param useDevSupport whether to enable dev support, default to ReactBuildConfig.DEBUG.
52-
* @param cxxReactPackageProviders a list of cxxreactpackage providers (to register c++ turbo
53-
* modules)
54-
*
55-
* TODO(T186951312): Should this be @UnstableReactNativeAPI?
56-
*/
57-
@OptIn(UnstableReactNativeAPI::class)
58-
@JvmStatic
59-
public fun getDefaultReactHost(
60-
context: Context,
61-
packageList: List<ReactPackage>,
62-
jsMainModulePath: String = "index",
63-
jsBundleAssetPath: String = "index",
64-
jsBundleFilePath: String? = null,
65-
jsRuntimeFactory: JSRuntimeFactory? = null,
66-
useDevSupport: Boolean = ReactBuildConfig.DEBUG,
67-
cxxReactPackageProviders: List<(ReactContext) -> CxxReactPackage> = emptyList(),
68-
): ReactHost =
69-
getDefaultReactHost(
70-
context,
71-
packageList,
72-
jsMainModulePath,
73-
jsBundleAssetPath,
74-
jsBundleFilePath,
75-
jsRuntimeFactory,
76-
useDevSupport,
77-
cxxReactPackageProviders,
78-
{ throw it },
79-
null,
80-
)
81-
8238
/**
8339
* Util function to create a default [ReactHost] to be used in your application. This method is
8440
* used by the New App template.

0 commit comments

Comments
 (0)