From 8aea93022bad4ed57ff6b738528a43f26fc335ac Mon Sep 17 00:00:00 2001 From: Vladimir Morozov Date: Mon, 4 Jan 2021 12:02:05 -0800 Subject: [PATCH] Remove dependency on Folly in TurboModuleUtils.h (#30672) Summary: The TurboModuleUtils.h includes "folly/Optional.h" which is not used and creates an unnecessary dependency on Folly. In this PR we remove this unnecessary include. It is required for the https://github.com/microsoft/react-native-windows/pull/6804 where we add an experimental support for the C++ TurboModules. While the C++ TurboModules use the same JSI and TurboModule code defined in react-native, we provide a layer that let them to work over the ABI-safe Microsoft.ReactNative.dll boundary. The RNW Nuget distribution with DLL files includes a few source files to create native/turbo modules that work through the ABI-safe API. The TurboModuleUtils.h is one of such files. By removing the dependency on Folly we reduce requirements for the native module code. After this PR is merged we will remove the fork of the TurboModuleUtils.h added in https://github.com/microsoft/react-native-windows/pull/6804. ## Changelog [Internal] [Fixed] - Remove dependency on Folly in TurboModuleUtils.h Pull Request resolved: https://github.com/facebook/react-native/pull/30672 Test Plan: The change does not bring any functional changes. It may only affect code compilation where some code may depend on TurboModuleUtils.h when it needs the "folly/Optional.h". The fix is add the `#include ` there explicitly. I had run the iOS tests and they passed: ``` yarn pod install in packages\rn-tester ./scripts/objc-test.sh test ``` Reviewed By: mdvacca Differential Revision: D25758927 Pulled By: fkgozali fbshipit-source-id: 347d8f6bc333a3df67095ea0dc7221c818432fab --- .../react/nativemodule/core/ReactCommon/TurboModuleUtils.h | 1 - 1 file changed, 1 deletion(-) diff --git a/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h b/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h index 030d3fac9783de..30add1d265baae 100644 --- a/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h +++ b/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h @@ -10,7 +10,6 @@ #include #include -#include #include #include