From 86cdd8856955cc67238595d9519904e70db9bb2a Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Sat, 19 Dec 2020 05:59:22 -0800 Subject: [PATCH] Integrate TurboModules with Venice's RCTSurfacePresenter Summary: After we create the RCTSurfacePresenter in Venice, we use it to create an RCTBridgelessComponentViewProvider, and pass it over to the RCTTurboModuleManager. In Venice, this allows all TurboModules to query components' UIViews given their reactTag. Changelog: [Internal] Reviewed By: shergin Differential Revision: D25643261 fbshipit-source-id: 31da07c490d249534f700b7c8430e9cb43b5b0db --- .../nativemodule/core/platform/ios/RCTTurboModuleManager.h | 1 + .../nativemodule/core/platform/ios/RCTTurboModuleManager.mm | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.h b/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.h index 8ee2eaeefe5..18756624d42 100644 --- a/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.h +++ b/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.h @@ -51,6 +51,7 @@ jsInvoker:(std::shared_ptr)jsInvoker; - (void)installJSBindingWithRuntimeExecutor:(facebook::react::RuntimeExecutor)runtimeExecutor; +- (void)setBridgelessComponentViewProvider:(RCTBridgelessComponentViewProvider)bridgelessComponentViewProvider; - (void)invalidate; diff --git a/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm b/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm index f0b0e9ba4f1..b226b2bc7fa 100644 --- a/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm +++ b/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm @@ -205,6 +205,11 @@ static Class getFallbackClassFromName(const char *name) return self; } +- (void)setBridgelessComponentViewProvider:(RCTBridgelessComponentViewProvider)viewProvider +{ + [_viewRegistry_DEPRECATED setBridgelessComponentViewProvider:viewProvider]; +} + - (void)notifyAboutTurboModuleSetup:(const char *)name { NSString *moduleName = [[NSString alloc] initWithUTF8String:name];