mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix broken use_frameworks from React-bridging (#34011)
Summary: `use_frameworks!` is broken again in react-native 0.69 because React-bridging. in the `use_frameworks!` mode, header structures are flattened, so `#include <react/bridging/CallbackWrapper.h>` is not reachable to the header. to somehow workaround the issue without touch React-bridging imports, the pr do these things: - use `header_mappings_dir` to keep `react/bridging` header structure - because the header structure is not default framework header structure, explicitly `HEADER_SEARCH_PATHS` is necessary. - forward declare `CallbackWrapper` and use it internally in ReactCommon. so that we don't need to add `HEADER_SEARCH_PATHS` for React-bridging to every pods depending on `ReactCommon/turbomodule/core`, e.g. React-RCTSettings.podspec. [iOS] [Fixed] - Fix use_frameworks! for 0.69 Pull Request resolved: https://github.com/facebook/react-native/pull/34011 Test Plan: ```sh $ npx react-native init RN069 --version next $ yarn ios ``` Reviewed By: cortinico, cipolleschi Differential Revision: D37169699 Pulled By: dmitryrykun fbshipit-source-id: 309c55f1c611a2fc3902a83e8af814daaf2af6a0
This commit is contained in:
+4
-3
@@ -5,7 +5,7 @@
|
||||
|
||||
require "json"
|
||||
|
||||
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "package.json")))
|
||||
package = JSON.parse(File.read(File.join(__dir__, "..", "package.json")))
|
||||
version = package['version']
|
||||
|
||||
source = { :git => 'https://github.com/facebook/react-native.git' }
|
||||
@@ -28,9 +28,10 @@ Pod::Spec.new do |s|
|
||||
s.author = "Facebook, Inc. and its affiliates"
|
||||
s.platforms = { :ios => "12.4" }
|
||||
s.source = source
|
||||
s.source_files = "**/*.{cpp,h}"
|
||||
s.exclude_files = "tests"
|
||||
s.source_files = "react/bridging/**/*.{cpp,h}"
|
||||
s.exclude_files = "react/bridging/tests"
|
||||
s.header_dir = "react/bridging"
|
||||
s.header_mappings_dir = "."
|
||||
s.compiler_flags = folly_compiler_flags
|
||||
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\"",
|
||||
"USE_HEADERMAP" => "YES",
|
||||
@@ -32,7 +32,7 @@ Pod::Spec.new do |s|
|
||||
s.source = source
|
||||
s.header_dir = "ReactCommon" # Use global header_dir for all subspecs for use_frameworks! compatibility
|
||||
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
|
||||
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_ROOT)/Headers/Private/React-bridging\"",
|
||||
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_ROOT)/Headers/Private/React-bridging/react/bridging\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-bridging/react_bridging.framework/Headers\"",
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17" }
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#import <React/RCTModuleMethod.h>
|
||||
#import <ReactCommon/CallInvoker.h>
|
||||
#import <ReactCommon/TurboModule.h>
|
||||
#import <ReactCommon/TurboModuleUtils.h>
|
||||
#import <string>
|
||||
#import <unordered_map>
|
||||
|
||||
@@ -27,6 +26,7 @@
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
class CallbackWrapper;
|
||||
class Instance;
|
||||
|
||||
typedef std::weak_ptr<CallbackWrapper> (
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#import <ReactCommon/TurboCxxModule.h>
|
||||
#import <ReactCommon/TurboModuleBinding.h>
|
||||
#import <ReactCommon/TurboModulePerfLogger.h>
|
||||
#import <ReactCommon/TurboModuleUtils.h>
|
||||
|
||||
using namespace facebook;
|
||||
using namespace facebook::react;
|
||||
|
||||
@@ -65,7 +65,7 @@ def use_react_native! (options={})
|
||||
pod 'React-Core/DevSupport', :path => "#{prefix}/"
|
||||
end
|
||||
|
||||
pod 'React-bridging', :path => "#{prefix}/ReactCommon/react/bridging"
|
||||
pod 'React-bridging', :path => "#{prefix}/ReactCommon"
|
||||
pod 'React-cxxreact', :path => "#{prefix}/ReactCommon/cxxreact"
|
||||
pod 'React-jsi', :path => "#{prefix}/ReactCommon/jsi"
|
||||
pod 'React-jsiexecutor', :path => "#{prefix}/ReactCommon/jsiexecutor"
|
||||
|
||||
Reference in New Issue
Block a user