Skip to content

Commit

Permalink
Re-introduce the deprecated constructor on ReactModuleInfo (#48090)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cortinico authored and facebook-github-bot committed Dec 4, 2024
1 parent 50d0157 commit 734730d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -2956,6 +2956,7 @@ public abstract interface annotation class com/facebook/react/module/annotations
public final class com/facebook/react/module/model/ReactModuleInfo {
public static final field Companion Lcom/facebook/react/module/model/ReactModuleInfo$Companion;
public fun <init> (Ljava/lang/String;Ljava/lang/String;ZZZZ)V
public fun <init> (Ljava/lang/String;Ljava/lang/String;ZZZZZ)V
public final fun canOverrideExistingModule ()Z
public static final fun classIsTurboModule (Ljava/lang/Class;)Z
public final fun className ()Ljava/lang/String;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@ public class ReactModuleInfo(
public val isCxxModule: Boolean,
public val isTurboModule: Boolean
) {

@Deprecated(
"This constructor is deprecated and will be removed in the future. Use ReactModuleInfo(String, String, boolean, boolean, boolean, boolean)]",
replaceWith =
ReplaceWith(
expression =
"ReactModuleInfo(name, className, canOverrideExistingModule, needsEagerInit, isCxxModule, isTurboModule)"),
level = DeprecationLevel.WARNING)
public constructor(
name: String,
className: String,
canOverrideExistingModule: Boolean,
needsEagerInit: Boolean,
@Suppress("UNUSED_PARAMETER") hasConstants: Boolean,
isCxxModule: Boolean,
isTurboModule: Boolean
) : this(name, className, canOverrideExistingModule, needsEagerInit, isCxxModule, isTurboModule)

public companion object {
/**
* Checks if the passed class is a TurboModule. Useful to populate the parameter [isTurboModule]
Expand Down

0 comments on commit 734730d

Please sign in to comment.