react-native-macos 0.76.8 → 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.
Files changed (85) hide show
  1. package/Libraries/AppDelegate/RCTAppSetupUtils.mm +1 -1
  2. package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +1 -0
  3. package/Libraries/Blob/React-RCTBlob.podspec +3 -1
  4. package/Libraries/Components/TextInput/TextInput.d.ts +16 -0
  5. package/Libraries/Components/TextInput/TextInput.flow.js +2 -0
  6. package/Libraries/Components/TextInput/TextInput.js +4 -0
  7. package/Libraries/Components/TextInput/TextInputState.js +5 -1
  8. package/Libraries/Core/ReactNativeVersion.js +1 -1
  9. package/Libraries/Inspector/NetworkOverlay.js +1 -1
  10. package/Libraries/Lists/FillRateHelper.js +3 -3
  11. package/Libraries/Lists/FlatList.d.ts +1 -1
  12. package/Libraries/Lists/FlatList.js +2 -2
  13. package/Libraries/Lists/SectionList.d.ts +1 -1
  14. package/Libraries/Lists/SectionList.js +2 -2
  15. package/Libraries/Lists/SectionListModern.js +2 -2
  16. package/Libraries/Lists/ViewabilityHelper.js +3 -3
  17. package/Libraries/Lists/VirtualizeUtils.js +2 -2
  18. package/Libraries/Lists/VirtualizedList.js +3 -3
  19. package/Libraries/Lists/VirtualizedListContext.js +2 -2
  20. package/Libraries/Lists/VirtualizedSectionList.js +3 -3
  21. package/Libraries/Modal/Modal.js +1 -1
  22. package/Libraries/Network/FormData.js +11 -3
  23. package/Libraries/Network/RCTDataRequestHandler.mm +17 -3
  24. package/Libraries/Network/RCTFileRequestHandler.mm +17 -3
  25. package/Libraries/Text/Text.d.ts +1 -0
  26. package/Libraries/Text/TextInput/Singleline/RCTUITextField.mm +1 -1
  27. package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
  28. package/React/Base/RCTVersion.m +1 -1
  29. package/React/CoreModules/React-CoreModules.podspec +9 -10
  30. package/React/CxxModule/RCTCxxMethod.mm +10 -2
  31. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +2354 -0
  32. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +2820 -0
  33. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h +1 -1
  34. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +1 -5
  35. package/React/Fabric/Surface/RCTFabricSurface.mm +1 -0
  36. package/React/React-RCTFabric.podspec +1 -0
  37. package/React/Views/RCTViewKeyboardEvent.m +24 -0
  38. package/React/third-party.xcconfig +1 -1
  39. package/React-Core.podspec +2 -1
  40. package/ReactAndroid/api/ReactAndroid.api +1 -1
  41. package/ReactAndroid/build.gradle.kts +24 -0
  42. package/ReactAndroid/gradle.properties +1 -1
  43. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +3 -1
  44. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/HMRClient.java +4 -1
  45. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +13 -8
  46. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  47. package/ReactAndroid/src/main/jni/CMakeLists.txt +1 -0
  48. package/ReactAndroid/src/main/jni/third-party/fast_float/CMakeLists.txt +13 -0
  49. package/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt +5 -6
  50. package/ReactCommon/React-Fabric.podspec +2 -1
  51. package/ReactCommon/React-FabricComponents.podspec +3 -1
  52. package/ReactCommon/React-FabricImage.podspec +7 -5
  53. package/ReactCommon/ReactCommon.podspec +9 -8
  54. package/ReactCommon/cxxreact/CxxNativeModule.cpp +6 -3
  55. package/ReactCommon/cxxreact/React-cxxreact.podspec +11 -10
  56. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  57. package/ReactCommon/hermes/React-hermes.podspec +7 -6
  58. package/ReactCommon/jsi/React-jsi.podspec +4 -3
  59. package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +7 -6
  60. package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +4 -4
  61. package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -1
  62. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +24 -13
  63. package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +3 -1
  64. package/ReactCommon/react/renderer/debug/React-rendererdebug.podspec +4 -2
  65. package/ReactCommon/react/renderer/graphics/React-graphics.podspec +4 -2
  66. package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +1 -0
  67. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h +24 -3
  68. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +1 -41
  69. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +4 -5
  70. package/ReactCommon/reactperflogger/React-perflogger.podspec +1 -0
  71. package/cli.js +11 -2
  72. package/gradle/libs.versions.toml +3 -2
  73. package/package.json +10 -9
  74. package/react-native.config.js +24 -23
  75. package/scripts/cocoapods/codegen_utils.rb +1 -2
  76. package/scripts/cocoapods/helpers.rb +13 -1
  77. package/scripts/cocoapods/new_architecture.rb +1 -0
  78. package/scripts/cocoapods/utils.rb +13 -5
  79. package/scripts/react_native_pods.rb +14 -0
  80. package/sdks/hermes-engine/hermes-engine.podspec +3 -4
  81. package/sdks/hermes-engine/hermes-utils.rb +70 -18
  82. package/third-party-podspecs/RCT-Folly.podspec +16 -7
  83. package/third-party-podspecs/fast_float.podspec +29 -0
  84. package/third-party-podspecs/fmt.podspec +2 -2
  85. package/types/index.d.ts +1 -1
@@ -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 react-native-macos does not publish macos specific hermes artifacts
239
- # so we attempt to find the latest patch version of the iOS artifacts and use that
240
- def findLastestVersionWithArtifact(version)
241
- versionWithoutPatch = version.match(/^(\d+\.\d+)/)
242
- xml_data, = Open3.capture3("curl -s https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/maven-metadata.xml")
243
-
244
- metadata = REXML::Document.new(xml_data)
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
- version_numbers = filtered_versions.map { |version| version.text }
254
- sorted_versions = version_numbers.sort_by { |v| Gem::Version.new(v) }
304
+ if package['peerDependencies']
305
+ return package['peerDependencies']['react-native']
306
+ end
255
307
 
256
- return sorted_versions.last
308
+ hermes_log("No matching Hermes version found. Defaulting to main branch, which may be unreliable.")
257
309
  end
258
310
  # macOS]
259
311
 
@@ -23,7 +23,8 @@ Pod::Spec.new do |spec|
23
23
  spec.dependency 'boost'
24
24
  spec.dependency 'DoubleConversion'
25
25
  spec.dependency 'glog'
26
- spec.dependency "fmt", "9.1.0"
26
+ spec.dependency "fast_float"
27
+ spec.dependency "fmt"
27
28
  spec.compiler_flags = folly_compiler_flags + ' -DFOLLY_HAVE_PTHREAD=1 -Wno-documentation -faligned-new'
28
29
  spec.source_files = 'folly/String.cpp',
29
30
  'folly/Conv.cpp',
@@ -34,18 +35,19 @@ Pod::Spec.new do |spec|
34
35
  'folly/lang/ToAscii.cpp',
35
36
  'folly/ScopeGuard.cpp',
36
37
  'folly/Unicode.cpp',
37
- 'folly/dynamic.cpp',
38
- 'folly/json.cpp',
39
- 'folly/json_pointer.cpp',
38
+ 'folly/json/dynamic.cpp',
39
+ 'folly/json/json.cpp',
40
+ 'folly/json/json_pointer.cpp',
40
41
  'folly/container/detail/F14Table.cpp',
41
42
  'folly/detail/Demangle.cpp',
42
43
  'folly/detail/FileUtilDetail.cpp',
43
44
  'folly/detail/SplitStringSimd.cpp',
45
+ 'folly/detail/StaticSingletonManager.cpp',
44
46
  'folly/detail/UniqueInstance.cpp',
45
47
  'folly/hash/SpookyHashV2.cpp',
46
- 'folly/lang/Assume.cpp',
47
48
  'folly/lang/CString.cpp',
48
49
  'folly/lang/Exception.cpp',
50
+ 'folly/memory/ReentrantAllocator.cpp',
49
51
  'folly/memory/detail/MallocImpl.cpp',
50
52
  'folly/net/NetOps.cpp',
51
53
  'folly/portability/SysUio.cpp',
@@ -53,11 +55,15 @@ Pod::Spec.new do |spec|
53
55
  'folly/system/AtFork.cpp',
54
56
  'folly/system/ThreadId.cpp',
55
57
  'folly/*.h',
58
+ 'folly/algorithm/simd/*.h',
59
+ 'folly/algorithm/simd/detail/*.h',
60
+ 'folly/chrono/*.h',
56
61
  'folly/container/*.h',
57
62
  'folly/container/detail/*.h',
58
63
  'folly/detail/*.h',
59
64
  'folly/functional/*.h',
60
65
  'folly/hash/*.h',
66
+ 'folly/json/*.h',
61
67
  'folly/lang/*.h',
62
68
  'folly/memory/*.h',
63
69
  'folly/memory/detail/*.h',
@@ -68,11 +74,15 @@ Pod::Spec.new do |spec|
68
74
 
69
75
  # workaround for https://github.com/facebook/react-native/issues/14326
70
76
  spec.preserve_paths = 'folly/*.h',
77
+ 'folly/algorithm/simd/*.h',
78
+ 'folly/algorithm/simd/detail/*.h',
79
+ 'folly/chrono/*.h',
71
80
  'folly/container/*.h',
72
81
  'folly/container/detail/*.h',
73
82
  'folly/detail/*.h',
74
83
  'folly/functional/*.h',
75
84
  'folly/hash/*.h',
85
+ 'folly/json/*.h',
76
86
  'folly/lang/*.h',
77
87
  'folly/memory/*.h',
78
88
  'folly/memory/detail/*.h',
@@ -84,7 +94,7 @@ Pod::Spec.new do |spec|
84
94
  spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
85
95
  "DEFINES_MODULE" => "YES",
86
96
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
87
- "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\"",
97
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fast_float/include\" \"$(PODS_ROOT)/fmt/include\"",
88
98
  # In dynamic framework (use_frameworks!) mode, ignore the unused and undefined boost symbols when generating the library.
89
99
  "OTHER_LDFLAGS" => "\"-Wl,-U,_jump_fcontext\" \"-Wl,-U,_make_fcontext\""
90
100
  }
@@ -105,7 +115,6 @@ Pod::Spec.new do |spec|
105
115
  'folly/concurrency/CacheLocality.cpp',
106
116
  'folly/detail/Futex.cpp',
107
117
  'folly/synchronization/ParkingLot.cpp',
108
- 'folly/portability/Malloc.cpp',
109
118
  'folly/concurrency/CacheLocality.h',
110
119
  'folly/synchronization/*.h',
111
120
  'folly/system/ThreadId.h'
@@ -0,0 +1,29 @@
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
+ fast_float_config = get_fast_float_config()
7
+ fast_float_git_url = fast_float_config[:git]
8
+
9
+ Pod::Spec.new do |spec|
10
+ spec.name = "fast_float"
11
+ spec.version = "6.1.4"
12
+ spec.license = { :type => "MIT" }
13
+ spec.homepage = "https://github.com/fastfloat/fast_float"
14
+ spec.summary = "{fast_float} is an open-source number parsing library for C++. The library provides fast header-only implementations."
15
+ spec.authors = "The fast_float contributors"
16
+ spec.source = {
17
+ :git => fast_float_git_url,
18
+ :tag => "v6.1.4"
19
+ }
20
+ spec.pod_target_xcconfig = {
21
+ "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
22
+ "GCC_WARN_INHIBIT_ALL_WARNINGS" => "YES" # Disable warnings because we don't control this library
23
+ }
24
+ spec.platforms = min_supported_versions
25
+ spec.libraries = "c++"
26
+ spec.public_header_files = "include/fast_float/*.h"
27
+ spec.header_mappings_dir = "include"
28
+ spec.source_files = ["include/fast_float/*.h"]
29
+ end
@@ -8,14 +8,14 @@ fmt_git_url = fmt_config[:git]
8
8
 
9
9
  Pod::Spec.new do |spec|
10
10
  spec.name = "fmt"
11
- spec.version = "9.1.0"
11
+ spec.version = "11.0.2"
12
12
  spec.license = { :type => "MIT" }
13
13
  spec.homepage = "https://github.com/fmtlib/fmt"
14
14
  spec.summary = "{fmt} is an open-source formatting library for C++. It can be used as a safe and fast alternative to (s)printf and iostreams."
15
15
  spec.authors = "The fmt contributors"
16
16
  spec.source = {
17
17
  :git => fmt_git_url,
18
- :tag => "9.1.0"
18
+ :tag => "11.0.2"
19
19
  }
20
20
  spec.pod_target_xcconfig = {
21
21
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
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-mac/virtualized-lists'; // [macOS]
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';