From 73b4d67a78e003d62c660cf3c710e01b29512c4a Mon Sep 17 00:00:00 2001 From: Arushi Kesarwani Date: Fri, 19 Apr 2024 11:54:36 -0700 Subject: [PATCH] Delete deprecated JSIModule methods (#42115) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/42115 React Native Android had a concept called JSIModules, which iOS doesn't have. The JSIModule concept was introduced in the early stages of the Fabric project to represent modules that interact with JS through JSI and they are not NativeModules. In the new architecture this concept is not really necessary and these interfaces were only used to initialize and destroy the Fabric renderer and TurboModule Manager in react native core. Bridgeless mode doesn’t use JSIModule anymore. Also, it has an explicit list of supported JSI module types, so is not open for extension. In order to simplify RN concepts and reduce confusion with TurboModules, which also "use JSI", deleting everything related to JSIModule. This was already deprecated in 0.74.0. Please use ReactInstanceEventListener to subscribe for react instance events instead of getJSIModule() and we recommend using TurboModules instead of JSIModules. Changelog: [General][Breaking] Delete JSIModule Reviewed By: javache, cortinico Differential Revision: D49597702 fbshipit-source-id: bc2bc190aafaf559336b341b50ffabf413474105 --- .../ReactAndroid/api/ReactAndroid.api | 34 ------------- .../react/bridge/CatalystInstance.java | 18 ------- .../react/bridge/CatalystInstanceImpl.java | 18 ------- .../com/facebook/react/bridge/JSIModule.java | 22 --------- .../react/bridge/JSIModuleHolder.java | 37 -------------- .../react/bridge/JSIModulePackage.java | 20 -------- .../react/bridge/JSIModuleProvider.java | 13 ----- .../react/bridge/JSIModuleRegistry.java | 48 ------------------- .../facebook/react/bridge/JSIModuleSpec.java | 16 ------- .../facebook/react/bridge/JSIModuleType.java | 17 ------- .../facebook/react/bridge/ReactContext.java | 5 +- .../runtime/BridgelessCatalystInstance.kt | 23 --------- 12 files changed, 1 insertion(+), 270 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModule.java delete mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleHolder.java delete mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModulePackage.java delete mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleProvider.java delete mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleRegistry.java delete mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleSpec.java delete mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleType.java diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api index 80a974c6521ae8..94336f09c0924a 100644 --- a/packages/react-native/ReactAndroid/api/ReactAndroid.api +++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api @@ -561,13 +561,11 @@ public final class com/facebook/react/bridge/CallbackImpl : com/facebook/react/b public abstract interface class com/facebook/react/bridge/CatalystInstance : com/facebook/react/bridge/JSBundleLoaderDelegate, com/facebook/react/bridge/JSInstance, com/facebook/react/bridge/MemoryPressureListener { public abstract fun addBridgeIdleDebugListener (Lcom/facebook/react/bridge/NotThreadSafeBridgeIdleDebugListener;)V - public abstract fun addJSIModules (Ljava/util/List;)V public abstract fun callFunction (Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/NativeArray;)V public abstract fun destroy ()V public abstract fun extendNativeModules (Lcom/facebook/react/bridge/NativeModuleRegistry;)V public abstract fun getFabricUIManager ()Lcom/facebook/react/bridge/UIManager; public abstract fun getJSCallInvokerHolder ()Lcom/facebook/react/turbomodule/core/interfaces/CallInvokerHolder; - public abstract fun getJSIModule (Lcom/facebook/react/bridge/JSIModuleType;)Lcom/facebook/react/bridge/JSIModule; public abstract fun getJSModule (Ljava/lang/Class;)Lcom/facebook/react/bridge/JavaScriptModule; public abstract fun getJavaScriptContextHolder ()Lcom/facebook/react/bridge/JavaScriptContextHolder; public abstract fun getNativeMethodCallInvokerHolder ()Lcom/facebook/react/turbomodule/core/interfaces/NativeMethodCallInvokerHolder; @@ -586,13 +584,11 @@ public abstract interface class com/facebook/react/bridge/CatalystInstance : com public abstract fun removeBridgeIdleDebugListener (Lcom/facebook/react/bridge/NotThreadSafeBridgeIdleDebugListener;)V public abstract fun runJSBundle ()V public abstract fun setFabricUIManager (Lcom/facebook/react/bridge/UIManager;)V - public abstract fun setTurboModuleManager (Lcom/facebook/react/bridge/JSIModule;)V public abstract fun setTurboModuleRegistry (Lcom/facebook/react/internal/turbomodule/core/interfaces/TurboModuleRegistry;)V } public class com/facebook/react/bridge/CatalystInstanceImpl : com/facebook/react/bridge/CatalystInstance { public fun addBridgeIdleDebugListener (Lcom/facebook/react/bridge/NotThreadSafeBridgeIdleDebugListener;)V - public fun addJSIModules (Ljava/util/List;)V public fun callFunction (Lcom/facebook/react/bridge/CatalystInstanceImpl$PendingJSCall;)V public fun callFunction (Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/NativeArray;)V public fun destroy ()V @@ -600,7 +596,6 @@ public class com/facebook/react/bridge/CatalystInstanceImpl : com/facebook/react public fun getFabricUIManager ()Lcom/facebook/react/bridge/UIManager; public fun getJSCallInvokerHolder ()Lcom/facebook/react/turbomodule/core/CallInvokerHolderImpl; public synthetic fun getJSCallInvokerHolder ()Lcom/facebook/react/turbomodule/core/interfaces/CallInvokerHolder; - public fun getJSIModule (Lcom/facebook/react/bridge/JSIModuleType;)Lcom/facebook/react/bridge/JSIModule; public fun getJSModule (Ljava/lang/Class;)Lcom/facebook/react/bridge/JavaScriptModule; public fun getJavaScriptContextHolder ()Lcom/facebook/react/bridge/JavaScriptContextHolder; public fun getNativeMethodCallInvokerHolder ()Lcom/facebook/react/turbomodule/core/NativeMethodCallInvokerHolderImpl; @@ -626,7 +621,6 @@ public class com/facebook/react/bridge/CatalystInstanceImpl : com/facebook/react public fun setFabricUIManager (Lcom/facebook/react/bridge/UIManager;)V public fun setGlobalVariable (Ljava/lang/String;Ljava/lang/String;)V public fun setSourceURLs (Ljava/lang/String;Ljava/lang/String;)V - public fun setTurboModuleManager (Lcom/facebook/react/bridge/JSIModule;)V public fun setTurboModuleRegistry (Lcom/facebook/react/internal/turbomodule/core/interfaces/TurboModuleRegistry;)V } @@ -796,31 +790,6 @@ public abstract interface class com/facebook/react/bridge/JSExceptionHandler { public abstract fun handleException (Ljava/lang/Exception;)V } -public abstract interface class com/facebook/react/bridge/JSIModule { - public abstract fun initialize ()V - public abstract fun invalidate ()V -} - -public abstract interface class com/facebook/react/bridge/JSIModulePackage { - public abstract fun getJSIModules (Lcom/facebook/react/bridge/ReactApplicationContext;Lcom/facebook/react/bridge/JavaScriptContextHolder;)Ljava/util/List; -} - -public abstract interface class com/facebook/react/bridge/JSIModuleProvider { - public abstract fun get ()Lcom/facebook/react/bridge/JSIModule; -} - -public abstract interface class com/facebook/react/bridge/JSIModuleSpec { - public abstract fun getJSIModuleProvider ()Lcom/facebook/react/bridge/JSIModuleProvider; - public abstract fun getJSIModuleType ()Lcom/facebook/react/bridge/JSIModuleType; -} - -public final class com/facebook/react/bridge/JSIModuleType : java/lang/Enum { - public static final field TurboModuleManager Lcom/facebook/react/bridge/JSIModuleType; - public static final field UIManager Lcom/facebook/react/bridge/JSIModuleType; - public static fun valueOf (Ljava/lang/String;)Lcom/facebook/react/bridge/JSIModuleType; - public static fun values ()[Lcom/facebook/react/bridge/JSIModuleType; -} - public class com/facebook/react/bridge/JSONArguments { public fun ()V public static fun fromJSONArray (Lorg/json/JSONArray;)Lcom/facebook/react/bridge/ReadableArray; @@ -3706,13 +3675,11 @@ public abstract class com/facebook/react/runtime/BindingsInstaller { public final class com/facebook/react/runtime/BridgelessCatalystInstance : com/facebook/react/bridge/CatalystInstance { public fun (Lcom/facebook/react/runtime/ReactHostImpl;)V public fun addBridgeIdleDebugListener (Lcom/facebook/react/bridge/NotThreadSafeBridgeIdleDebugListener;)V - public fun addJSIModules (Ljava/util/List;)V public fun callFunction (Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/NativeArray;)V public fun destroy ()V public fun extendNativeModules (Lcom/facebook/react/bridge/NativeModuleRegistry;)V public fun getFabricUIManager ()Lcom/facebook/react/bridge/UIManager; public fun getJSCallInvokerHolder ()Lcom/facebook/react/turbomodule/core/interfaces/CallInvokerHolder; - public fun getJSIModule (Lcom/facebook/react/bridge/JSIModuleType;)Lcom/facebook/react/bridge/JSIModule; public fun getJSModule (Ljava/lang/Class;)Lcom/facebook/react/bridge/JavaScriptModule; public fun getJavaScriptContextHolder ()Lcom/facebook/react/bridge/JavaScriptContextHolder; public fun getNativeMethodCallInvokerHolder ()Lcom/facebook/react/turbomodule/core/interfaces/NativeMethodCallInvokerHolder; @@ -3736,7 +3703,6 @@ public final class com/facebook/react/runtime/BridgelessCatalystInstance : com/f public fun runJSBundle ()V public fun setFabricUIManager (Lcom/facebook/react/bridge/UIManager;)V public fun setSourceURLs (Ljava/lang/String;Ljava/lang/String;)V - public fun setTurboModuleManager (Lcom/facebook/react/bridge/JSIModule;)V public fun setTurboModuleRegistry (Lcom/facebook/react/internal/turbomodule/core/interfaces/TurboModuleRegistry;)V } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java index 48231457a1ccac..c7c93040cdbdb7 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java @@ -16,7 +16,6 @@ import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder; import com.facebook.react.turbomodule.core.interfaces.NativeMethodCallInvokerHolder; import java.util.Collection; -import java.util.List; /** * A higher level API on top of the asynchronous JSC bridge. This provides an environment allowing @@ -72,13 +71,6 @@ public interface CatalystInstance @Nullable NativeModule getNativeModule(String moduleName); - @Deprecated( - since = - "getJSIModule(JSIModuleType moduleType) is deprecated and will be deleted in the future." - + " Please use ReactInstanceEventListener to subscribe for react instance events" - + " instead.") - JSIModule getJSIModule(JSIModuleType moduleType); - Collection getNativeModules(); /** @@ -122,9 +114,6 @@ public interface CatalystInstance RuntimeScheduler getRuntimeScheduler(); - @Deprecated - void addJSIModules(List> jsiModules); - /** * Returns a hybrid object that contains a pointer to a JS CallInvoker, which is used to schedule * work on the JS Thread. Required for TurboModuleManager initialization. @@ -137,13 +126,6 @@ public interface CatalystInstance */ NativeMethodCallInvokerHolder getNativeMethodCallInvokerHolder(); - @Deprecated( - since = - "setTurboModuleManager(JSIModule getter) is deprecated and will be deleted in the future." - + " Please use setTurboModuleRegistry(TurboModuleRegistry" - + " turboModuleRegistry)instead.") - void setTurboModuleManager(JSIModule getter); - @DeprecatedInNewArchitecture( message = "This method will be deprecated later as part of Stable APIs with bridge removal and not" diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java index 7333289de793d0..cbcd2f1c3d08fb 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java @@ -35,7 +35,6 @@ import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Collection; -import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.atomic.AtomicInteger; @@ -92,7 +91,6 @@ public String toString() { private final Object mJSCallsPendingInitLock = new Object(); private final NativeModuleRegistry mNativeModuleRegistry; - private final JSIModuleRegistry mJSIModuleRegistry = new JSIModuleRegistry(); private final JSExceptionHandler mJSExceptionHandler; private final MessageQueueThread mNativeModulesQueueThread; private boolean mInitialized = false; @@ -357,7 +355,6 @@ public void destroy() { mNativeModulesQueueThread.runOnQueue( () -> { mNativeModuleRegistry.notifyJSInstanceDestroy(); - mJSIModuleRegistry.notifyJSInstanceDestroy(); if (mFabricUIManager != null) { mFabricUIManager.invalidate(); } @@ -543,17 +540,6 @@ public JavaScriptContextHolder getJavaScriptContextHolder() { public native RuntimeScheduler getRuntimeScheduler(); - @Override - @Deprecated - public void addJSIModules(List> jsiModules) { - mJSIModuleRegistry.registerModules(jsiModules); - } - - @Override - public JSIModule getJSIModule(JSIModuleType moduleType) { - return mJSIModuleRegistry.getModule(moduleType); - } - private native long getJavaScriptContext(); private void incrementPendingJSCalls() { @@ -571,10 +557,6 @@ private void incrementPendingJSCalls() { } } - public void setTurboModuleManager(JSIModule module) { - mTurboModuleRegistry = (TurboModuleRegistry) module; - } - @Override public void setTurboModuleRegistry(TurboModuleRegistry turboModuleRegistry) { mTurboModuleRegistry = turboModuleRegistry; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModule.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModule.java deleted file mode 100644 index 64774acc7a4853..00000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModule.java +++ /dev/null @@ -1,22 +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.bridge; - -/** Marker interface used to represent a JSI Module. */ -public interface JSIModule { - - /** - * This is called at the end of {@link CatalystApplicationFragment#createCatalystInstance()} after - * the CatalystInstance has been created, in order to initialize NativeModules that require the - * CatalystInstance or JS modules. - */ - void initialize(); - - /** Called before {CatalystInstance#onHostDestroy} */ - void invalidate(); -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleHolder.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleHolder.java deleted file mode 100644 index 3223560878de36..00000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleHolder.java +++ /dev/null @@ -1,37 +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.bridge; - -class JSIModuleHolder { - - private JSIModule mModule; - private final JSIModuleSpec mSpec; - - public JSIModuleHolder(JSIModuleSpec spec) { - mSpec = spec; - } - - public JSIModule getJSIModule() { - if (mModule == null) { - synchronized (this) { - if (mModule != null) { - return mModule; - } - mModule = mSpec.getJSIModuleProvider().get(); - mModule.initialize(); - } - } - return mModule; - } - - public void notifyJSInstanceDestroy() { - if (mModule != null) { - mModule.invalidate(); - } - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModulePackage.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModulePackage.java deleted file mode 100644 index 0abc647b99db7f..00000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModulePackage.java +++ /dev/null @@ -1,20 +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.bridge; - -import java.util.List; - -/** Interface used to initialize JSI Modules into the JSI Bridge. */ -public interface JSIModulePackage { - - /** - * @return a {@link List< JSIModuleSpec >} that contain the list of JSI Modules. - */ - List getJSIModules( - ReactApplicationContext reactApplicationContext, JavaScriptContextHolder jsContext); -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleProvider.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleProvider.java deleted file mode 100644 index c3716774b8d168..00000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleProvider.java +++ /dev/null @@ -1,13 +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.bridge; - -public interface JSIModuleProvider { - - T get(); -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleRegistry.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleRegistry.java deleted file mode 100644 index 90d5cde4fcbce5..00000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleRegistry.java +++ /dev/null @@ -1,48 +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.bridge; - -import com.facebook.infer.annotation.Assertions; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -class JSIModuleRegistry { - - private final Map mModules = new HashMap<>(); - - public JSIModuleRegistry() {} - - public JSIModule getModule(JSIModuleType moduleType) { - JSIModuleHolder jsiModuleHolder = mModules.get(moduleType); - if (jsiModuleHolder == null) { - throw new IllegalArgumentException("Unable to find JSIModule for class " + moduleType); - } - return Assertions.assertNotNull(jsiModuleHolder.getJSIModule()); - } - - public void registerModules(List> jsiModules) { - for (JSIModuleSpec spec : jsiModules) { - mModules.put(spec.getJSIModuleType(), new JSIModuleHolder(spec)); - } - } - - public void notifyJSInstanceDestroy() { - for (Map.Entry entry : mModules.entrySet()) { - JSIModuleType moduleType = entry.getKey(); - - // Don't call TurboModuleManager.onCatalystInstanceDestroy - if (moduleType == JSIModuleType.TurboModuleManager) { - continue; - } - - JSIModuleHolder moduleHolder = entry.getValue(); - moduleHolder.notifyJSInstanceDestroy(); - } - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleSpec.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleSpec.java deleted file mode 100644 index 20cd88d5fdd4e6..00000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleSpec.java +++ /dev/null @@ -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.bridge; - -/** Holder class used to register {@link JSIModule} into JSI Bridge. */ -public interface JSIModuleSpec { - - JSIModuleType getJSIModuleType(); - - JSIModuleProvider getJSIModuleProvider(); -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleType.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleType.java deleted file mode 100644 index 854f2de38175d1..00000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleType.java +++ /dev/null @@ -1,17 +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.bridge; - -/** - * A list of support JSIModules. These are usually core infra pieces, so there should be an explicit - * list. - */ -public enum JSIModuleType { - TurboModuleManager, - UIManager, -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java index a03e91c78b203a..ff7b4c5489aaa8 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java @@ -591,10 +591,7 @@ public boolean isBridgeless() { * @return The UIManager when CatalystInstance is active. */ public @Nullable UIManager getFabricUIManager() { - UIManager uiManager = mCatalystInstance.getFabricUIManager(); - return uiManager != null - ? uiManager - : (UIManager) mCatalystInstance.getJSIModule(JSIModuleType.UIManager); + return mCatalystInstance.getFabricUIManager(); } /** diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessCatalystInstance.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessCatalystInstance.kt index 03a18c6c8dae01..10bc63a9c98e2b 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessCatalystInstance.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessCatalystInstance.kt @@ -10,9 +10,6 @@ package com.facebook.react.runtime import android.content.res.AssetManager import com.facebook.proguard.annotations.DoNotStrip import com.facebook.react.bridge.CatalystInstance -import com.facebook.react.bridge.JSIModule -import com.facebook.react.bridge.JSIModuleSpec -import com.facebook.react.bridge.JSIModuleType import com.facebook.react.bridge.JavaScriptContextHolder import com.facebook.react.bridge.JavaScriptModule import com.facebook.react.bridge.NativeArray @@ -107,13 +104,6 @@ public class BridgelessCatalystInstance(private val reactHost: ReactHostImpl) : override fun getNativeModule(moduleName: String): NativeModule? = reactHost.getNativeModule(moduleName) - @Deprecated( - message = - "getJSIModule(JSIModuleType moduleType) is deprecated and will be deleted in the future. Please use ReactInstanceEventListener to subscribe for react instance events instead.") - override fun getJSIModule(moduleType: JSIModuleType): JSIModule { - throw UnsupportedOperationException("Unimplemented method 'getJSIModule'") - } - override fun getNativeModules(): Collection = reactHost.getNativeModules() override fun extendNativeModules(modules: NativeModuleRegistry) { @@ -150,11 +140,6 @@ public class BridgelessCatalystInstance(private val reactHost: ReactHostImpl) : throw UnsupportedOperationException("Unimplemented method 'getRuntimeScheduler'") } - @Deprecated(message = "This API is unsupported in the New Architecture.") - override fun addJSIModules(jsiModules: List>) { - throw UnsupportedOperationException("Unimplemented method 'addJSIModules'") - } - override fun getJSCallInvokerHolder(): CallInvokerHolder? { return reactHost.getJSCallInvokerHolder() } @@ -163,14 +148,6 @@ public class BridgelessCatalystInstance(private val reactHost: ReactHostImpl) : throw UnsupportedOperationException("Unimplemented method 'getNativeMethodCallInvokerHolder'") } - @Deprecated( - message = - "setTurboModuleManager(JSIModule getter) is deprecated and will be deleted in the future. Please use setTurboModuleRegistry(TurboModuleRegistry turboModuleRegistry) instead.", - replaceWith = ReplaceWith("setTurboModuleRegistry(turboModuleRegistry)")) - override fun setTurboModuleManager(getter: JSIModule) { - throw UnsupportedOperationException("Unimplemented method 'setTurboModuleManager'") - } - @DeprecatedInNewArchitecture( message = "This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.")