Skip to content

Commit 6cde3df

Browse files
cortinicoblakef
authored andcommitted
Re-introduce the deprecated constructor on ReactModuleInfo (#48090)
Summary: Pull Request resolved: #48090 This alleviates a breaking change on `ReactModuleInfo` constructor. While the ctor was deprecated, we realized that there are more than 250 usages in OSS. We'll need to properly communicate this removal before we do it. Changelog: [Android] [Fixed] - Re-introduce the deprecated constructor on ReactModuleInfo Reviewed By: cipolleschi Differential Revision: D66755541 fbshipit-source-id: 3673d8f2af278d55491cea89f1594d368513e3d8
1 parent 19bff65 commit 6cde3df

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2963,6 +2963,7 @@ public abstract interface annotation class com/facebook/react/module/annotations
29632963
public final class com/facebook/react/module/model/ReactModuleInfo {
29642964
public static final field Companion Lcom/facebook/react/module/model/ReactModuleInfo$Companion;
29652965
public fun <init> (Ljava/lang/String;Ljava/lang/String;ZZZZ)V
2966+
public fun <init> (Ljava/lang/String;Ljava/lang/String;ZZZZZ)V
29662967
public final fun canOverrideExistingModule ()Z
29672968
public static final fun classIsTurboModule (Ljava/lang/Class;)Z
29682969
public final fun className ()Ljava/lang/String;

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfo.kt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,24 @@ public class ReactModuleInfo(
2121
public val isCxxModule: Boolean,
2222
public val isTurboModule: Boolean
2323
) {
24+
25+
@Deprecated(
26+
"This constructor is deprecated and will be removed in the future. Use ReactModuleInfo(String, String, boolean, boolean, boolean, boolean)]",
27+
replaceWith =
28+
ReplaceWith(
29+
expression =
30+
"ReactModuleInfo(name, className, canOverrideExistingModule, needsEagerInit, isCxxModule, isTurboModule)"),
31+
level = DeprecationLevel.WARNING)
32+
public constructor(
33+
name: String,
34+
className: String,
35+
canOverrideExistingModule: Boolean,
36+
needsEagerInit: Boolean,
37+
@Suppress("UNUSED_PARAMETER") hasConstants: Boolean,
38+
isCxxModule: Boolean,
39+
isTurboModule: Boolean
40+
) : this(name, className, canOverrideExistingModule, needsEagerInit, isCxxModule, isTurboModule)
41+
2442
public companion object {
2543
/**
2644
* Checks if the passed class is a TurboModule. Useful to populate the parameter [isTurboModule]

0 commit comments

Comments
 (0)