From c5de1eb1bac0a4e653688d86654be131984d0e2f Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Tue, 29 Nov 2022 08:53:50 -0800 Subject: [PATCH] Fix imports in React Bridging for Old Arch and frameworks Summary: In 0.71.0-RC.2, we had a regression in `use_frameworks!`. The `use_frameworks! :linkage => :static` use to work fine with the Old Architecture. We modified how the `React-bridging` pod is configured and, now those are broken. This change make sure to use the right imports for React-bridging. ## Changelog [iOS][Changed] - Fix imports in React Bridging for Old Arch and frameworks Reviewed By: christophpurrer, cortinico Differential Revision: D41551103 fbshipit-source-id: 4416fde92fef11eb801daf2302a57fe52732e4ef --- ReactCommon/ReactCommon.podspec | 2 +- ReactCommon/react/bridging/CallbackWrapper.h | 2 +- .../nativemodule/core/ReactCommon/CallbackWrapper.h | 11 +++++++++++ .../nativemodule/core/ReactCommon/TurboModuleUtils.h | 3 +-- 4 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 ReactCommon/react/nativemodule/core/ReactCommon/CallbackWrapper.h diff --git a/ReactCommon/ReactCommon.podspec b/ReactCommon/ReactCommon.podspec index 8c7d24bc267fee..e859a81f2894ba 100644 --- a/ReactCommon/ReactCommon.podspec +++ b/ReactCommon/ReactCommon.podspec @@ -62,7 +62,7 @@ Pod::Spec.new do |s| sss.source_files = "react/nativemodule/core/ReactCommon/**/*.{cpp,h}", "react/nativemodule/core/platform/ios/**/*.{mm,cpp,h}" sss.dependency "React-jsidynamic", version - sss.exclude_files = "react/nativemodule/core/ReactCommon/LongLivedObject.h" + sss.exclude_files = "react/nativemodule/core/ReactCommon/{LongLivedObject,CallbackWrapper}.h" end ss.subspec "samples" do |sss| diff --git a/ReactCommon/react/bridging/CallbackWrapper.h b/ReactCommon/react/bridging/CallbackWrapper.h index 67768a0df12d81..885cb209997313 100644 --- a/ReactCommon/react/bridging/CallbackWrapper.h +++ b/ReactCommon/react/bridging/CallbackWrapper.h @@ -8,7 +8,7 @@ #pragma once #include -#include +#include "LongLivedObject.h" #include diff --git a/ReactCommon/react/nativemodule/core/ReactCommon/CallbackWrapper.h b/ReactCommon/react/nativemodule/core/ReactCommon/CallbackWrapper.h new file mode 100644 index 00000000000000..2c105d9c3f7238 --- /dev/null +++ b/ReactCommon/react/nativemodule/core/ReactCommon/CallbackWrapper.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +// This header is left here for compatibility reasons. +#include diff --git a/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h b/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h index 92e10268daf0d1..613665898dca5c 100644 --- a/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h +++ b/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h @@ -13,8 +13,7 @@ #include #include -#include -#include +#include namespace facebook { namespace react {