mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Extract react/bridging into its own React-bridging pod (#57354)
Summary: Pull Request resolved: https://github.com/react/react-native/pull/57354 Split the `react/bridging` headers out of the `ReactCommon` pod's `turbomodule/bridging` subspec into a standalone `React-bridging` podspec, mirroring the existing `React-bridging` SwiftPM target. This makes bridging a dependency-graph leaf so other modules can depend on it without pulling in `ReactCommon` / `React-cxxreact`. Consumers that previously reached `react/bridging` headers transitively through `ReactCommon` now resolve them through the standalone pod. The CocoaPods header-search-path injection in `update_search_paths` lists `React-bridging` alongside the other core frameworks so the headers resolve everywhere, and pods that link the `LongLivedObject` / `CallbackWrapper` symbols (`React-Fabric`, the nativemodule feature pods, `React-NativeModulesApple`, `React-RCTFBReactNativeSpec`) gain an explicit `React-bridging` dependency. All `ReactCommon/turbomodule/bridging` references in podspecs, the autolinker, the codegen template, and their test snapshots are repointed to `React-bridging`. Changelog: [Internal] Reviewed By: cortinico Differential Revision: D109868509 fbshipit-source-id: 20f90877c45dd39feb04703a45d5ecef6bb165a0
This commit is contained in:
1 parent
bb3c121073
commit
4cd278242b
19 files changed
+68
-26
No files matched your search
@@ -262,13 +262,13 @@ let reactRuntimeScheduler = RNTarget(
|
||||
dependencies: [.reactNativeDependencies, .reactFeatureFlags, .reactCxxReact, .reactPerfLogger, .reactPerformanceTimeline, .reactRendererConsistency, .reactUtils, .reactRuntimeExecutor]
|
||||
)
|
||||
|
||||
/// ReactCommon.podspec
|
||||
/// This target represent the ReactCommon/turbomodule/bridging subspec
|
||||
/// React-bridging.podspec
|
||||
let reactTurboModuleBridging = RNTarget(
|
||||
name: .reactTurboModuleBridging,
|
||||
path: "ReactCommon/react/bridging",
|
||||
searchPaths: [CallInvokerPath],
|
||||
excludedPaths: ["tests"],
|
||||
dependencies: [.reactNativeDependencies, .reactPerfLogger, .reactCxxReact, .jsi, .logger]
|
||||
dependencies: [.reactNativeDependencies, .jsi]
|
||||
)
|
||||
|
||||
/// React-jserrorhandler.podspec
|
||||
@@ -904,7 +904,7 @@ extension String {
|
||||
static let reactRCTLinking = "React-RCTLinking"
|
||||
static let reactCoreModules = "React-CoreModules"
|
||||
static let reactRCTAnimatedModuleProvider = "RCTAnimatedModuleProvider"
|
||||
static let reactTurboModuleBridging = "ReactCommon/turbomodule/bridging"
|
||||
static let reactTurboModuleBridging = "React-bridging"
|
||||
static let reactTurboModuleCore = "ReactCommon/turbomodule/core"
|
||||
static let reactTurboModuleCoreDefaults = "ReactCommon/turbomodule/core/defaults"
|
||||
static let reactTurboModuleCoreMicrotasks = "ReactCommon/turbomodule/core/microtasks"
|
||||
|
||||
@@ -54,7 +54,7 @@ Pod::Spec.new do |s|
|
||||
s.dependency "React-NativeModulesApple"
|
||||
|
||||
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
|
||||
add_dependency(s, "ReactCommon", :subspec => "turbomodule/bridging", :additional_framework_paths => ["react/nativemodule/bridging"])
|
||||
s.dependency "React-bridging"
|
||||
|
||||
depend_on_js_engine(s)
|
||||
add_rn_third_party_dependencies(s)
|
||||
|
||||
@@ -45,6 +45,7 @@ Pod::Spec.new do |s|
|
||||
s.dependency "React-featureflags"
|
||||
s.dependency "React-runtimescheduler"
|
||||
s.dependency "React-cxxreact"
|
||||
s.dependency "React-bridging"
|
||||
|
||||
add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"])
|
||||
add_dependency(s, "React-rendererdebug")
|
||||
|
||||
@@ -43,27 +43,17 @@ Pod::Spec.new do |s|
|
||||
s.subspec "turbomodule" do |ss|
|
||||
ss.dependency "React-callinvoker", version
|
||||
ss.dependency "React-perflogger", version
|
||||
ss.dependency "React-cxxreact", version
|
||||
ss.dependency "React-jsi", version
|
||||
ss.dependency "React-logger", version
|
||||
if use_hermes()
|
||||
ss.dependency "hermes-engine"
|
||||
end
|
||||
|
||||
ss.subspec "bridging" do |sss|
|
||||
sss.dependency "React-jsi", version
|
||||
sss.source_files = podspec_sources("react/bridging/**/*.{cpp,h}", "react/bridging/**/*.h")
|
||||
sss.exclude_files = "react/bridging/tests"
|
||||
sss.header_dir = "react/bridging"
|
||||
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\"" }
|
||||
if use_hermes()
|
||||
sss.dependency "hermes-engine"
|
||||
end
|
||||
end
|
||||
|
||||
ss.subspec "core" do |sss|
|
||||
sss.source_files = podspec_sources("react/nativemodule/core/ReactCommon/**/*.{cpp,h}", "react/nativemodule/core/ReactCommon/**/*.h")
|
||||
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_featureflags.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-utils/React_utils.framework/Headers\"" }
|
||||
sss.dependency "React-bridging"
|
||||
sss.dependency "React-cxxreact", version
|
||||
sss.dependency "React-debug", version
|
||||
sss.dependency "React-featureflags", version
|
||||
sss.dependency "React-utils", version
|
||||
|
||||
@@ -38,7 +38,7 @@ Pod::Spec.new do |s|
|
||||
|
||||
s.dependency "React-jsi"
|
||||
s.dependency "React-cxxreact"
|
||||
s.dependency "ReactCommon/turbomodule/bridging"
|
||||
s.dependency "React-bridging"
|
||||
add_dependency(s, "React-featureflags")
|
||||
add_dependency(s, "React-debug")
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
# 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.
|
||||
|
||||
require "json"
|
||||
|
||||
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "package.json")))
|
||||
version = package['version']
|
||||
|
||||
source = { :git => 'https://github.com/facebook/react-native.git' }
|
||||
if version == '1000.0.0'
|
||||
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
||||
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
||||
else
|
||||
source[:tag] = "v#{version}"
|
||||
end
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "React-bridging"
|
||||
s.version = version
|
||||
s.summary = "-"
|
||||
s.homepage = "https://reactnative.dev/"
|
||||
s.license = package["license"]
|
||||
s.author = "Meta Platforms, Inc. and its affiliates"
|
||||
s.platforms = min_supported_versions
|
||||
s.source = source
|
||||
s.source_files = podspec_sources("*.{cpp,h}", "*.h")
|
||||
s.header_dir = "react/bridging"
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"DEFINES_MODULE" => "YES"
|
||||
}
|
||||
|
||||
resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: "React_bridging")
|
||||
|
||||
s.dependency "React-jsi"
|
||||
s.dependency "React-callinvoker"
|
||||
s.dependency "React-timing"
|
||||
|
||||
add_rn_third_party_dependencies(s)
|
||||
add_rncore_dependency(s)
|
||||
end
|
||||
+1
-1
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
|
||||
s.source_files = podspec_sources("ReactCommon/**/*.{mm,cpp,h}", "ReactCommon/**/*.{h}")
|
||||
|
||||
s.dependency "ReactCommon/turbomodule/core"
|
||||
s.dependency "ReactCommon/turbomodule/bridging"
|
||||
s.dependency "React-bridging"
|
||||
s.dependency "React-callinvoker"
|
||||
s.dependency "React-Core"
|
||||
s.dependency "React-cxxreact"
|
||||
|
||||
@@ -51,6 +51,7 @@ Pod::Spec.new do |s|
|
||||
|
||||
s.dependency "Yoga"
|
||||
s.dependency "ReactCommon/turbomodule/core"
|
||||
s.dependency "React-bridging"
|
||||
s.dependency "React-Fabric"
|
||||
s.dependency "React-Fabric/bridging"
|
||||
s.dependency "React-FabricComponents"
|
||||
|
||||
+1
@@ -48,6 +48,7 @@ Pod::Spec.new do |s|
|
||||
add_rncore_dependency(s)
|
||||
|
||||
s.dependency "ReactCommon/turbomodule/core"
|
||||
s.dependency "React-bridging"
|
||||
s.dependency "React-runtimescheduler"
|
||||
add_dependency(s, "React-RCTFBReactNativeSpec")
|
||||
add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"])
|
||||
|
||||
+1
@@ -55,6 +55,7 @@ Pod::Spec.new do |s|
|
||||
add_rncore_dependency(s)
|
||||
|
||||
s.dependency "ReactCommon/turbomodule/core"
|
||||
s.dependency "React-bridging"
|
||||
|
||||
s.dependency "React-Fabric"
|
||||
s.dependency "React-Fabric/bridging"
|
||||
|
||||
+1
@@ -55,6 +55,7 @@ Pod::Spec.new do |s|
|
||||
add_rncore_dependency(s)
|
||||
|
||||
s.dependency "ReactCommon/turbomodule/core"
|
||||
s.dependency "React-bridging"
|
||||
|
||||
s.dependency "React-Fabric"
|
||||
s.dependency "React-Fabric/bridging"
|
||||
|
||||
+1
@@ -52,6 +52,7 @@ Pod::Spec.new do |s|
|
||||
add_rncore_dependency(s)
|
||||
|
||||
s.dependency "ReactCommon/turbomodule/core"
|
||||
s.dependency "React-bridging"
|
||||
|
||||
add_dependency(s, "React-RCTFBReactNativeSpec")
|
||||
add_dependency(s, "React-performancetimeline")
|
||||
|
||||
@@ -266,7 +266,7 @@ class CodegenUtilsTests < Test::Unit::TestCase
|
||||
"React-Core": [],
|
||||
"React-jsi": [],
|
||||
"React-jsiexecutor": [],
|
||||
"ReactCommon/turbomodule/bridging": [],
|
||||
"React-bridging": [],
|
||||
"ReactCommon/turbomodule/core": [],
|
||||
"hermes-engine": [],
|
||||
"React-NativeModulesApple": [],
|
||||
|
||||
@@ -152,7 +152,7 @@ class NewArchitectureTests < Test::Unit::TestCase
|
||||
{ :dependency_name => "ReactCodegen" },
|
||||
{ :dependency_name => "RCTRequired" },
|
||||
{ :dependency_name => "RCTTypeSafety" },
|
||||
{ :dependency_name => "ReactCommon/turbomodule/bridging" },
|
||||
{ :dependency_name => "React-bridging" },
|
||||
{ :dependency_name => "ReactCommon/turbomodule/core" },
|
||||
{ :dependency_name => "React-NativeModulesApple" },
|
||||
{ :dependency_name => "Yoga" },
|
||||
@@ -203,7 +203,7 @@ class NewArchitectureTests < Test::Unit::TestCase
|
||||
{ :dependency_name => "ReactCodegen" },
|
||||
{ :dependency_name => "RCTRequired" },
|
||||
{ :dependency_name => "RCTTypeSafety" },
|
||||
{ :dependency_name => "ReactCommon/turbomodule/bridging" },
|
||||
{ :dependency_name => "React-bridging" },
|
||||
{ :dependency_name => "ReactCommon/turbomodule/core" },
|
||||
{ :dependency_name => "React-NativeModulesApple" },
|
||||
{ :dependency_name => "Yoga" },
|
||||
|
||||
@@ -119,7 +119,7 @@ class NewArchitectureHelper
|
||||
|
||||
spec.dependency "RCTRequired"
|
||||
spec.dependency "RCTTypeSafety"
|
||||
spec.dependency "ReactCommon/turbomodule/bridging"
|
||||
spec.dependency "React-bridging"
|
||||
spec.dependency "ReactCommon/turbomodule/core"
|
||||
spec.dependency "React-NativeModulesApple"
|
||||
spec.dependency "Yoga"
|
||||
|
||||
@@ -333,6 +333,7 @@ class ReactNativePodsUtils
|
||||
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "ReactCommon-Samples", "ReactCommon_Samples", ["platform/ios"]))
|
||||
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-Fabric", "React_Fabric", ["react/renderer/components/view/platform/cxx"], false))
|
||||
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-NativeModulesApple", "React_NativeModulesApple", []))
|
||||
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-bridging", "React_bridging", []))
|
||||
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-graphics", "React_graphics", ["react/renderer/graphics/platform/ios"]))
|
||||
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-featureflags", "React_featureflags", []))
|
||||
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-renderercss", "React_renderercss", []))
|
||||
|
||||
+2
-2
@@ -465,7 +465,7 @@ Pod::Spec.new do |s|
|
||||
s.dependency \\"RCTTypeSafety\\"
|
||||
s.dependency \\"React-Core\\"
|
||||
s.dependency \\"React-jsi\\"
|
||||
s.dependency \\"ReactCommon/turbomodule/bridging\\"
|
||||
s.dependency \\"React-bridging\\"
|
||||
s.dependency \\"ReactCommon/turbomodule/core\\"
|
||||
s.dependency \\"React-NativeModulesApple\\"
|
||||
s.dependency 'React-graphics'
|
||||
@@ -948,7 +948,7 @@ Pod::Spec.new do |s|
|
||||
s.dependency \\"RCTTypeSafety\\"
|
||||
s.dependency \\"React-Core\\"
|
||||
s.dependency \\"React-jsi\\"
|
||||
s.dependency \\"ReactCommon/turbomodule/bridging\\"
|
||||
s.dependency \\"React-bridging\\"
|
||||
s.dependency \\"ReactCommon/turbomodule/core\\"
|
||||
s.dependency \\"React-NativeModulesApple\\"
|
||||
s.dependency 'React-graphics'
|
||||
|
||||
@@ -69,7 +69,7 @@ Pod::Spec.new do |s|
|
||||
s.dependency "RCTTypeSafety"
|
||||
s.dependency "React-Core"
|
||||
s.dependency "React-jsi"
|
||||
s.dependency "ReactCommon/turbomodule/bridging"
|
||||
s.dependency "React-bridging"
|
||||
s.dependency "ReactCommon/turbomodule/core"
|
||||
s.dependency "React-NativeModulesApple"
|
||||
s.dependency 'React-graphics'
|
||||
|
||||
@@ -162,6 +162,7 @@ def use_react_native! (
|
||||
pod 'React-domnativemodule', :path => "#{prefix}/ReactCommon/react/nativemodule/dom"
|
||||
pod 'React-defaultsnativemodule', :path => "#{prefix}/ReactCommon/react/nativemodule/defaults"
|
||||
pod 'React-Mapbuffer', :path => "#{prefix}/ReactCommon"
|
||||
pod 'React-bridging', :path => "#{prefix}/ReactCommon/react/bridging", :modular_headers => true
|
||||
pod 'React-jserrorhandler', :path => "#{prefix}/ReactCommon/jserrorhandler"
|
||||
pod 'RCTDeprecation', :path => "#{prefix}/ReactApple/Libraries/RCTFoundation/RCTDeprecation"
|
||||
pod 'React-RCTFBReactNativeSpec', :path => "#{prefix}/React"
|
||||
|
||||
Reference in new issue
Block a user