From d663fc4397ee527334f44d3ce10b7cb7797a7a29 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Mon, 2 Dec 2024 07:30:52 -0800 Subject: [PATCH] Restore deprecated TurboReactPackage (#48039) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/48039 This class was removed in D66127067 but was marked as DeprecatedInNewArchitecture and not Deprecated, which limited the signal we gave to developers to move away from this. Restore for now to e Changelog: [Android][Fixed] Reverted removal of TurboReactPackage Reviewed By: rshest Differential Revision: D66648209 fbshipit-source-id: 165f9390b4874e69353612b929d87b0c495588af --- .../react-native/ReactAndroid/api/ReactAndroid.api | 4 ++++ .../java/com/facebook/react/TurboReactPackage.kt | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/TurboReactPackage.kt diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api index 7b8c4765447..40b45f3bd7d 100644 --- a/packages/react-native/ReactAndroid/api/ReactAndroid.api +++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api @@ -426,6 +426,10 @@ public abstract interface class com/facebook/react/ReactRootView$ReactRootViewEv public abstract fun onAttachedToReactInstance (Lcom/facebook/react/ReactRootView;)V } +public abstract class com/facebook/react/TurboReactPackage : com/facebook/react/BaseReactPackage { + public fun ()V +} + public abstract interface class com/facebook/react/ViewManagerOnDemandReactPackage { public abstract fun createViewManager (Lcom/facebook/react/bridge/ReactApplicationContext;Ljava/lang/String;)Lcom/facebook/react/uimanager/ViewManager; public abstract fun getViewManagerNames (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/Collection; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/TurboReactPackage.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/TurboReactPackage.kt new file mode 100644 index 00000000000..4eaad3421a0 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/TurboReactPackage.kt @@ -0,0 +1,13 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package com.facebook.react + +@Deprecated( + message = "Use BaseReactPackage instead", + replaceWith = ReplaceWith(expression = "BaseReactPackage")) +public abstract class TurboReactPackage : BaseReactPackage() {}