Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support more stubbed methods in BridgelessCatalystInstance #44091

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,25 +92,20 @@ public class BridgelessCatalystInstance(private val reactHost: ReactHostImpl) :
throw UnsupportedOperationException("Unimplemented method 'initialize'")
}

override fun getReactQueueConfiguration(): ReactQueueConfiguration {
throw UnsupportedOperationException("Unimplemented method 'getReactQueueConfiguration'")
}
override fun getReactQueueConfiguration(): ReactQueueConfiguration =
reactHost.reactQueueConfiguration!!

override fun <T : JavaScriptModule> getJSModule(jsInterface: Class<T>): T {
throw UnsupportedOperationException("Unimplemented method 'getJSModule'")
}
override fun <T : JavaScriptModule> getJSModule(jsInterface: Class<T>): T =
reactHost.currentReactContext?.getJSModule(jsInterface)!!

override fun <T : NativeModule> hasNativeModule(nativeModuleInterface: Class<T>): Boolean {
throw UnsupportedOperationException("Unimplemented method 'hasNativeModule'")
}
override fun <T : NativeModule> hasNativeModule(nativeModuleInterface: Class<T>): Boolean =
reactHost.hasNativeModule(nativeModuleInterface)

override fun <T : NativeModule> getNativeModule(nativeModuleInterface: Class<T>): T? {
throw UnsupportedOperationException("Unimplemented method 'getNativeModule'")
}
override fun <T : NativeModule> getNativeModule(nativeModuleInterface: Class<T>): T? =
reactHost.getNativeModule(nativeModuleInterface)

override fun getNativeModule(moduleName: String): NativeModule? {
throw UnsupportedOperationException("Unimplemented method 'getNativeModule'")
}
override fun getNativeModule(moduleName: String): NativeModule? =
reactHost.getNativeModule(moduleName)

@Deprecated(
message =
Expand All @@ -119,9 +114,7 @@ public class BridgelessCatalystInstance(private val reactHost: ReactHostImpl) :
throw UnsupportedOperationException("Unimplemented method 'getJSIModule'")
}

override fun getNativeModules(): Collection<NativeModule> {
throw UnsupportedOperationException("Unimplemented method 'getNativeModules'")
}
override fun getNativeModules(): Collection<NativeModule> = reactHost.getNativeModules()

override fun extendNativeModules(modules: NativeModuleRegistry) {
throw UnsupportedOperationException("Unimplemented method 'extendNativeModules'")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,16 @@ <T extends NativeModule> T getNativeModule(Class<T> nativeModuleInterface) {
return null;
}

/* package */
@Nullable
NativeModule getNativeModule(String nativeModuleName) {
final ReactInstance reactInstance = mReactInstanceTaskRef.get().getResult();
if (reactInstance != null) {
return reactInstance.getNativeModule(nativeModuleName);
}
return null;
}

/* package */
@Nullable
RuntimeExecutor getRuntimeExecutor() {
Expand Down
Loading