Skip to content

Commit

Permalink
Deprecate old JSI module APIs (#42085)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #42085

Deprecating the old JSI module APIs: `getJSIModule(JSIModuleType moduleType)`, `addJSIModules(List<JSIModuleSpec> jsiModules)` and `setTurboModuleManager(JSIModule getter)` to further delete them in future release. Deprecating them as of now to cater the OSS use-cases

Changelog:
[Internal] internal

Reviewed By: christophpurrer

Differential Revision: D50927292

fbshipit-source-id: 1d25f9f28b8aaf34979a90e4792317b263ae1714
  • Loading branch information
arushikesarwani94 authored and facebook-github-bot committed Dec 28, 2023
1 parent 655b12d commit e2fb88e
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ 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<NativeModule> getNativeModules();
Expand Down Expand Up @@ -116,6 +119,7 @@ public interface CatalystInstance

RuntimeScheduler getRuntimeScheduler();

@Deprecated
void addJSIModules(List<JSIModuleSpec> jsiModules);

/**
Expand All @@ -130,11 +134,9 @@ public interface CatalystInstance
*/
NativeMethodCallInvokerHolder getNativeMethodCallInvokerHolder();

/**
* For the time being, we want code relying on the old infra to also work with TurboModules.
* Hence, we must provide the TurboModuleRegistry to CatalystInstance so that getNativeModule,
* hasNativeModule, and getNativeModules can also return TurboModules.
*/
@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(
Expand Down

0 comments on commit e2fb88e

Please sign in to comment.