Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pods for bridgeless #38020

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use_hermes = ENV['USE_HERMES'] == '1'
use_frameworks = ENV['USE_FRAMEWORKS'] != nil

header_search_paths = [
"$(PODS_TARGET_SRCROOT)/ReactCommon",
"$(PODS_TARGET_SRCROOT)/../../ReactCommon",
"$(PODS_ROOT)/Headers/Private/React-Core",
"$(PODS_ROOT)/boost",
"$(PODS_ROOT)/DoubleConversion",
Expand Down Expand Up @@ -84,6 +84,13 @@ Pod::Spec.new do |s|
s.dependency "React-RCTImage"
s.dependency "React-NativeModulesApple"
s.dependency "React-CoreModules"
s.dependency "React-nativeconfig"

if is_new_arch_enabled
s.dependency "React-BridgelessCore"
s.dependency "React-BridgelessHermes"
s.dependency "React-BridgelessApple"
end

if ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == "1"
s.dependency "React-hermes"
Expand Down
2 changes: 2 additions & 0 deletions packages/react-native/React/React-RCTFabric.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ if ENV['USE_FRAMEWORKS']
header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/textlayoutmanager/platform/ios\""
header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/textinput/iostextinput\""
header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/imagemanager/platform/ios\""
header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-nativeconfig/React_nativeconfig.framework/Headers\""
header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\""
header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\""
header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-ImageManager/React_ImageManager.framework/Headers\""
Expand Down Expand Up @@ -85,6 +86,7 @@ Pod::Spec.new do |s|
s.dependency "React-debug"
s.dependency "React-utils"
s.dependency "React-rendererdebug"
s.dependency "React-nativeconfig"

if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
s.dependency "hermes-engine"
Expand Down
13 changes: 0 additions & 13 deletions packages/react-native/ReactCommon/React-Fabric.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ Pod::Spec.new do |s|
ss.header_dir = "butter"
end

s.subspec "config" do |ss|
ss.source_files = "react/config/*.{m,mm,cpp,h}"
ss.header_dir = "react/config"
end

s.subspec "core" do |ss|
header_search_path = [
"\"$(PODS_ROOT)/boost\"",
Expand Down Expand Up @@ -242,14 +237,6 @@ Pod::Spec.new do |s|
ss.header_dir = "react/renderer/imagemanager"
end

s.subspec "mapbuffer" do |ss|
ss.dependency folly_dep_name, folly_version
ss.compiler_flags = folly_compiler_flags
ss.source_files = "react/renderer/mapbuffer/**/*.{m,mm,cpp,h}"
ss.exclude_files = "react/renderer/mapbuffer/tests"
ss.header_dir = "react/renderer/mapbuffer"
end

s.subspec "mounting" do |ss|
ss.dependency folly_dep_name, folly_version
ss.compiler_flags = folly_compiler_flags
Expand Down
43 changes: 43 additions & 0 deletions packages/react-native/ReactCommon/React-Mapbuffer.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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-Mapbuffer"
s.version = version
s.summary = "-"
s.homepage = "https://reactnative.dev/"
s.license = package["license"]
s.author = "Meta Platforms, Inc. and its affiliates"
s.platforms = { :ios => min_ios_version_supported }
s.source = source
s.source_files = "react/renderer/mapbuffer/*.{cpp,h}"
s.exclude_files = "react/renderer/mapbuffer/tests"
s.public_header_files = 'react/renderer/mapbuffer/*.h'
s.header_dir = "react/renderer/mapbuffer"
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\"", "USE_HEADERMAP" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17" }

if ENV['USE_FRAMEWORKS']
s.header_mappings_dir = './'
s.module_name = 'React_Mapbuffer'
end

s.dependency "glog"
s.dependency "React-debug"

end
35 changes: 35 additions & 0 deletions packages/react-native/ReactCommon/React-nativeconfig.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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-nativeconfig"
s.version = version
s.summary = "-"
s.homepage = "https://reactnative.dev/"
s.license = package["license"]
s.author = "Meta Platforms, Inc. and its affiliates"
s.platforms = { :ios => min_ios_version_supported }
s.source = source
s.source_files = "react/config/*.{m,mm,cpp,h}"
s.header_dir = "react/config"

if ENV['USE_FRAMEWORKS']
s.header_mappings_dir = './'
s.module_name = 'React_nativeconfig'
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 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-jsitracing"
s.version = version
s.summary = "Bridgeless for React Native."
s.homepage = "https://reactnative.dev/"
s.license = package["license"]
s.author = "Meta Platforms, Inc. and its affiliates"
s.platforms = { :ios => min_ios_version_supported }
s.source = source
s.source_files = "JSITracing.{cpp,h}"
s.header_dir = "."
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"${PODS_TARGET_SRCROOT}/../..\"",
"USE_HEADERMAP" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
"GCC_WARN_PEDANTIC" => "YES" }

if ENV['USE_FRAMEWORKS']
s.header_mappings_dir = './'
s.module_name = 'React_jsitracing'
end

s.dependency "React-jsi"
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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

folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-gnu-zero-variadic-macro-arguments'
folly_version = '2021.07.22.00'
folly_dep_name = 'RCT-Folly/Fabric'
boost_compiler_flags = '-Wno-documentation'
react_native_path = ".."

Pod::Spec.new do |s|
s.name = "React-jserrorhandler"
s.version = version
s.summary = "-"
s.homepage = "https://reactnative.dev/"
s.license = package["license"]
s.author = "Meta Platforms, Inc. and its affiliates"
s.platforms = { :ios => min_ios_version_supported }
s.source = source
s.header_dir = "jserrorhandler"
s.source_files = "JsErrorHandler.{cpp,h}"
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Mapbuffer/React_Mapbuffer.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\"", "USE_HEADERMAP" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17" }
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags

if ENV['USE_FRAMEWORKS']
s.header_mappings_dir = './'
s.module_name = 'React_jserrorhandler'
end

s.dependency folly_dep_name, folly_version
s.dependency "React-jsi", version
s.dependency "React-Mapbuffer"

end
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

#include <ReactCommon/RuntimeExecutor.h>
#include <jsi/jsi.h>
#include <react/bridgeless/TimerManager.h>
#include <atomic>
#include <queue>
#include "TimerManager.h"

namespace facebook::react {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# 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

folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-gnu-zero-variadic-macro-arguments'
folly_version = '2021.07.22.00'
folly_dep_name = 'RCT-Folly/Fabric'
boost_compiler_flags = '-Wno-documentation'

Pod::Spec.new do |s|
s.name = "React-BridgelessApple"
s.version = version
s.summary = "Bridgeless for React Native."
s.homepage = "https://reactnative.dev/"
s.license = package["license"]
s.author = "Meta Platforms, Inc. and its affiliates"
s.platforms = { :ios => min_ios_version_supported }
s.source = source
s.source_files = "platform/ios/**/*.{mm,h}"
s.header_dir = "ReactCommon"
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_TARGET_SRCROOT)/../..\" \"$(PODS_TARGET_SRCROOT)/../../..\"",
"USE_HEADERMAP" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
"GCC_WARN_PEDANTIC" => "YES" }
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags

if ENV['USE_FRAMEWORKS']
s.header_mappings_dir = './'
s.module_name = 'React_BridgelessApple'
end

s.dependency folly_dep_name, folly_version
s.dependency "React-jsiexecutor"
s.dependency "React-cxxreact"
s.dependency "React-callinvoker"
s.dependency "React-runtimeexecutor"
s.dependency "React-utils"
s.dependency "React-jsi"
s.dependency "React-Core/Default"
s.dependency "React-CoreModules"
s.dependency "React-NativeModulesApple"
s.dependency "React-RCTFabric"
s.dependency "React-BridgelessCore"
s.dependency "React-BridgelessHermes"
s.dependency "React-Mapbuffer"
s.dependency "React-jserrorhandler"

if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
s.dependency "hermes-engine"
else
s.dependency "React-jsi"
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 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

folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-gnu-zero-variadic-macro-arguments'
folly_version = '2021.07.22.00'
folly_dep_name = 'RCT-Folly/Fabric'
boost_compiler_flags = '-Wno-documentation'

Pod::Spec.new do |s|
s.name = "React-BridgelessCore"
s.version = version
s.summary = "Bridgeless for React Native."
s.homepage = "https://reactnative.dev/"
s.license = package["license"]
s.author = "Meta Platforms, Inc. and its affiliates"
s.platforms = { :ios => min_ios_version_supported }
s.source = source
s.source_files = "*.{cpp,h}", "nativeviewconfig/*.{cpp,h}"
s.exclude_files = "iostests/*", "tests/**/*.{cpp,h}"
s.header_dir = "react/bridgeless"
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/Headers/Private/React-Core\" \"${PODS_TARGET_SRCROOT}/../..\"",
"USE_HEADERMAP" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
"GCC_WARN_PEDANTIC" => "YES" }
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags

if ENV['USE_FRAMEWORKS']
s.header_mappings_dir = './'
s.module_name = 'React_BridgelessCore'
end

s.dependency folly_dep_name, folly_version
s.dependency "React-jsiexecutor"
s.dependency "React-cxxreact"
s.dependency "React-runtimeexecutor"
s.dependency "glog"
s.dependency "React-jsi"
s.dependency "React-jserrorhandler"
s.dependency "React-runtimescheduler"

if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
s.dependency "hermes-engine"
else
s.dependency "React-jsi"
end

end
Loading