From 88ebec9e650f7c8f8519d7141ed0eac60b7e881d Mon Sep 17 00:00:00 2001 From: Rachel Lang Date: Thu, 4 Nov 2021 15:57:05 -0700 Subject: [PATCH] 6/n Boilerplate C++-only TurboModule iOS Summary: C++-only TurboModules, not to be confused with [TurboModules](https://www.internalfb.com/intern/wiki/React_Native/Building_Product_Experiences/Intro_to_Native_Modules/), directly allows you to call C++ from JS instead of going through the native layer. Referred to modification of C++-only TurboModule D30158226 and https://fburl.com/code/rcf73a42 for C++ to JS call (jsInvoker is an object that can schedule work on the JavaScript thread) This example shows JS to C++ call and storing a JS function in C++ to call later. Notes: * To use the module, import the C++ module directly in objc. * Meanwhile, create a js spec and use it in RN code. Spec methods don't need to be marked as optional. * C++ and js spec will be linked when built Reviewed By: RSNara Differential Revision: D32080496 fbshipit-source-id: 9c214ca22c18f793d5f8b54997d129bdfa73e61a --- BUCK | 1 + 1 file changed, 1 insertion(+) diff --git a/BUCK b/BUCK index 486ac679324..269f84020ad 100644 --- a/BUCK +++ b/BUCK @@ -409,6 +409,7 @@ rn_xplat_cxx_library2( "//xplat/js/react-native-github/ReactCommon/react/nativemodule/core:", "//xplat/js/react-native-github/ReactCommon/react/nativemodule/samples:", "//xplat/js/react-native-github/packages/rn-tester:", + "//xplat/rtc/manul/...", ], deps = [ YOGA_CXX_TARGET,