react-native-macos 0.76.9 → 0.76.10
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/Components/TextInput/TextInputState.js +5 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Inspector/NetworkOverlay.js +1 -1
- package/Libraries/Lists/FillRateHelper.js +3 -3
- package/Libraries/Lists/FlatList.d.ts +1 -1
- package/Libraries/Lists/FlatList.js +2 -2
- package/Libraries/Lists/SectionList.d.ts +1 -1
- package/Libraries/Lists/SectionList.js +2 -2
- package/Libraries/Lists/SectionListModern.js +2 -2
- package/Libraries/Lists/ViewabilityHelper.js +3 -3
- package/Libraries/Lists/VirtualizeUtils.js +2 -2
- package/Libraries/Lists/VirtualizedList.js +3 -3
- package/Libraries/Lists/VirtualizedListContext.js +2 -2
- package/Libraries/Lists/VirtualizedSectionList.js +3 -3
- package/Libraries/Modal/Modal.js +1 -1
- package/Libraries/Text/Text.d.ts +1 -0
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.mm +1 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +2354 -0
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +2820 -0
- package/React/Views/RCTViewKeyboardEvent.m +24 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/package.json +4 -3
- package/scripts/cocoapods/utils.rb +11 -5
- package/sdks/hermes-engine/hermes-engine.podspec +3 -4
- package/sdks/hermes-engine/hermes-utils.rb +70 -18
- package/types/index.d.ts +1 -1
|
@@ -63,6 +63,30 @@
|
|
|
63
63
|
return @"PageUp";
|
|
64
64
|
} else if (code == NSPageDownFunctionKey) {
|
|
65
65
|
return @"PageDown";
|
|
66
|
+
} else if (code == NSF1FunctionKey) {
|
|
67
|
+
return @"F1";
|
|
68
|
+
} else if (code == NSF2FunctionKey) {
|
|
69
|
+
return @"F2";
|
|
70
|
+
} else if (code == NSF3FunctionKey) {
|
|
71
|
+
return @"F3";
|
|
72
|
+
} else if (code == NSF4FunctionKey) {
|
|
73
|
+
return @"F4";
|
|
74
|
+
} else if (code == NSF5FunctionKey) {
|
|
75
|
+
return @"F5";
|
|
76
|
+
} else if (code == NSF6FunctionKey) {
|
|
77
|
+
return @"F6";
|
|
78
|
+
} else if (code == NSF7FunctionKey) {
|
|
79
|
+
return @"F7";
|
|
80
|
+
} else if (code == NSF8FunctionKey) {
|
|
81
|
+
return @"F8";
|
|
82
|
+
} else if (code == NSF9FunctionKey) {
|
|
83
|
+
return @"F9";
|
|
84
|
+
} else if (code == NSF10FunctionKey) {
|
|
85
|
+
return @"F10";
|
|
86
|
+
} else if (code == NSF11FunctionKey) {
|
|
87
|
+
return @"F11";
|
|
88
|
+
} else if (code == NSF12FunctionKey) {
|
|
89
|
+
return @"F12";
|
|
66
90
|
}
|
|
67
91
|
|
|
68
92
|
return key;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-macos",
|
|
3
|
-
"version": "0.76.
|
|
3
|
+
"version": "0.76.10",
|
|
4
4
|
"description": "React Native for macOS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -102,7 +102,8 @@
|
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
104
|
"@types/react": "^18.2.6",
|
|
105
|
-
"react": "^18.2.0"
|
|
105
|
+
"react": "^18.2.0",
|
|
106
|
+
"react-native": "0.76.9"
|
|
106
107
|
},
|
|
107
108
|
"peerDependenciesMeta": {
|
|
108
109
|
"@types/react": {
|
|
@@ -111,7 +112,7 @@
|
|
|
111
112
|
},
|
|
112
113
|
"dependencies": {
|
|
113
114
|
"@jest/create-cache-key-function": "^29.6.3",
|
|
114
|
-
"@react-native-
|
|
115
|
+
"@react-native-macos/virtualized-lists": "0.76.10",
|
|
115
116
|
"@react-native/assets-registry": "0.76.9",
|
|
116
117
|
"@react-native/codegen": "0.76.9",
|
|
117
118
|
"@react-native/community-cli-plugin": "0.76.9",
|
|
@@ -194,16 +194,22 @@ class ReactNativePodsUtils
|
|
|
194
194
|
private
|
|
195
195
|
|
|
196
196
|
def self.add_build_settings_to_pod(installer, settings_name, settings_value, target_pod_name, configuration_type)
|
|
197
|
+
# [macOS
|
|
198
|
+
# Since some RN projects might combine multiple platforms into the same Xcode project,
|
|
199
|
+
# we'll be much more forgiving with the pod name matching in react-native-macos.
|
|
200
|
+
# Could be upstreamed as part of https://github.com/microsoft/react-native-macos/issues/2526.
|
|
201
|
+
valid_suffixes = ["", "-iOS", "-macOS", "-visionOS"]
|
|
202
|
+
# macOS]
|
|
197
203
|
installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
|
|
198
|
-
if pod_name.to_s == target_pod_name
|
|
204
|
+
if valid_suffixes.any? { |suffix| pod_name.to_s == "#{target_pod_name}#{suffix}" } # [macOS]
|
|
199
205
|
target_installation_result.native_target.build_configurations.each do |config|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
end
|
|
206
|
+
if configuration_type == nil || (configuration_type != nil && config.type == configuration_type)
|
|
207
|
+
config.build_settings[settings_name] ||= '$(inherited) '
|
|
208
|
+
config.build_settings[settings_name] << settings_value
|
|
204
209
|
end
|
|
205
210
|
end
|
|
206
211
|
end
|
|
212
|
+
end
|
|
207
213
|
end
|
|
208
214
|
|
|
209
215
|
def self.fix_library_search_path(config)
|
|
@@ -16,14 +16,13 @@ react_native_path = File.dirname(Pod::Executable.execute_command('node', ['-p',
|
|
|
16
16
|
|
|
17
17
|
# package.json
|
|
18
18
|
package = JSON.parse(File.read(File.join(react_native_path, "package.json")))
|
|
19
|
-
# [macOS
|
|
20
|
-
rn_version = package['version']
|
|
21
|
-
version = findLastestVersionWithArtifact(rn_version) || rn_version
|
|
22
|
-
# macOS]
|
|
19
|
+
version = findMatchingHermesVersion(package) # [macOS] Use special logic instead of just package['version']
|
|
23
20
|
|
|
24
21
|
source_type = hermes_source_type(version, react_native_path)
|
|
25
22
|
source = podspec_source(source_type, version, react_native_path)
|
|
26
23
|
|
|
24
|
+
version = version || package['version'] # [macOS] If version is nil, fall back to package version so CocoaPods doesn't fail
|
|
25
|
+
|
|
27
26
|
Pod::Spec.new do |spec|
|
|
28
27
|
spec.name = "hermes-engine"
|
|
29
28
|
spec.version = version
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
require 'net/http'
|
|
7
7
|
require 'rexml/document'
|
|
8
8
|
require 'open3' # [macOS]
|
|
9
|
+
require 'json' # [macOS]
|
|
10
|
+
require 'tmpdir' # [macOS]
|
|
9
11
|
|
|
10
12
|
HERMES_GITHUB_URL = "https://github.com/facebook/hermes.git"
|
|
11
13
|
ENV_BUILD_FROM_SOURCE = "RCT_BUILD_HERMES_FROM_SOURCE"
|
|
@@ -174,8 +176,18 @@ def podspec_source_build_from_github_tag(react_native_path)
|
|
|
174
176
|
end
|
|
175
177
|
|
|
176
178
|
def podspec_source_build_from_github_main()
|
|
177
|
-
hermes_log("Using the latest commit from main.")
|
|
178
|
-
return {:git => HERMES_GITHUB_URL, :commit => `git ls-remote #{HERMES_GITHUB_URL} main | cut -f 1`.strip}
|
|
179
|
+
# hermes_log("Using the latest commit from main.")
|
|
180
|
+
# return {:git => HERMES_GITHUB_URL, :commit => `git ls-remote #{HERMES_GITHUB_URL} main | cut -f 1`.strip}
|
|
181
|
+
|
|
182
|
+
# [macOS
|
|
183
|
+
# The logic for this is a bit different on macOS.
|
|
184
|
+
# Since react-native-macos lags slightly behind facebook/react-native, we can't always use
|
|
185
|
+
# the latest Hermes commit because Hermes and JSI don't always guarantee backwards compatibility.
|
|
186
|
+
# Instead, we take the commit hash of Hermes at the time of the merge base with facebook/react-native.
|
|
187
|
+
commit = hermes_commit_at_merge_base()
|
|
188
|
+
hermes_log("Using Hermes commit from the merge base with facebook/react-native: #{commit}")
|
|
189
|
+
return {:git => HERMES_GITHUB_URL, :commit => commit}
|
|
190
|
+
# macOS]
|
|
179
191
|
end
|
|
180
192
|
|
|
181
193
|
def podspec_source_download_prebuild_release_tarball(react_native_path, version)
|
|
@@ -198,6 +210,51 @@ def artifacts_dir()
|
|
|
198
210
|
return File.join(Pod::Config.instance.project_pods_root, "hermes-engine-artifacts")
|
|
199
211
|
end
|
|
200
212
|
|
|
213
|
+
# [macOS
|
|
214
|
+
def hermes_commit_at_merge_base()
|
|
215
|
+
# We don't need ls-remote because react-native-macos is a fork of facebook/react-native
|
|
216
|
+
fetch_result = `git fetch -q https://github.com/facebook/react-native.git`
|
|
217
|
+
if $?.exitstatus != 0
|
|
218
|
+
abort <<-EOS
|
|
219
|
+
[Hermes] Failed to fetch facebook/react-native into the local repository.
|
|
220
|
+
EOS
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
merge_base = `git merge-base FETCH_HEAD HEAD`.strip
|
|
224
|
+
if merge_base.empty?
|
|
225
|
+
abort <<-EOS
|
|
226
|
+
[Hermes] Unable to find the merge base between our HEAD and upstream's HEAD.
|
|
227
|
+
EOS
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
timestamp = `git show -s --format=%ci #{merge_base}`.strip
|
|
231
|
+
if timestamp.empty?
|
|
232
|
+
abort <<-EOS
|
|
233
|
+
[Hermes] Unable to extract the timestamp for the merge base (#{merge_base}).
|
|
234
|
+
EOS
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
commit = nil
|
|
238
|
+
Dir.mktmpdir do |tmpdir|
|
|
239
|
+
hermes_git_dir = File.join(tmpdir, "hermes.git")
|
|
240
|
+
# Unfortunately we can't use git rev-list on HERMES_GITHUB_URL directly since we're not in that repo.
|
|
241
|
+
# Instead, we create a shallow clone to avoid downloading the entire history.
|
|
242
|
+
`git clone -q --bare --shallow-since="#{timestamp}" #{HERMES_GITHUB_URL} "#{hermes_git_dir}"`
|
|
243
|
+
`git --git-dir="#{hermes_git_dir}" fetch -q --deepen=1`
|
|
244
|
+
|
|
245
|
+
# If all goes well, this will be the commit hash of Hermes at the time of the merge base
|
|
246
|
+
commit = `git --git-dir="#{hermes_git_dir}" rev-list -1 --before="#{timestamp}" HEAD`.strip
|
|
247
|
+
if commit.empty?
|
|
248
|
+
abort <<-EOS
|
|
249
|
+
[Hermes] Unable to find the Hermes commit hash at time #{timestamp}.
|
|
250
|
+
EOS
|
|
251
|
+
end
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
return commit
|
|
255
|
+
end
|
|
256
|
+
# macOS]
|
|
257
|
+
|
|
201
258
|
def hermestag_file(react_native_path)
|
|
202
259
|
return File.join(react_native_path, "sdks", ".hermesversion")
|
|
203
260
|
end
|
|
@@ -235,25 +292,20 @@ def resolve_url_redirects(url)
|
|
|
235
292
|
return (`curl -Ls -o /dev/null -w %{url_effective} \"#{url}\"`)
|
|
236
293
|
end
|
|
237
294
|
|
|
238
|
-
# [macOS
|
|
239
|
-
#
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
versions = metadata.elements.to_a('//metadata/versioning/versions/version')
|
|
246
|
-
|
|
247
|
-
# Extract version numbers and sort them
|
|
248
|
-
filtered_versions = versions.select { |version| version.text.match?(/^#{versionWithoutPatch}\.\d+$/) }
|
|
249
|
-
if filtered_versions.empty?
|
|
250
|
-
return
|
|
295
|
+
# [macOS
|
|
296
|
+
# Tries to find a suitable Hermes version for a given react-native-macos package.
|
|
297
|
+
# For stable branches, we prefer this to be specified as a peer dependency.
|
|
298
|
+
def findMatchingHermesVersion(package)
|
|
299
|
+
if package['version'] == "1000.0.0"
|
|
300
|
+
# The main branch builds from source, so skip this check
|
|
301
|
+
return nil
|
|
251
302
|
end
|
|
252
303
|
|
|
253
|
-
|
|
254
|
-
|
|
304
|
+
if package['peerDependencies']
|
|
305
|
+
return package['peerDependencies']['react-native']
|
|
306
|
+
end
|
|
255
307
|
|
|
256
|
-
|
|
308
|
+
hermes_log("No matching Hermes version found. Defaulting to main branch, which may be unreliable.")
|
|
257
309
|
end
|
|
258
310
|
# macOS]
|
|
259
311
|
|
package/types/index.d.ts
CHANGED
|
@@ -117,7 +117,7 @@ export * from '../Libraries/LayoutAnimation/LayoutAnimation';
|
|
|
117
117
|
export * from '../Libraries/Linking/Linking';
|
|
118
118
|
export * from '../Libraries/Lists/FlatList';
|
|
119
119
|
export * from '../Libraries/Lists/SectionList';
|
|
120
|
-
export * from '@react-native-
|
|
120
|
+
export * from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
121
121
|
export * from '../Libraries/LogBox/LogBox';
|
|
122
122
|
export * from '../Libraries/Modal/Modal';
|
|
123
123
|
export * as Systrace from '../Libraries/Performance/Systrace';
|