react-native 0.75.0-rc.4 → 0.75.0-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +2 -2
- package/Libraries/Blob/React-RCTBlob.podspec +1 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Image/RCTImageLoader.mm +2 -6
- package/Libraries/Image/React-RCTImage.podspec +1 -1
- package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -1
- package/Libraries/NativeAnimation/React-RCTAnimation.podspec +1 -1
- package/Libraries/Network/RCTNetworkTask.mm +4 -3
- package/Libraries/Network/React-RCTNetwork.podspec +1 -1
- package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +1 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +26149 -15434
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +1630 -2675
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +1691 -2954
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +27069 -16192
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1657 -2714
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1733 -2980
- package/Libraries/Settings/React-RCTSettings.podspec +1 -1
- package/Libraries/Text/React-RCTText.podspec +1 -1
- package/Libraries/TypeSafety/RCTTypeSafety.podspec +1 -1
- package/Libraries/Utilities/Platform.android.js +1 -1
- package/Libraries/Utilities/Platform.d.ts +1 -1
- package/Libraries/Utilities/Platform.flow.js +2 -2
- package/Libraries/Utilities/Platform.ios.js +1 -1
- package/Libraries/Vibration/React-RCTVibration.podspec +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/CoreModules/RCTPlatform.mm +1 -3
- package/React/CoreModules/React-CoreModules.podspec +1 -1
- package/React/React-RCTFabric.podspec +1 -1
- package/React/Views/RCTComponentData.m +11 -3
- package/React-Core.podspec +1 -1
- package/ReactAndroid/api/ReactAndroid.api +2 -0
- package/ReactAndroid/build.gradle.kts +28 -0
- package/ReactAndroid/cmake-utils/ReactNative-application.cmake +5 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.kt +4 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/Dynamic.kt +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModule.java +64 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableMap.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableNativeMap.kt +24 -24
- package/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/I18nUtil.kt +11 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessCatalystInstance.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/FilterHelper.kt +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/LengthPercentage.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/imagehelper/ResourceDrawableIdHelper.kt +10 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactInstance.cpp +3 -3
- package/ReactApple/Libraries/RCTFoundation/RCTDeprecation/RCTDeprecation.podspec +1 -1
- package/ReactCommon/React-Fabric.podspec +1 -1
- package/ReactCommon/React-FabricComponents.podspec +1 -1
- package/ReactCommon/React-FabricImage.podspec +1 -1
- package/ReactCommon/React-Mapbuffer.podspec +1 -1
- package/ReactCommon/React-nativeconfig.podspec +1 -1
- package/ReactCommon/React-rncore.podspec +1 -1
- package/ReactCommon/ReactCommon.podspec +1 -1
- package/ReactCommon/cxxreact/React-cxxreact.podspec +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/hermes/React-hermes.podspec +1 -1
- package/ReactCommon/hermes/executor/React-jsitracing.podspec +1 -1
- package/ReactCommon/jserrorhandler/React-jserrorhandler.podspec +1 -1
- package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +1 -1
- package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +1 -1
- package/ReactCommon/react/debug/React-debug.podspec +1 -1
- package/ReactCommon/react/featureflags/React-featureflags.podspec +1 -1
- package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -1
- package/ReactCommon/react/nativemodule/defaults/React-defaultsnativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/dom/React-domnativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/featureflags/React-featureflagsnativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/idlecallbacks/React-idlecallbacksnativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/microtasks/React-microtasksnativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +1 -1
- package/ReactCommon/react/performance/timeline/React-performancetimeline.podspec +1 -1
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +4 -3
- package/ReactCommon/react/renderer/components/textinput/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/consistency/React-rendererconsistency.podspec +1 -1
- package/ReactCommon/react/renderer/debug/React-rendererdebug.podspec +1 -1
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +1 -1
- package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +1 -1
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.cpp +1 -1
- package/ReactCommon/react/renderer/runtimescheduler/SchedulerPriorityUtils.h +4 -4
- package/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +65 -0
- package/ReactCommon/react/renderer/runtimescheduler/tests/SchedulerPriorityTest.cpp +2 -2
- package/ReactCommon/react/runtime/React-RuntimeCore.podspec +1 -1
- package/ReactCommon/react/runtime/React-RuntimeHermes.podspec +1 -1
- package/ReactCommon/react/runtime/platform/ios/React-RuntimeApple.podspec +2 -1
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +2 -2
- package/ReactCommon/react/utils/React-utils.podspec +1 -1
- package/ReactCommon/reactperflogger/React-perflogger.podspec +2 -1
- package/cli.js +45 -16
- package/package.json +13 -13
- package/scripts/cocoapods/helpers.rb +4 -0
- package/scripts/cocoapods/new_architecture.rb +10 -23
- package/scripts/cocoapods/privacy_manifest_utils.rb +15 -6
- package/scripts/cocoapods/spm.rb +94 -0
- package/scripts/cocoapods/utils.rb +12 -1
- package/scripts/react-native-xcode.sh +2 -2
- package/scripts/react_native_pods.rb +18 -0
- package/sdks/hermesc/osx-bin/hermes +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/src/private/specs/modules/NativePlatformConstantsAndroid.js +1 -1
- package/src/private/specs/modules/NativePlatformConstantsIOS.js +1 -1
- package/third-party-podspecs/RCT-Folly.podspec +1 -1
- package/third-party-podspecs/fmt.podspec +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModule.kt +0 -55
- package/ReactCommon/react/runtime/BridgelessJSCallInvoker.cpp +0 -29
- package/ReactCommon/react/runtime/BridgelessJSCallInvoker.h +0 -30
|
@@ -9,34 +9,21 @@ require_relative "./utils.rb"
|
|
|
9
9
|
require_relative "./helpers.rb"
|
|
10
10
|
|
|
11
11
|
class NewArchitectureHelper
|
|
12
|
-
@@cplusplus_version = "c++20"
|
|
13
|
-
|
|
14
12
|
@@NewArchWarningEmitted = false # Used not to spam warnings to the user.
|
|
15
13
|
|
|
16
14
|
def self.set_clang_cxx_language_standard_if_needed(installer)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
# The React-Core pod may have a suffix added by Cocoapods, so we test whether 'React-Core' is a substring, and do not require exact match
|
|
21
|
-
if target.name.include? 'React-Core'
|
|
22
|
-
language_standard = target.resolved_build_setting("CLANG_CXX_LANGUAGE_STANDARD", resolve_against_xcconfig: true).values[0]
|
|
23
|
-
end
|
|
24
|
-
end
|
|
15
|
+
projects = installer.aggregate_targets
|
|
16
|
+
.map{ |t| t.user_project }
|
|
17
|
+
.uniq{ |p| p.path }
|
|
25
18
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
.map{ |t| t.user_project }
|
|
29
|
-
.uniq{ |p| p.path }
|
|
19
|
+
projects.each do |project|
|
|
20
|
+
Pod::UI.puts("Setting CLANG_CXX_LANGUAGE_STANDARD to #{ Helpers::Constants::cxx_language_standard } on #{ project.path }")
|
|
30
21
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
project.build_configurations.each do |config|
|
|
35
|
-
config.build_settings["CLANG_CXX_LANGUAGE_STANDARD"] = language_standard
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
project.save()
|
|
22
|
+
project.build_configurations.each do |config|
|
|
23
|
+
config.build_settings["CLANG_CXX_LANGUAGE_STANDARD"] = Helpers::Constants::cxx_language_standard
|
|
39
24
|
end
|
|
25
|
+
|
|
26
|
+
project.save()
|
|
40
27
|
end
|
|
41
28
|
end
|
|
42
29
|
|
|
@@ -103,7 +90,7 @@ class NewArchitectureHelper
|
|
|
103
90
|
current_config["HEADER_SEARCH_PATHS"] = current_headers.empty? ?
|
|
104
91
|
header_search_paths_string :
|
|
105
92
|
"#{current_headers} #{header_search_paths_string}"
|
|
106
|
-
current_config["CLANG_CXX_LANGUAGE_STANDARD"] =
|
|
93
|
+
current_config["CLANG_CXX_LANGUAGE_STANDARD"] = Helpers::Constants::cxx_language_standard
|
|
107
94
|
|
|
108
95
|
|
|
109
96
|
spec.dependency "React-Core"
|
|
@@ -50,7 +50,7 @@ module PrivacyManifestUtils
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
def self.get_application_targets(user_project)
|
|
53
|
-
return user_project.targets.filter { |t| t.symbol_type == :application }
|
|
53
|
+
return user_project.targets.filter { |t| t.respond_to?(:symbol_type) && t.symbol_type == :application }
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
def self.read_privacyinfo_file(file_path)
|
|
@@ -67,26 +67,34 @@ module PrivacyManifestUtils
|
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
def self.ensure_reference(file_path, user_project, target)
|
|
70
|
-
reference_exists = target.resources_build_phase.files_references.any? { |file_ref| file_ref
|
|
70
|
+
reference_exists = target.resources_build_phase.files_references.any? { |file_ref| file_ref&.path&.end_with? "PrivacyInfo.xcprivacy" }
|
|
71
71
|
unless reference_exists
|
|
72
72
|
# We try to find the main group, but if it doesn't exist, we default to adding the file to the project root – both work
|
|
73
|
-
file_root = user_project.root_object.main_group.children.find { |group|
|
|
73
|
+
file_root = user_project.root_object.main_group.children.find { |group|
|
|
74
|
+
group.class == Xcodeproj::Project::Object::PBXGroup && (group.name == target.name || group.path == target.name)
|
|
75
|
+
} || user_project
|
|
74
76
|
file_ref = file_root.new_file(file_path)
|
|
75
77
|
build_file = target.resources_build_phase.add_file_reference(file_ref, true)
|
|
76
78
|
end
|
|
77
79
|
end
|
|
78
80
|
|
|
79
81
|
def self.get_privacyinfo_file_path(user_project, targets)
|
|
82
|
+
|
|
80
83
|
file_refs = targets.flat_map { |target| target.resources_build_phase.files_references }
|
|
81
|
-
existing_file = file_refs.find { |file_ref| file_ref
|
|
84
|
+
existing_file = file_refs.find { |file_ref| file_ref&.path&.end_with?("PrivacyInfo.xcprivacy") }
|
|
85
|
+
|
|
86
|
+
|
|
82
87
|
if existing_file
|
|
83
88
|
return existing_file.real_path
|
|
84
89
|
end
|
|
90
|
+
|
|
85
91
|
# We try to find a file we know exists in the project to get the path to the main group directory
|
|
86
92
|
info_plist_path = user_project.files.find { |file_ref| file_ref.name == "Info.plist" }
|
|
87
93
|
if info_plist_path.nil?
|
|
88
94
|
# return path that is sibling to .xcodeproj
|
|
95
|
+
|
|
89
96
|
path = user_project.path
|
|
97
|
+
|
|
90
98
|
return File.join(File.dirname(path), "PrivacyInfo.xcprivacy")
|
|
91
99
|
end
|
|
92
100
|
return File.join(File.dirname(info_plist_path.real_path),"PrivacyInfo.xcprivacy")
|
|
@@ -117,6 +125,7 @@ module PrivacyManifestUtils
|
|
|
117
125
|
end
|
|
118
126
|
end
|
|
119
127
|
end
|
|
128
|
+
|
|
120
129
|
return used_apis
|
|
121
130
|
end
|
|
122
131
|
|
|
@@ -124,7 +133,7 @@ module PrivacyManifestUtils
|
|
|
124
133
|
privacy_manifests = user_project
|
|
125
134
|
.files
|
|
126
135
|
.select { |p|
|
|
127
|
-
p
|
|
136
|
+
p&.path&.end_with?('PrivacyInfo.xcprivacy')
|
|
128
137
|
}
|
|
129
138
|
return privacy_manifests
|
|
130
139
|
end
|
|
@@ -162,7 +171,7 @@ module PrivacyManifestUtils
|
|
|
162
171
|
"NSPrivacyTracking" => false,
|
|
163
172
|
"NSPrivacyAccessedAPITypes" => get_core_accessed_apis
|
|
164
173
|
}
|
|
165
|
-
path = File.join(user_project
|
|
174
|
+
path = File.join(user_project&.path.parent, "PrivacyInfo.xcprivacy")
|
|
166
175
|
Xcodeproj::Plist.write_to_path(privacy_manifest, path)
|
|
167
176
|
Pod::UI.puts "Your app does not have a privacy manifest! A template has been generated containing Required Reasons API usage in the core React Native library. Please add the PrivacyInfo.xcprivacy file to your project and complete data use, tracking and any additional required reasons your app is using according to Apple's guidance: https://developer.apple.com/documentation/bundleresources/privacy_manifest_files. Then, you will need to manually add this file to your project in Xcode.".red
|
|
168
177
|
end
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
class SPMManager
|
|
7
|
+
def initialize()
|
|
8
|
+
@dependencies_by_pod = {}
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def dependency(pod_spec, url:, requirement:, products:)
|
|
12
|
+
@dependencies_by_pod[pod_spec.name] ||= []
|
|
13
|
+
@dependencies_by_pod[pod_spec.name] << { url: url, requirement: requirement, products: products}
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def apply_on_post_install(installer)
|
|
17
|
+
project = installer.pods_project
|
|
18
|
+
|
|
19
|
+
log 'Cleaning old SPM dependencies from Pods project'
|
|
20
|
+
clean_spm_dependencies_from_target(project, @dependencies_by_pod)
|
|
21
|
+
log 'Adding SPM dependencies to Pods project'
|
|
22
|
+
@dependencies_by_pod.each do |pod_name, dependencies|
|
|
23
|
+
dependencies.each do |spm_spec|
|
|
24
|
+
log "Adding SPM dependency on product #{spm_spec[:products]}"
|
|
25
|
+
add_spm_to_target(
|
|
26
|
+
project,
|
|
27
|
+
project.targets.find { |t| t.name == pod_name},
|
|
28
|
+
spm_spec[:url],
|
|
29
|
+
spm_spec[:requirement],
|
|
30
|
+
spm_spec[:products]
|
|
31
|
+
)
|
|
32
|
+
log " Adding workaround for Swift package not found issue"
|
|
33
|
+
target = project.targets.find { |t| t.name == pod_name}
|
|
34
|
+
target.build_configurations.each do |config|
|
|
35
|
+
target.build_settings(config.name)['SWIFT_INCLUDE_PATHS'] ||= ['$(inherited)']
|
|
36
|
+
search_path = '${SYMROOT}/${CONFIGURATION}${EFFECTIVE_PLATFORM_NAME}/'
|
|
37
|
+
unless target.build_settings(config.name)['SWIFT_INCLUDE_PATHS'].include?(search_path)
|
|
38
|
+
target.build_settings(config.name)['SWIFT_INCLUDE_PATHS'].push(search_path)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
unless @dependencies_by_pod.empty?
|
|
45
|
+
log_warning "If you're using Xcode 15 or earlier you might need to close and reopen the Xcode workspace"
|
|
46
|
+
unless ENV["USE_FRAMEWORKS"] == "dynamic"
|
|
47
|
+
@dependencies_by_pod.each do |pod_name, dependencies|
|
|
48
|
+
log_warning "Pod #{pod_name} is using swift package(s) #{dependencies.map{|i| i[:products]}.flatten.uniq.join(", ")} with static linking, this might cause linker errors. Consider using USE_FRAMEOWRKS=dynamic, see https://github.com/facebook/react-native/pull/44627#issuecomment-2123119711 for more information"
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
private
|
|
55
|
+
|
|
56
|
+
def log(msg)
|
|
57
|
+
::Pod::UI.puts "[SPM] #{msg}"
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def log_warning(msg)
|
|
61
|
+
::Pod::UI.puts "\n\n[SPM] WARNING!!! #{msg}\n\n"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def clean_spm_dependencies_from_target(project, new_targets)
|
|
65
|
+
project.root_object.package_references.delete_if { |pkg| (pkg.class == Xcodeproj::Project::Object::XCRemoteSwiftPackageReference) }
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def add_spm_to_target(project, target, url, requirement, products)
|
|
69
|
+
pkg_class = Xcodeproj::Project::Object::XCRemoteSwiftPackageReference
|
|
70
|
+
ref_class = Xcodeproj::Project::Object::XCSwiftPackageProductDependency
|
|
71
|
+
pkg = project.root_object.package_references.find { |p| p.class == pkg_class && p.repositoryURL == url }
|
|
72
|
+
if !pkg
|
|
73
|
+
pkg = project.new(pkg_class)
|
|
74
|
+
pkg.repositoryURL = url
|
|
75
|
+
pkg.requirement = requirement
|
|
76
|
+
log(" Adding package to workspace: #{pkg.inspect}")
|
|
77
|
+
project.root_object.package_references << pkg
|
|
78
|
+
end
|
|
79
|
+
products.each do |product_name|
|
|
80
|
+
ref = target.package_product_dependencies.find do |r|
|
|
81
|
+
r.class == ref_class && r.package == pkg && r.product_name == product_name
|
|
82
|
+
end
|
|
83
|
+
next if ref
|
|
84
|
+
|
|
85
|
+
log(" Adding product dependency #{product_name} to #{target.name}")
|
|
86
|
+
ref = project.new(ref_class)
|
|
87
|
+
ref.package = pkg
|
|
88
|
+
ref.product_name = product_name
|
|
89
|
+
target.package_product_dependencies << ref
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
SPM = SPMManager.new
|
|
@@ -233,7 +233,18 @@ class ReactNativePodsUtils
|
|
|
233
233
|
end
|
|
234
234
|
|
|
235
235
|
if !file_manager.exist?("#{file_path}.local")
|
|
236
|
-
|
|
236
|
+
# When installing pods with a yarn alias, yarn creates a fake yarn and node executables
|
|
237
|
+
# in a temporary folder.
|
|
238
|
+
# Using `type -a` we are able to retrieve all the paths of an executable and we can
|
|
239
|
+
# exclude the temporary ones.
|
|
240
|
+
# see https://github.com/facebook/react-native/issues/43285 for more info
|
|
241
|
+
node_binary = `type -a node`.split("\n").map { |path|
|
|
242
|
+
path.gsub!("node is ", "")
|
|
243
|
+
}.select { |b|
|
|
244
|
+
return !b.start_with?("/var")
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
node_binary = node_binary[0]
|
|
237
248
|
system("echo 'export NODE_BINARY=#{node_binary}' > #{file_path}.local")
|
|
238
249
|
end
|
|
239
250
|
end
|
|
@@ -90,7 +90,7 @@ fi
|
|
|
90
90
|
|
|
91
91
|
[ -z "$NODE_ARGS" ] && export NODE_ARGS=""
|
|
92
92
|
|
|
93
|
-
[ -z "$
|
|
93
|
+
[ -z "$CLI_PATH" ] && CLI_PATH="$REACT_NATIVE_DIR/scripts/bundle.js"
|
|
94
94
|
|
|
95
95
|
[ -z "$COMPOSE_SOURCEMAP_PATH" ] && COMPOSE_SOURCEMAP_PATH="$REACT_NATIVE_DIR/scripts/compose-source-maps.js"
|
|
96
96
|
|
|
@@ -147,7 +147,7 @@ else
|
|
|
147
147
|
fi
|
|
148
148
|
|
|
149
149
|
# shellcheck disable=SC2086
|
|
150
|
-
"$NODE_BINARY" $NODE_ARGS "$
|
|
150
|
+
"$NODE_BINARY" $NODE_ARGS "$CLI_PATH" $BUNDLE_COMMAND \
|
|
151
151
|
$CONFIG_ARG \
|
|
152
152
|
--config-cmd "$CONFIG" \
|
|
153
153
|
--entry-file "$ENTRY_FILE" \
|
|
@@ -17,6 +17,7 @@ require_relative './cocoapods/local_podspec_patch.rb'
|
|
|
17
17
|
require_relative './cocoapods/runtime.rb'
|
|
18
18
|
require_relative './cocoapods/helpers.rb'
|
|
19
19
|
require_relative './cocoapods/privacy_manifest_utils.rb'
|
|
20
|
+
require_relative './cocoapods/spm.rb'
|
|
20
21
|
# Importing to expose use_native_modules!
|
|
21
22
|
require_relative './cocoapods/autolinking.rb'
|
|
22
23
|
|
|
@@ -242,6 +243,18 @@ def install_modules_dependencies(spec, new_arch_enabled: NewArchitectureHelper.n
|
|
|
242
243
|
NewArchitectureHelper.install_modules_dependencies(spec, new_arch_enabled, folly_config[:version])
|
|
243
244
|
end
|
|
244
245
|
|
|
246
|
+
|
|
247
|
+
# This function can be used by library developer to declare a SwiftPackageManager dependency.
|
|
248
|
+
#
|
|
249
|
+
# Parameters:
|
|
250
|
+
# - spec: The spec the Swift Package Manager dependency has to be added to
|
|
251
|
+
# - url: The URL of the Swift Package Manager dependency
|
|
252
|
+
# - requirement: The version requirement of the Swift Package Manager dependency (eg. ` {kind: 'upToNextMajorVersion', minimumVersion: '5.9.1'},`)
|
|
253
|
+
# - products: The product/target of the Swift Package Manager dependency (eg. AlamofireDynamic)
|
|
254
|
+
def spm_dependency(spec, url:, requirement:, products:)
|
|
255
|
+
SPM.dependency(spec, url: url, requirement: requirement, products: products)
|
|
256
|
+
end
|
|
257
|
+
|
|
245
258
|
# It returns the default flags.
|
|
246
259
|
# deprecated.
|
|
247
260
|
def get_default_flags()
|
|
@@ -259,6 +272,10 @@ def get_folly_config()
|
|
|
259
272
|
return Helpers::Constants.folly_config
|
|
260
273
|
end
|
|
261
274
|
|
|
275
|
+
def rct_cxx_language_standard()
|
|
276
|
+
return Helpers::Constants.cxx_language_standard
|
|
277
|
+
end
|
|
278
|
+
|
|
262
279
|
# Function that executes after React Native has been installed to configure some flags and build settings.
|
|
263
280
|
#
|
|
264
281
|
# Parameters
|
|
@@ -297,6 +314,7 @@ def react_native_post_install(
|
|
|
297
314
|
ReactNativePodsUtils.updateOSDeploymentTarget(installer)
|
|
298
315
|
ReactNativePodsUtils.set_dynamic_frameworks_flags(installer)
|
|
299
316
|
ReactNativePodsUtils.add_ndebug_flag_to_pods_in_release(installer)
|
|
317
|
+
SPM.apply_on_post_install(installer)
|
|
300
318
|
|
|
301
319
|
if privacy_file_aggregation_enabled
|
|
302
320
|
PrivacyManifestUtils.add_aggregated_privacy_manifest(installer)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -82,7 +82,7 @@ Pod::Spec.new do |spec|
|
|
|
82
82
|
spec.libraries = "c++abi" # NOTE Apple-only: Keep c++abi here due to https://github.com/react-native-community/releases/issues/251
|
|
83
83
|
spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
|
|
84
84
|
"DEFINES_MODULE" => "YES",
|
|
85
|
-
"CLANG_CXX_LANGUAGE_STANDARD" =>
|
|
85
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
|
86
86
|
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\"",
|
|
87
87
|
# In dynamic framework (use_frameworks!) mode, ignore the unused and undefined boost symbols when generating the library.
|
|
88
88
|
"OTHER_LDFLAGS" => "\"-Wl,-U,_jump_fcontext\" \"-Wl,-U,_make_fcontext\""
|
|
@@ -15,7 +15,7 @@ Pod::Spec.new do |spec|
|
|
|
15
15
|
:tag => "9.1.0"
|
|
16
16
|
}
|
|
17
17
|
spec.pod_target_xcconfig = {
|
|
18
|
-
"CLANG_CXX_LANGUAGE_STANDARD" =>
|
|
18
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
|
19
19
|
}
|
|
20
20
|
spec.platforms = min_supported_versions
|
|
21
21
|
spec.libraries = "c++"
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
package com.facebook.react.bridge
|
|
9
|
-
|
|
10
|
-
import com.facebook.proguard.annotations.DoNotStrip
|
|
11
|
-
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
|
|
12
|
-
import com.facebook.react.common.annotations.StableReactNativeAPI
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* A native module whose API can be provided to JS catalyst instances. [NativeModule]s whose
|
|
16
|
-
* implementation is written in Kotlin should extend [BaseJavaModule] or
|
|
17
|
-
* [ReactContextBaseJavaModule]. [NativeModule]s whose implementation is written in C++ must not
|
|
18
|
-
* provide any Kotlin code (so they can be reused on other platforms), and instead should register
|
|
19
|
-
* themselves using [CxxModuleWrapper].
|
|
20
|
-
*/
|
|
21
|
-
@StableReactNativeAPI
|
|
22
|
-
@DoNotStrip
|
|
23
|
-
public interface NativeModule {
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* @return the name of this module. This will be the name used to `require()` this module from
|
|
27
|
-
* javascript.
|
|
28
|
-
*/
|
|
29
|
-
public fun getName(): String
|
|
30
|
-
|
|
31
|
-
/** This method is called after [ReactApplicationContext] has been created. */
|
|
32
|
-
public fun initialize(): Unit
|
|
33
|
-
|
|
34
|
-
/** Allow NativeModule to clean up. Called before React Native instance is destroyed. */
|
|
35
|
-
public fun invalidate(): Unit
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Return true if you intend to override some other native module that was registered e.g. as part
|
|
39
|
-
* of a different package (such as the core one). Trying to override without returning true from
|
|
40
|
-
* this method is considered an error and will throw an exception during initialization. By
|
|
41
|
-
* default all modules return false.
|
|
42
|
-
*/
|
|
43
|
-
@DeprecatedInNewArchitecture() public fun canOverrideExistingModule(): Boolean = false
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Allow NativeModule to clean up. Called before [CatalystInstance.onHostDestroy]
|
|
47
|
-
*
|
|
48
|
-
* @deprecated use [NativeModule.invalidate()] instead.
|
|
49
|
-
*/
|
|
50
|
-
@Deprecated(
|
|
51
|
-
"Use invalidate method instead",
|
|
52
|
-
replaceWith = ReplaceWith("invalidate()"),
|
|
53
|
-
level = DeprecationLevel.WARNING)
|
|
54
|
-
public fun onCatalystInstanceDestroy(): Unit = Unit
|
|
55
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#include "BridgelessJSCallInvoker.h"
|
|
9
|
-
|
|
10
|
-
#include <stdexcept>
|
|
11
|
-
|
|
12
|
-
namespace facebook::react {
|
|
13
|
-
|
|
14
|
-
BridgelessJSCallInvoker::BridgelessJSCallInvoker(
|
|
15
|
-
RuntimeExecutor runtimeExecutor)
|
|
16
|
-
: runtimeExecutor_(std::move(runtimeExecutor)) {}
|
|
17
|
-
|
|
18
|
-
void BridgelessJSCallInvoker::invokeAsync(CallFunc&& func) noexcept {
|
|
19
|
-
runtimeExecutor_(
|
|
20
|
-
[func = std::move(func)](jsi::Runtime& runtime) { func(runtime); });
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
void BridgelessJSCallInvoker::invokeSync(CallFunc&& /*func*/) {
|
|
24
|
-
// TODO: Implement this method. The TurboModule infra doesn't call invokeSync.
|
|
25
|
-
throw std::runtime_error(
|
|
26
|
-
"Synchronous native -> JS calls are currently not supported.");
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
} // namespace facebook::react
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#include <ReactCommon/CallInvoker.h>
|
|
11
|
-
#include <ReactCommon/RuntimeExecutor.h>
|
|
12
|
-
#include <functional>
|
|
13
|
-
|
|
14
|
-
namespace facebook::react {
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* A native-to-JS call invoker that uses the RuntimeExecutor. It guarantees that
|
|
18
|
-
* any calls from any thread are queued on the right JS thread.
|
|
19
|
-
*/
|
|
20
|
-
class BridgelessJSCallInvoker : public CallInvoker {
|
|
21
|
-
public:
|
|
22
|
-
explicit BridgelessJSCallInvoker(RuntimeExecutor runtimeExecutor);
|
|
23
|
-
void invokeAsync(CallFunc&& func) noexcept override;
|
|
24
|
-
void invokeSync(CallFunc&& func) override;
|
|
25
|
-
|
|
26
|
-
private:
|
|
27
|
-
RuntimeExecutor runtimeExecutor_;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
} // namespace facebook::react
|