Skip to content

Commit d56fb34

Browse files
SaadnajmicipolleschiyungstersDistillerhuntie
authored
[0.72] Merge up to 0.72.6 upstream (#1952)
* Move hermes-engine.podspec and hermes-utils.rb from hermes-engine to hermes folders when building (facebook#39575) * Update Xcode 15 patches to be more robust (facebook#39710) Summary: Pull Request resolved: facebook#39710 Last week Apple released Xcode 15, which required us to ship a workaround for the new linker. Unfortunately, the previous fix was not good enough and there were some edge cases that were not covered. For example, in some occasions the flags are read as an array and the `-Wl` and the `-ld_classic` flags were separated and not properly removed when moving from Xcode 15 to Xcpde 14.3.1. This change fixes those edge cases, with a more robust solution where: - We convert the flags to a string. - We trim the string and the values properly. - We add the flags when running `pod install` with Xcode 15 as the default iOS toolchain. - We remove the flags when running `pod install` with Xcode <15 as the default iOS toolchain. ## Changelog: [Internal] - Make the Xcode 15 workaround more robust. Reviewed By: dmytrorykun Differential Revision: D49748844 fbshipit-source-id: 34976d148f123c5aacba6487a500874bb938fe99 # Conflicts: # packages/react-native/scripts/cocoapods/__tests__/utils-test.rb # packages/react-native/scripts/cocoapods/utils.rb * Fix Gemfile, setting Active support to < 7.1.0 (facebook#39828) Summary: Pull Request resolved: facebook#39828 Active Suppert released a new Gem which is incompatible with Cocoapods 1.13.0, the latest release, as they removed a method used by cocoapods. This fix ensures that we install compatible versions of the Gem. ## Changelog: [iOS][Fixed] - Set the max version of Active support to 7.0.8 Reviewed By: hoxyq Differential Revision: D49949782 fbshipit-source-id: 278097502d3a416567cc8c0b90090fee4fb21503 # Conflicts: # Gemfile * RN: Switch EventEmitter to `Array.from(...)` (facebook#39525) Summary: Pull Request resolved: facebook#39525 Switches `EventEmitter#emit` to use `Array.from` instead of the spread operator. This should be functionally identical (with marginally less overhead of the runtime having to determine the type of `registrations`), but there seems to be [some unexpected Babel configurations in the community](facebook#35577 (comment)) that causes this line of code to do the wrong things. Although we should independently root cause the Babel plugin configuration problems, this change might provide immediate relief and is also not any worse (e.g. in terms of code readability). This also adds a descriptive comment explaining the intention of the call to `Array.from`. Changelog: [Fixed][General] - Fix a potential bug in `EventEmitter` when used with certain Babel configurations that incorrectly polyfill the spread operator for iterables. Reviewed By: javache Differential Revision: D49389813 fbshipit-source-id: 7caf63734fc047496afe2f1ed6d918c22747258a * [Local] Fix CI for 0.72, with Acitve Support and Xcode15 (facebook#40855) * [0.72.6] Bump version numbers * Bump deprecated-react-native-prop-types to ^4.2.3 This version correctly sets a dependency on `"@react-native/normalize-colors": "<0.73.0"` (from `"*"`), preventing future unwanted breakages. * Fix broken Loading/Refreshing indicator on Android Summary: The Loading.../Refreshing... indicator is currently broken on Android. The reason is related to D42599220 We used to have a Toast shown to users on Android as a fallback, but as the DevLoadingView is not always loaded as a module in the core package, this ends up in the banner never beign shown to the user (on RN Tester or template apps). Changelog: [Android] [Fixed] - Fix broken Loading/Refreshing indicator on Android Reviewed By: cipolleschi Differential Revision: D49876757 fbshipit-source-id: 400e002327ebca908e3e7a7f81c5066888ac4e9b --------- Co-authored-by: Riccardo Cipolleschi <[email protected]> Co-authored-by: Tim Yung <[email protected]> Co-authored-by: Distiller <[email protected]> Co-authored-by: Alex Hunt <[email protected]> Co-authored-by: Nicola Corti <[email protected]>
1 parent c7e2986 commit d56fb34

File tree

13 files changed

+59
-30
lines changed

13 files changed

+59
-30
lines changed

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ package-lock.json
107107
/packages/react-native/template/vendor
108108
.ruby-version
109109
/**/.ruby-version
110+
./vendor/
111+
vendor/
110112

111113
# iOS / CocoaPods
112114
/packages/react-native/template/ios/build/

Diff for: Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ source 'https://rubygems.org'
44
ruby ">= 2.6.10"
55

66
gem 'cocoapods', '~> 1.12'
7-
gem 'activesupport', '>= 6.1.7.1'
7+
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'

Diff for: Gemfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ GEM
5757
escape (0.0.4)
5858
ethon (0.16.0)
5959
ffi (>= 1.15.0)
60-
ffi (1.16.2)
60+
ffi (1.16.3)
6161
fourflusher (2.3.1)
6262
fuzzy_match (2.0.4)
6363
gh_inspector (1.1.3)
@@ -89,7 +89,7 @@ PLATFORMS
8989
ruby
9090

9191
DEPENDENCIES
92-
activesupport (>= 6.1.7.1)
92+
activesupport (>= 6.1.7.3, < 7.1.0)
9393
cocoapods (~> 1.12)
9494

9595
RUBY VERSION

Diff for: packages/react-native/Libraries/vendor/emitter/EventEmitter.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ export default class EventEmitter<TEventToArgsMap: {...}>
109109
Registration<$ElementType<TEventToArgsMap, TEvent>>,
110110
> = this._registry[eventType];
111111
if (registrations != null) {
112-
for (const registration of [...registrations]) {
112+
// Copy `registrations` to take a snapshot when we invoke `emit`, in case
113+
// registrations are added or removed when listeners are invoked.
114+
for (const registration of Array.from(registrations)) {
113115
registration.listener.apply(registration.context, args);
114116
}
115117
}

Diff for: packages/react-native/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import com.facebook.react.modules.blob.FileReaderModule;
2626
import com.facebook.react.modules.camera.ImageStoreManager;
2727
import com.facebook.react.modules.clipboard.ClipboardModule;
28+
import com.facebook.react.modules.devloading.DevLoadingModule;
2829
import com.facebook.react.modules.devtoolssettings.DevToolsSettingsManagerModule;
2930
import com.facebook.react.modules.dialog.DialogModule;
3031
import com.facebook.react.modules.fresco.FrescoModule;
@@ -72,6 +73,7 @@
7273
AppearanceModule.class,
7374
AppStateModule.class,
7475
BlobModule.class,
76+
DevLoadingModule.class,
7577
FileReaderModule.class,
7678
ClipboardModule.class,
7779
DialogModule.class,
@@ -113,6 +115,8 @@ public MainReactPackage(MainPackageConfig config) {
113115
return new AppStateModule(context);
114116
case BlobModule.NAME:
115117
return new BlobModule(context);
118+
case DevLoadingModule.NAME:
119+
return new DevLoadingModule(context);
116120
case FileReaderModule.NAME:
117121
return new FileReaderModule(context);
118122
case ClipboardModule.NAME:
@@ -371,6 +375,7 @@ public ReactModuleInfoProvider getReactModuleInfoProvider() {
371375
AppearanceModule.class,
372376
AppStateModule.class,
373377
BlobModule.class,
378+
DevLoadingModule.class,
374379
FileReaderModule.class,
375380
ClipboardModule.class,
376381
DialogModule.class,

Diff for: packages/react-native/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"abort-controller": "^3.0.0",
9393
"anser": "^1.4.9",
9494
"base64-js": "^1.1.2",
95-
"deprecated-react-native-prop-types": "4.1.0",
95+
"deprecated-react-native-prop-types": "^4.2.3",
9696
"event-target-shim": "^5.0.1",
9797
"flow-enums-runtime": "^0.0.5",
9898
"invariant": "^2.2.4",

Diff for: packages/react-native/scripts/cocoapods/__tests__/utils-test.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ def test_applyXcode15Patch_whenXcodebuild15_correctlyAppliesNecessaryPatch
526526
# Assert
527527
user_project_mock.build_configurations.each do |config|
528528
assert_equal("$(inherited) _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION", config.build_settings["GCC_PREPROCESSOR_DEFINITIONS"])
529-
assert_equal("$(inherited) -Wl -ld_classic ", config.build_settings["OTHER_LDFLAGS"])
529+
assert_equal("$(inherited) -Wl -ld_classic", config.build_settings["OTHER_LDFLAGS"])
530530
end
531531

532532
# User project and Pods project
@@ -576,7 +576,7 @@ def test_applyXcode15Patch_whenXcodebuild14ButProjectHasSettings_correctlyRemove
576576
# Assert
577577
user_project_mock.build_configurations.each do |config|
578578
assert_equal("$(inherited) _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION", config.build_settings["GCC_PREPROCESSOR_DEFINITIONS"])
579-
assert_equal("$(inherited) ", config.build_settings["OTHER_LDFLAGS"])
579+
assert_equal("$(inherited)", config.build_settings["OTHER_LDFLAGS"])
580580
end
581581

582582
# User project and Pods project

Diff for: packages/react-native/scripts/cocoapods/utils.rb

+17-11
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def self.apply_xcode_15_patch(installer, xcodebuild_manager: Xcodebuild)
140140
if self.is_using_xcode15_or_greter(:xcodebuild_manager => xcodebuild_manager)
141141
self.add_value_to_setting_if_missing(config, other_ld_flags_key, xcode15_compatibility_flags)
142142
else
143-
self.remove_value_to_setting_if_present(config, other_ld_flags_key, xcode15_compatibility_flags)
143+
self.remove_value_from_setting_if_present(config, other_ld_flags_key, xcode15_compatibility_flags)
144144
end
145145
end
146146
project.save()
@@ -298,20 +298,26 @@ def self.safe_init(config, setting_name)
298298

299299
def self.add_value_to_setting_if_missing(config, setting_name, value)
300300
old_config = config.build_settings[setting_name]
301-
if !old_config.include?(value)
302-
config.build_settings[setting_name] << value
301+
if old_config.is_a?(Array)
302+
old_config = old_config.join(" ")
303+
end
304+
305+
trimmed_value = value.strip()
306+
if !old_config.include?(trimmed_value)
307+
config.build_settings[setting_name] = "#{old_config.strip()} #{trimmed_value}".strip()
303308
end
304309
end
305310

306-
def self.remove_value_to_setting_if_present(config, setting_name, value)
311+
def self.remove_value_from_setting_if_present(config, setting_name, value)
307312
old_config = config.build_settings[setting_name]
308-
if old_config.include?(value)
309-
# Old config can be either an Array or a String
310-
if old_config.is_a?(Array)
311-
old_config = old_config.join(" ")
312-
end
313-
new_config = old_config.gsub(value, "")
314-
config.build_settings[setting_name] = new_config
313+
if old_config.is_a?(Array)
314+
old_config = old_config.join(" ")
315+
end
316+
317+
trimmed_value = value.strip()
318+
if old_config.include?(trimmed_value)
319+
new_config = old_config.gsub(trimmed_value, "")
320+
config.build_settings[setting_name] = new_config.strip()
315321
end
316322
end
317323

Diff for: packages/react-native/template/Gemfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ source 'https://rubygems.org'
33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
44
ruby ">= 2.6.10"
55

6-
gem 'cocoapods', '~> 1.12'
6+
gem 'cocoapods', '~> 1.13'
7+
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'

Diff for: packages/rn-tester/Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ source 'https://rubygems.org'
33

44
gem 'cocoapods', '~> 1.12'
55
gem 'rexml'
6+
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'

Diff for: packages/rn-tester/Podfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -614,4 +614,4 @@ SPEC CHECKSUMS:
614614

615615
PODFILE CHECKSUM: 23258155130fc3ae417bc5bb12e76438f3b9a394
616616

617-
COCOAPODS: 1.13.0
617+
COCOAPODS: 1.12.0

Diff for: scripts/testing-utils.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,19 @@ function buildArtifactsLocally(
214214
expandHermesSourceTarball();
215215
}
216216

217-
// need to move the scripts inside the local hermes cloned folder
217+
// need to move the podspec file from hermes-engine to hermes folder
218+
// cp sdks/hermes-engine/hermes-engine.podspec <your_hermes_checkout>/hermes-engine.podspec
219+
cp(
220+
`${reactNativePackagePath}/sdks/hermes-engine/hermes-engine.podspec`,
221+
`${reactNativePackagePath}/sdks/hermes/hermes-engine.podspec`,
222+
);
223+
// need to move the hermes-utils file from hermes-engine to hermes folder
224+
// cp sdks/hermes-engine/hermes-utils.rb <your_hermes_checkout>/hermes-utils.rb
225+
cp(
226+
`${reactNativePackagePath}/sdks/hermes-engine/hermes-utils.rb`,
227+
`${reactNativePackagePath}/sdks/hermes/hermes-utils.rb`,
228+
);
229+
// need to move the shell scripts file from hermes-engine to hermes folder
218230
// cp sdks/hermes-engine/utils/*.sh <your_hermes_checkout>/utils/.
219231
cp(
220232
`${reactNativePackagePath}/sdks/hermes-engine/utils/*.sh`,

Diff for: yarn.lock

+9-9
Original file line numberDiff line numberDiff line change
@@ -4458,14 +4458,14 @@ [email protected], depd@^2.0.0:
44584458
resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df"
44594459
integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==
44604460

4461-
deprecated-react-native-prop-types@4.1.0:
4462-
version "4.1.0"
4463-
resolved "https://registry.yarnpkg.com/deprecated-react-native-prop-types/-/deprecated-react-native-prop-types-4.1.0.tgz#8ed03a64c21b7fbdd2d000957b6838d4f38d2c66"
4464-
integrity sha512-WfepZHmRbbdTvhcolb8aOKEvQdcmTMn5tKLbqbXmkBvjFjRVWAYqsXk/DBsV8TZxws8SdGHLuHaJrHSQUPRdfw==
4461+
deprecated-react-native-prop-types@^4.2.3:
4462+
version "4.2.3"
4463+
resolved "https://registry.yarnpkg.com/deprecated-react-native-prop-types/-/deprecated-react-native-prop-types-4.2.3.tgz#0ef845c1a80ef1636bd09060e4cdf70f9727e5ad"
4464+
integrity sha512-2rLTiMKidIFFYpIVM69UnQKngLqQfL6I11Ch8wGSBftS18FUXda+o2we2950X+1dmbgps28niI3qwyH4eX3Z1g==
44654465
dependencies:
4466-
"@react-native/normalize-colors" "*"
4467-
invariant "*"
4468-
prop-types "*"
4466+
"@react-native/normalize-colors" "<0.73.0"
4467+
invariant "^2.2.4"
4468+
prop-types "^15.8.1"
44694469

44704470
deprecation@^2.0.0, deprecation@^2.3.1:
44714471
version "2.3.1"
@@ -5987,7 +5987,7 @@ interpret@^1.0.0:
59875987
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e"
59885988
integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==
59895989

5990-
invariant@*, invariant@^2.2.4:
5990+
invariant@^2.2.4:
59915991
version "2.2.4"
59925992
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
59935993
integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
@@ -8503,7 +8503,7 @@ prompts@^2.0.1, prompts@^2.3.0, prompts@^2.4.0, prompts@^2.4.2:
85038503
kleur "^3.0.3"
85048504
sisteransi "^1.0.5"
85058505

8506-
prop-types@*, prop-types@^15.8.1:
8506+
prop-types@^15.8.1:
85078507
version "15.8.1"
85088508
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
85098509
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==

0 commit comments

Comments
 (0)