@DeprecatedInNewArchitecture -> @Deprecated (#52399)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52399

I'm raising the deprecation warnings for those methods that are using legacy arch.
Previously the `DeprecatedInNewArchitecture` was not generating warnings for user in their builds, while now the Kotlin's/Java's `DeprecatedInNewArchitecture` it will.

Changelog:
[Android] [Changed] - Introduce more deprecation warnings for Legacy Arch classes

Reviewed By: mdvacca

Differential Revision: D77736713

fbshipit-source-id: bc21729ed8253d3ec6b6a40577bcd76622c3f8a6
This commit is contained in:
Nicola Corti
2025-07-07 10:20:43 -07:00
committed by Facebook GitHub Bot
parent 06034554e4
commit 625f69f284
35 changed files with 125 additions and 77 deletions
@@ -148,6 +148,7 @@ abstract class GeneratePackageListTask : DefaultTask() {
{{ packageImports }}
@SuppressWarnings("deprecation")
public class PackageList {
private Application application;
private ReactNativeHost reactNativeHost;
@@ -233,6 +233,7 @@ class GeneratePackageListTaskTest {
@SuppressWarnings("deprecation")
public class PackageList {
private Application application;
private ReactNativeHost reactNativeHost;
@@ -311,7 +312,8 @@ class GeneratePackageListTaskTest {
import com.facebook.react.aPackage;
// @react-native/another-package
import com.facebook.react.anotherPackage;
@SuppressWarnings("deprecation")
public class PackageList {
private Application application;
private ReactNativeHost reactNativeHost;
@@ -12,7 +12,9 @@ import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ViewManager
@Suppress("DEPRECATION")
public class OSSLibraryExamplePackage : ReactPackage {
@Deprecated("Migrate to [BaseReactPackage] and implement [getModule] instead.")
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> =
listOf(NativeSampleModule(reactContext))
@@ -353,7 +353,7 @@ public abstract class com/facebook/react/ReactNativeHost {
}
public abstract interface class com/facebook/react/ReactPackage {
public abstract fun createNativeModules (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/List;
public fun createNativeModules (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/List;
public abstract fun createViewManagers (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/List;
public fun getModule (Ljava/lang/String;Lcom/facebook/react/bridge/ReactApplicationContext;)Lcom/facebook/react/bridge/NativeModule;
}
@@ -22,6 +22,7 @@ import javax.inject.Provider
/** Abstract class that supports lazy loading of NativeModules by default. */
public abstract class BaseReactPackage : ReactPackage {
@Deprecated("Migrate to [BaseReactPackage] and implement [getModule] instead.")
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
throw UnsupportedOperationException(
"createNativeModules method is not supported. Use getModule() method instead.")
@@ -112,6 +112,7 @@ public abstract class HeadlessJsTaskService : Service(), HeadlessJsTaskEventList
* simply have a different mechanism for storing a `ReactNativeHost`, e.g. as a static field
* somewhere.
*/
@Suppress("DEPRECATION")
protected val reactNativeHost: ReactNativeHost
get() = (application as ReactApplication).reactNativeHost
@@ -92,6 +92,8 @@ public abstract class LazyReactPackage : ReactPackage {
* @param reactContext react application context that can be used to create modules
* @return A [List]<[NativeModule]> to register
*/
@Suppress("DEPRECATION")
@Deprecated("Migrate to [BaseReactPackage] and implement [getModule] instead.")
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> =
buildList {
for (holder in getNativeModules(reactContext)) {
@@ -18,20 +18,22 @@ import android.view.KeyEvent;
import android.view.Window;
import androidx.annotation.Nullable;
import com.facebook.infer.annotation.Assertions;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
import com.facebook.react.interfaces.fabric.ReactSurface;
import com.facebook.react.internal.featureflags.ReactNativeNewArchitectureFeatureFlags;
import com.facebook.react.modules.core.PermissionListener;
import com.facebook.react.views.view.WindowUtilKt;
import com.facebook.systrace.Systrace;
import java.util.Objects;
/**
* Delegate class for {@link ReactActivity}. You can subclass this to provide custom implementations
* for e.g. {@link #getReactNativeHost()}, if your Application class doesn't implement {@link
* ReactApplication}.
*/
@Nullsafe(Nullsafe.Mode.LOCAL)
public class ReactActivityDelegate {
private final @Nullable Activity mActivity;
@@ -86,8 +88,11 @@ public class ReactActivityDelegate {
* ReactApplication#getReactNativeHost()}. Override this method if your application class does not
* implement {@code ReactApplication} or you simply have a different mechanism for storing a
* {@code ReactNativeHost}, e.g. as a static field somewhere.
*
* @deprecated "Do not access {@link ReactNativeHost} directly. This class is going away in the
* New Architecture. You should access {@link ReactHost} instead."
*/
@DeprecatedInNewArchitecture(message = "Use getReactHost()")
@Deprecated
protected ReactNativeHost getReactNativeHost() {
return ((ReactApplication) getPlainActivity().getApplication()).getReactNativeHost();
}
@@ -107,16 +112,21 @@ public class ReactActivityDelegate {
return mReactDelegate;
}
@DeprecatedInNewArchitecture(message = "Use getReactHost()")
/**
* @deprecated @deprecated "Do not access {@link ReactInstanceManager} directly. This class is
* going away in the New Architecture. You should access {@link ReactHost} instead."
* @noinspection deprecation
*/
public ReactInstanceManager getReactInstanceManager() {
return mReactDelegate.getReactInstanceManager();
return Objects.requireNonNull(mReactDelegate).getReactInstanceManager();
}
@Nullable
public String getMainComponentName() {
return mMainComponentName;
}
public void onCreate(Bundle savedInstanceState) {
public void onCreate(@Nullable Bundle savedInstanceState) {
Systrace.traceSection(
Systrace.TRACE_TAG_REACT,
"ReactActivityDelegate.onCreate::init",
@@ -147,6 +157,7 @@ public class ReactActivityDelegate {
launchOptions,
isFabricEnabled()) {
@Override
@Nullable
protected ReactRootView createRootView() {
ReactRootView rootView = ReactActivityDelegate.this.createRootView();
if (rootView == null) {
@@ -162,31 +173,29 @@ public class ReactActivityDelegate {
});
}
protected void loadApp(String appKey) {
mReactDelegate.loadApp(appKey);
protected void loadApp(@Nullable String appKey) {
Objects.requireNonNull(mReactDelegate).loadApp(Objects.requireNonNull(appKey));
getPlainActivity().setContentView(mReactDelegate.getReactRootView());
}
public void setReactSurface(ReactSurface reactSurface) {
mReactDelegate.setReactSurface(reactSurface);
Objects.requireNonNull(mReactDelegate).setReactSurface(reactSurface);
}
public void setReactRootView(ReactRootView reactRootView) {
mReactDelegate.setReactRootView(reactRootView);
Objects.requireNonNull(mReactDelegate).setReactRootView(reactRootView);
}
public void onUserLeaveHint() {
if (mReactDelegate != null) {
mReactDelegate.onUserLeaveHint();
}
Objects.requireNonNull(mReactDelegate).onUserLeaveHint();
}
public void onPause() {
mReactDelegate.onHostPause();
Objects.requireNonNull(mReactDelegate).onHostPause();
}
public void onResume() {
mReactDelegate.onHostResume();
Objects.requireNonNull(mReactDelegate).onHostResume();
if (mPermissionsCallback != null) {
mPermissionsCallback.invoke();
@@ -195,43 +204,43 @@ public class ReactActivityDelegate {
}
public void onDestroy() {
mReactDelegate.onHostDestroy();
Objects.requireNonNull(mReactDelegate).onHostDestroy();
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
mReactDelegate.onActivityResult(requestCode, resultCode, data, true);
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
Objects.requireNonNull(mReactDelegate).onActivityResult(requestCode, resultCode, data, true);
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
return mReactDelegate.onKeyDown(keyCode, event);
return Objects.requireNonNull(mReactDelegate).onKeyDown(keyCode, event);
}
public boolean onKeyUp(int keyCode, KeyEvent event) {
return mReactDelegate.shouldShowDevMenuOrReload(keyCode, event);
return Objects.requireNonNull(mReactDelegate).shouldShowDevMenuOrReload(keyCode, event);
}
public boolean onKeyLongPress(int keyCode, KeyEvent event) {
return mReactDelegate.onKeyLongPress(keyCode);
return Objects.requireNonNull(mReactDelegate).onKeyLongPress(keyCode);
}
public boolean onBackPressed() {
return mReactDelegate.onBackPressed();
return Objects.requireNonNull(mReactDelegate).onBackPressed();
}
public boolean onNewIntent(Intent intent) {
return mReactDelegate.onNewIntent(intent);
public boolean onNewIntent(@Nullable Intent intent) {
return Objects.requireNonNull(mReactDelegate).onNewIntent(Objects.requireNonNull(intent));
}
public void onWindowFocusChanged(boolean hasFocus) {
mReactDelegate.onWindowFocusChanged(hasFocus);
Objects.requireNonNull(mReactDelegate).onWindowFocusChanged(hasFocus);
}
public void onConfigurationChanged(Configuration newConfig) {
mReactDelegate.onConfigurationChanged(newConfig);
Objects.requireNonNull(mReactDelegate).onConfigurationChanged(newConfig);
}
public void requestPermissions(
String[] permissions, int requestCode, PermissionListener listener) {
String[] permissions, int requestCode, @Nullable PermissionListener listener) {
mPermissionListener = listener;
getPlainActivity().requestPermissions(permissions, requestCode);
}
@@ -267,7 +276,7 @@ public class ReactActivityDelegate {
* context will no longer be valid.
*/
public @Nullable ReactContext getCurrentReactContext() {
return mReactDelegate.getCurrentReactContext();
return Objects.requireNonNull(mReactDelegate).getCurrentReactContext();
}
/**
@@ -10,6 +10,10 @@ package com.facebook.react
/** Interface that represents an instance of a React Native application */
public interface ReactApplication {
/** Get the default [ReactNativeHost] for this app. */
@Suppress("DEPRECATION")
@Deprecated(
"You should not use ReactNativeHost directly in the New Architecture. Use ReactHost instead.",
ReplaceWith("reactHost"))
public val reactNativeHost: ReactNativeHost
/**
@@ -14,7 +14,6 @@ import android.os.Bundle
import android.view.KeyEvent
import com.facebook.react.bridge.ReactContext
import com.facebook.react.bridge.UiThreadUtil.runOnUiThread
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
import com.facebook.react.devsupport.DoubleTapReloadRecognizer
import com.facebook.react.devsupport.ReleaseDevSupportManager
import com.facebook.react.devsupport.interfaces.DevSupportManager
@@ -26,12 +25,17 @@ import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler
* A delegate for handling React Application support. This delegate is unaware whether it is used in
* an [Activity] or a [android.app.Fragment].
*/
@Suppress("DEPRECATION")
public open class ReactDelegate {
private val activity: Activity
private var internalReactRootView: ReactRootView? = null
private val mainComponentName: String?
private var launchOptions: Bundle?
private var doubleTapReloadRecognizer: DoubleTapReloadRecognizer?
@Deprecated(
"You should not use ReactNativeHost directly in the New Architecture. Use ReactHost instead.",
ReplaceWith("reactHost"))
private var reactNativeHost: ReactNativeHost? = null
public var reactHost: ReactHost? = null
private set
@@ -380,7 +384,8 @@ public open class ReactDelegate {
return false
}
@DeprecatedInNewArchitecture(message = "Use reactHost")
@Deprecated(
"Do not access [ReactInstanceManager] directly. This class is going away in the New Architecture. You should use [ReactHost] instead.")
public fun getReactInstanceManager(): ReactInstanceManager {
val nonNullReactNativeHost =
checkNotNull(reactNativeHost) {
@@ -58,6 +58,10 @@ public open class ReactFragment : Fragment(), PermissionAwareActivity {
* method if your application class does not implement `ReactApplication` or you simply have a
* different mechanism for storing a `ReactNativeHost`, e.g. as a static field somewhere.
*/
@Suppress("DEPRECATION")
@Deprecated(
"You should not use ReactNativeHost directly in the New Architecture. Use ReactHost instead.",
ReplaceWith("reactHost"))
protected open val reactNativeHost: ReactNativeHost?
get() = (activity?.application as ReactApplication?)?.reactNativeHost
@@ -10,6 +10,7 @@ package com.facebook.react;
import android.app.Application;
import androidx.annotation.Nullable;
import com.facebook.infer.annotation.Assertions;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.react.bridge.JSExceptionHandler;
import com.facebook.react.bridge.JavaScriptExecutorFactory;
import com.facebook.react.bridge.ReactMarker;
@@ -18,7 +19,6 @@ import com.facebook.react.bridge.UIManagerProvider;
import com.facebook.react.common.LifecycleState;
import com.facebook.react.common.SurfaceDelegate;
import com.facebook.react.common.SurfaceDelegateFactory;
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
import com.facebook.react.common.annotations.internal.LegacyArchitecture;
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel;
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
@@ -32,12 +32,12 @@ import java.util.List;
/**
* Simple class that holds an instance of {@link ReactInstanceManager}. This can be used in your
* {@link Application class} (see {@link ReactApplication}), or as a static field.
*
* @deprecated This class will be replaced by com.facebook.react.ReactHost in the New Architecture.
*/
@DeprecatedInNewArchitecture(
message =
"This class will be replaced by com.facebook.react.ReactHost in the new architecture of"
+ " React Native.")
@Deprecated
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
@Nullsafe(Nullsafe.Mode.LOCAL)
public abstract class ReactNativeHost {
static {
@@ -10,7 +10,6 @@ package com.facebook.react
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.UIManager
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
import com.facebook.react.common.annotations.StableReactNativeAPI
import com.facebook.react.uimanager.ViewManager
@@ -34,8 +33,9 @@ public interface ReactPackage {
* @return list of native modules to register with the newly created catalyst instance This method
* is deprecated in the new Architecture of React Native.
*/
@DeprecatedInNewArchitecture(message = "Migrate to BaseReactPackage and implement getModule")
public fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule>
@Deprecated(message = "Migrate to [BaseReactPackage] and implement [getModule] instead.")
public fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> =
emptyList()
/** @return a list of view managers that should be registered with [UIManager] */
public fun createViewManagers(
@@ -28,6 +28,7 @@ internal object ReactPackageHelper {
FLog.d(
ReactConstants.TAG,
"${reactPackage.javaClass.simpleName} is not a LazyReactPackage, falling back to old version.")
@Suppress("DEPRECATION")
val nativeModules = reactPackage.createNativeModules(reactApplicationContext)
return Iterable {
object : Iterator<ModuleHolder> {
@@ -83,6 +83,7 @@ public abstract class ReactPackageTurboModuleManagerDelegate : TurboModuleManage
if (shouldSupportLegacyPackages()) {
// TODO(T145105887): Output warnings that ReactPackage was used
@Suppress("DEPRECATION")
val nativeModules = reactPackage.createNativeModules(reactApplicationContext)
val moduleMap: MutableMap<String, NativeModule> = mutableMapOf()
@@ -94,6 +95,7 @@ public abstract class ReactPackageTurboModuleManagerDelegate : TurboModuleManage
val moduleName = reactModule?.name ?: module.name
@Suppress("DEPRECATION")
val moduleInfo: ReactModuleInfo =
if (reactModule != null)
ReactModuleInfo(
@@ -16,7 +16,6 @@ import com.facebook.infer.annotation.Nullsafe;
import com.facebook.infer.annotation.ThreadConfined;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
import com.facebook.react.common.annotations.StableReactNativeAPI;
import com.facebook.react.common.build.ReactBuildConfig;
import java.util.Map;
@@ -72,7 +71,6 @@ public abstract class BaseJavaModule implements NativeModule {
/**
* @return a map of constants this module exports to JS. Supports JSON types.
*/
@DeprecatedInNewArchitecture()
public @Nullable Map<String, Object> getConstants() {
return null;
}
@@ -14,11 +14,11 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.facebook.common.logging.FLog;
import com.facebook.infer.annotation.Assertions;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.infer.annotation.ThreadConfined;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.queue.ReactQueueConfiguration;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
import com.facebook.react.common.annotations.FrameworkAPI;
import com.facebook.react.common.annotations.UnstableReactNativeAPI;
import com.facebook.react.common.annotations.VisibleForTesting;
@@ -27,16 +27,21 @@ import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder;
import java.util.Collection;
import java.util.Objects;
/**
* This is the bridge-specific concrete subclass of ReactContext. ReactContext has many methods that
* delegate to the react instance. This subclass implements those methods, by delegating to the
* CatalystInstance. If you need to create a ReactContext within an "bridge context", please create
* BridgeReactContext.
*
* @deprecated This class is deprecated in the New Architecture and will be replaced by {@link
* com.facebook.react.runtime.BridgelessReactContext}
*/
@DeprecatedInNewArchitecture
@VisibleForTesting
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
@Deprecated
@Nullsafe(Nullsafe.Mode.LOCAL)
public class BridgeReactContext extends ReactApplicationContext {
static {
LegacyArchitectureLogger.assertLegacyArchitecture(
@@ -119,6 +124,7 @@ public class BridgeReactContext extends ReactApplicationContext {
if (mCatalystInstance == null) {
raiseCatalystInstanceMissingException();
}
Assertions.assertNotNull(mCatalystInstance);
return mCatalystInstance.hasNativeModule(nativeModuleInterface);
}
@@ -127,6 +133,7 @@ public class BridgeReactContext extends ReactApplicationContext {
if (mCatalystInstance == null) {
raiseCatalystInstanceMissingException();
}
Assertions.assertNotNull(mCatalystInstance);
return mCatalystInstance.getNativeModules();
}
@@ -139,6 +146,7 @@ public class BridgeReactContext extends ReactApplicationContext {
if (mCatalystInstance == null) {
raiseCatalystInstanceMissingException();
}
Assertions.assertNotNull(mCatalystInstance);
return mCatalystInstance.getNativeModule(nativeModuleInterface);
}
@@ -147,6 +155,7 @@ public class BridgeReactContext extends ReactApplicationContext {
if (mCatalystInstance == null) {
raiseCatalystInstanceMissingException();
}
Assertions.assertNotNull(mCatalystInstance);
return mCatalystInstance.getNativeModule(moduleName);
}
@@ -210,8 +219,7 @@ public class BridgeReactContext extends ReactApplicationContext {
@Override
public void handleException(Exception e) {
boolean catalystInstanceVariableExists = mCatalystInstance != null;
boolean isCatalystInstanceAlive =
catalystInstanceVariableExists && !mCatalystInstance.isDestroyed();
boolean isCatalystInstanceAlive = mCatalystInstance != null && !mCatalystInstance.isDestroyed();
boolean hasExceptionHandler = getJSExceptionHandler() != null;
if (isCatalystInstanceAlive && hasExceptionHandler) {
@@ -268,18 +276,19 @@ public class BridgeReactContext extends ReactApplicationContext {
return null;
}
@DeprecatedInNewArchitecture(
message =
"This method will be deprecated later as part of Stable APIs with bridge removal and not"
+ " encouraged usage.")
/**
* Get the UIManager for Fabric from the CatalystInstance.
*
* @return The UIManager when CatalystInstance is active.
* @deprecated Do not use this method. Instead use {@link
* com.facebook.react.uimanager.UIManagerHelper} method {@code getUIManager} to get the
* UIManager instance from the current ReactContext.
*/
@Override
@Deprecated
public @Nullable UIManager getFabricUIManager() {
return mCatalystInstance.getFabricUIManager();
//noinspection deprecation
return Objects.requireNonNull(mCatalystInstance).getFabricUIManager();
}
/**
@@ -32,6 +32,8 @@ protected constructor(
// do nothing
}
@Deprecated(
"The method canOverrideExistingModule is not used in the New Architecture and will be removed in a future release.")
override fun canOverrideExistingModule(): Boolean = false
override fun invalidate() {
@@ -53,6 +53,7 @@ public class ModuleHolder {
public constructor(nativeModule: NativeModule) {
name = nativeModule.name
@Suppress("DEPRECATION")
reactModuleInfo =
ReactModuleInfo(
nativeModule.name,
@@ -9,7 +9,6 @@ package com.facebook.react.bridge;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
import com.facebook.react.common.annotations.StableReactNativeAPI;
import javax.annotation.Nonnull;
@@ -50,8 +49,11 @@ public interface NativeModule {
* of a different package (such as the core one). Trying to override without returning true from
* this method is considered an error and will throw an exception during initialization. By
* default all modules return false.
*
* @deprecated The method canOverrideExistingModule is not used in the New Architecture and will
* be removed in a future release.
*/
@DeprecatedInNewArchitecture()
@Deprecated
default boolean canOverrideExistingModule() {
return false;
}
@@ -1,16 +0,0 @@
/*
* 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.common.annotations
/**
* Annotates a method or class that will be deprecated once the NewArchitecture is fully released in
* OSS.
*/
@Retention(AnnotationRetention.SOURCE)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
internal annotation class DeprecatedInNewArchitecture(val message: String = "")
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
@file:Suppress("DEPRECATION")
package com.facebook.react.defaults
import android.content.Context
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
@file:Suppress("DEPRECATION")
package com.facebook.react.defaults
import android.app.Application
@@ -53,7 +53,7 @@ public class BlobProvider : ContentProvider() {
var blobModule: BlobModule? = null
val context = context?.applicationContext
if (context is ReactApplication) {
val host = (context as ReactApplication).reactNativeHost
@Suppress("DEPRECATION") val host = (context as ReactApplication).reactNativeHost
val reactContext =
host.reactInstanceManager.currentReactContext
?: throw RuntimeException("No ReactContext associated with BlobProvider")
@@ -10,7 +10,6 @@ package com.facebook.react.uimanager
import android.view.View
import com.facebook.common.logging.FLog
import com.facebook.react.bridge.ReadableArray
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
import com.facebook.react.uimanager.ViewManagersPropertyCache.PropSetter
import java.util.HashMap
@@ -70,8 +69,8 @@ public object ViewManagerPropertyUpdater {
}
}
@DeprecatedInNewArchitecture
@JvmStatic
@Deprecated("Use ViewManager#updateProperties to update a view's properties")
public fun <T : ReactShadowNode<T>> updateProps(node: T, props: ReactStylesDiffMap) {
val setter = findNodeSetter(node.javaClass)
val iterator = props.backingMap.entryIterator
@@ -8,12 +8,10 @@
package com.facebook.react.uimanager.common
import androidx.annotation.IntDef
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
@Retention(AnnotationRetention.SOURCE)
@Suppress("DEPRECATION")
@IntDef(UIManagerType.DEFAULT, UIManagerType.LEGACY, UIManagerType.FABRIC)
@DeprecatedInNewArchitecture
public annotation class UIManagerType {
public companion object {
@Deprecated(
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
@file:Suppress("DEPRECATION")
package com.facebook.react.fabric
import com.facebook.react.bridge.BridgeReactContext
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
@file:Suppress("DEPRECATION")
package com.facebook.react.fabric
import com.facebook.react.ReactRootView
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
@file:Suppress("DEPRECATION")
package com.facebook.react.modules.clipboard
import android.annotation.SuppressLint
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
@file:Suppress("DEPRECATION")
package com.facebook.react.modules.deviceinfo
import com.facebook.react.bridge.BridgeReactContext
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
@file:Suppress("DEPRECATION")
package com.facebook.react.uimanager
import android.view.View.OnFocusChangeListener
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
@file:Suppress("DEPRECATION")
package com.facebook.react.uimanager
import android.view.View
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
@file:Suppress("DEPRECATION")
package com.facebook.react.uimanager
import com.facebook.react.bridge.BridgeReactContext
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
@file:Suppress("DEPRECATION")
package com.facebook.react.uimanager
import android.view.View
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
@file:Suppress("DEPRECATION")
package com.facebook.react.uiapp
import android.app.Application
@@ -37,6 +39,9 @@ import com.facebook.react.views.view.setEdgeToEdgeFeatureFlagOn
import com.facebook.soloader.SoLoader
internal class RNTesterApplication : Application(), ReactApplication {
@Deprecated(
"You should not use ReactNativeHost directly in the New Architecture. Use ReactHost instead.",
replaceWith = ReplaceWith("reactHost"))
override val reactNativeHost: ReactNativeHost by lazy {
object : DefaultReactNativeHost(this) {
public override fun getJSMainModuleName(): String = BuildConfig.JS_MAIN_MODULE_NAME
@@ -86,10 +91,6 @@ internal class RNTesterApplication : Application(), ReactApplication {
}
},
object : ReactPackage, ViewManagerOnDemandReactPackage {
override fun createNativeModules(
reactContext: ReactApplicationContext
): List<NativeModule> = emptyList()
override fun getViewManagerNames(reactContext: ReactApplicationContext) =
listOf("RNTMyNativeView", "RNTMyLegacyNativeView", "RNTReportFullyDrawnView")