Skip to content

Commit efdf739

Browse files
cortinicofacebook-github-bot
authored andcommitted
Deprecate the DefaultNewArchitectureEntryPoint.load(Boolean, Boolean, Boolean) (#52439)
Summary: Pull Request resolved: #52439 Users should not be passing true/false values for the 3 params in the `load()` method. The app template already uses the no param overload. I'm deprecating it so it can go in 0.81. Changelog: [Android] [Changed] - Deprecate the DefaultNewArchitectureEntryPoint.load(Boolean, Boolean, Boolean) Reviewed By: rubennorte Differential Revision: D77739268 fbshipit-source-id: c901d1ed2e9623b0fa39f4e2d79f25404c284b8d
1 parent 377baa2 commit efdf739

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,6 +1867,8 @@ public final class com/facebook/react/defaults/DefaultNewArchitectureEntryPoint
18671867
public static final fun load (Z)V
18681868
public static final fun load (ZZ)V
18691869
public static final fun load (ZZZ)V
1870+
public static synthetic fun load$default (ZILjava/lang/Object;)V
1871+
public static synthetic fun load$default (ZZILjava/lang/Object;)V
18701872
public static synthetic fun load$default (ZZZILjava/lang/Object;)V
18711873
public final fun setReleaseLevel (Lcom/facebook/react/common/ReleaseLevel;)V
18721874
}

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

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,47 @@ public object DefaultNewArchitectureEntryPoint {
3333

3434
public var releaseLevel: ReleaseLevel = ReleaseLevel.STABLE
3535

36+
/**
37+
* Loads the React Native New Architecture entry point with the default configuration.
38+
*
39+
* This will load the app with TurboModules, Fabric and Bridgeless by default.
40+
*/
3641
@JvmStatic
37-
@JvmOverloads
42+
public fun load() {
43+
load(turboModulesEnabled = true, fabricEnabled = true, bridgelessEnabled = true)
44+
}
45+
46+
@JvmStatic
47+
@Deprecated(
48+
message =
49+
"Loading the entry point with different flags for Fabric, TurboModule and Bridgeless is deprecated." +
50+
"Please use load() instead when loading the New Architecture.",
51+
replaceWith = ReplaceWith("load()"))
52+
public fun load(
53+
turboModulesEnabled: Boolean = true,
54+
) {
55+
load(turboModulesEnabled, fabricEnabled = true, bridgelessEnabled = true)
56+
}
57+
58+
@JvmStatic
59+
@Deprecated(
60+
message =
61+
"Loading the entry point with different flags for Fabric, TurboModule and Bridgeless is deprecated." +
62+
"Please use load() instead when loading the New Architecture.",
63+
replaceWith = ReplaceWith("load()"))
64+
public fun load(
65+
turboModulesEnabled: Boolean = true,
66+
fabricEnabled: Boolean = true,
67+
) {
68+
load(turboModulesEnabled, fabricEnabled, bridgelessEnabled = true)
69+
}
70+
71+
@JvmStatic
72+
@Deprecated(
73+
message =
74+
"Loading the entry point with different flags for Fabric, TurboModule and Bridgeless is deprecated." +
75+
"Please use load() instead when loading the New Architecture.",
76+
replaceWith = ReplaceWith("load()"))
3877
public fun load(
3978
turboModulesEnabled: Boolean = true,
4079
fabricEnabled: Boolean = true,

0 commit comments

Comments
 (0)