Skip to content

[0.72] Merge up to 0.72.6 upstream #1952

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

Merged
merged 9 commits into from
Oct 16, 2023
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ package-lock.json
/packages/react-native/template/vendor
.ruby-version
/**/.ruby-version
./vendor/
vendor/

# iOS / CocoaPods
/packages/react-native/template/ios/build/
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ source 'https://rubygems.org'
ruby ">= 2.6.10"

gem 'cocoapods', '~> 1.12'
gem 'activesupport', '>= 6.1.7.1'
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ GEM
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.16.2)
ffi (1.16.3)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
Expand Down Expand Up @@ -89,7 +89,7 @@ PLATFORMS
ruby

DEPENDENCIES
activesupport (>= 6.1.7.1)
activesupport (>= 6.1.7.3, < 7.1.0)
cocoapods (~> 1.12)

RUBY VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ export default class EventEmitter<TEventToArgsMap: {...}>
Registration<$ElementType<TEventToArgsMap, TEvent>>,
> = this._registry[eventType];
if (registrations != null) {
for (const registration of [...registrations]) {
// Copy `registrations` to take a snapshot when we invoke `emit`, in case
// registrations are added or removed when listeners are invoked.
for (const registration of Array.from(registrations)) {
registration.listener.apply(registration.context, args);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.facebook.react.modules.blob.FileReaderModule;
import com.facebook.react.modules.camera.ImageStoreManager;
import com.facebook.react.modules.clipboard.ClipboardModule;
import com.facebook.react.modules.devloading.DevLoadingModule;
import com.facebook.react.modules.devtoolssettings.DevToolsSettingsManagerModule;
import com.facebook.react.modules.dialog.DialogModule;
import com.facebook.react.modules.fresco.FrescoModule;
Expand Down Expand Up @@ -72,6 +73,7 @@
AppearanceModule.class,
AppStateModule.class,
BlobModule.class,
DevLoadingModule.class,
FileReaderModule.class,
ClipboardModule.class,
DialogModule.class,
Expand Down Expand Up @@ -113,6 +115,8 @@ public MainReactPackage(MainPackageConfig config) {
return new AppStateModule(context);
case BlobModule.NAME:
return new BlobModule(context);
case DevLoadingModule.NAME:
return new DevLoadingModule(context);
case FileReaderModule.NAME:
return new FileReaderModule(context);
case ClipboardModule.NAME:
Expand Down Expand Up @@ -371,6 +375,7 @@ public ReactModuleInfoProvider getReactModuleInfoProvider() {
AppearanceModule.class,
AppStateModule.class,
BlobModule.class,
DevLoadingModule.class,
FileReaderModule.class,
ClipboardModule.class,
DialogModule.class,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"abort-controller": "^3.0.0",
"anser": "^1.4.9",
"base64-js": "^1.1.2",
"deprecated-react-native-prop-types": "4.1.0",
"deprecated-react-native-prop-types": "^4.2.3",
"event-target-shim": "^5.0.1",
"flow-enums-runtime": "^0.0.5",
"invariant": "^2.2.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ def test_applyXcode15Patch_whenXcodebuild15_correctlyAppliesNecessaryPatch
# Assert
user_project_mock.build_configurations.each do |config|
assert_equal("$(inherited) _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION", config.build_settings["GCC_PREPROCESSOR_DEFINITIONS"])
assert_equal("$(inherited) -Wl -ld_classic ", config.build_settings["OTHER_LDFLAGS"])
assert_equal("$(inherited) -Wl -ld_classic", config.build_settings["OTHER_LDFLAGS"])
end

# User project and Pods project
Expand Down Expand Up @@ -576,7 +576,7 @@ def test_applyXcode15Patch_whenXcodebuild14ButProjectHasSettings_correctlyRemove
# Assert
user_project_mock.build_configurations.each do |config|
assert_equal("$(inherited) _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION", config.build_settings["GCC_PREPROCESSOR_DEFINITIONS"])
assert_equal("$(inherited) ", config.build_settings["OTHER_LDFLAGS"])
assert_equal("$(inherited)", config.build_settings["OTHER_LDFLAGS"])
end

# User project and Pods project
Expand Down
28 changes: 17 additions & 11 deletions packages/react-native/scripts/cocoapods/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def self.apply_xcode_15_patch(installer, xcodebuild_manager: Xcodebuild)
if self.is_using_xcode15_or_greter(:xcodebuild_manager => xcodebuild_manager)
self.add_value_to_setting_if_missing(config, other_ld_flags_key, xcode15_compatibility_flags)
else
self.remove_value_to_setting_if_present(config, other_ld_flags_key, xcode15_compatibility_flags)
self.remove_value_from_setting_if_present(config, other_ld_flags_key, xcode15_compatibility_flags)
end
end
project.save()
Expand Down Expand Up @@ -298,20 +298,26 @@ def self.safe_init(config, setting_name)

def self.add_value_to_setting_if_missing(config, setting_name, value)
old_config = config.build_settings[setting_name]
if !old_config.include?(value)
config.build_settings[setting_name] << value
if old_config.is_a?(Array)
old_config = old_config.join(" ")
end

trimmed_value = value.strip()
if !old_config.include?(trimmed_value)
config.build_settings[setting_name] = "#{old_config.strip()} #{trimmed_value}".strip()
end
end

def self.remove_value_to_setting_if_present(config, setting_name, value)
def self.remove_value_from_setting_if_present(config, setting_name, value)
old_config = config.build_settings[setting_name]
if old_config.include?(value)
# Old config can be either an Array or a String
if old_config.is_a?(Array)
old_config = old_config.join(" ")
end
new_config = old_config.gsub(value, "")
config.build_settings[setting_name] = new_config
if old_config.is_a?(Array)
old_config = old_config.join(" ")
end

trimmed_value = value.strip()
if old_config.include?(trimmed_value)
new_config = old_config.gsub(trimmed_value, "")
config.build_settings[setting_name] = new_config.strip()
end
end

Expand Down
3 changes: 2 additions & 1 deletion packages/react-native/template/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"

gem 'cocoapods', '~> 1.12'
gem 'cocoapods', '~> 1.13'
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
1 change: 1 addition & 0 deletions packages/rn-tester/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ source 'https://rubygems.org'

gem 'cocoapods', '~> 1.12'
gem 'rexml'
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
2 changes: 1 addition & 1 deletion packages/rn-tester/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -614,4 +614,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 23258155130fc3ae417bc5bb12e76438f3b9a394

COCOAPODS: 1.13.0
COCOAPODS: 1.12.0
14 changes: 13 additions & 1 deletion scripts/testing-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,19 @@ function buildArtifactsLocally(
expandHermesSourceTarball();
}

// need to move the scripts inside the local hermes cloned folder
// need to move the podspec file from hermes-engine to hermes folder
// cp sdks/hermes-engine/hermes-engine.podspec <your_hermes_checkout>/hermes-engine.podspec
cp(
`${reactNativePackagePath}/sdks/hermes-engine/hermes-engine.podspec`,
`${reactNativePackagePath}/sdks/hermes/hermes-engine.podspec`,
);
// need to move the hermes-utils file from hermes-engine to hermes folder
// cp sdks/hermes-engine/hermes-utils.rb <your_hermes_checkout>/hermes-utils.rb
cp(
`${reactNativePackagePath}/sdks/hermes-engine/hermes-utils.rb`,
`${reactNativePackagePath}/sdks/hermes/hermes-utils.rb`,
);
// need to move the shell scripts file from hermes-engine to hermes folder
// cp sdks/hermes-engine/utils/*.sh <your_hermes_checkout>/utils/.
cp(
`${reactNativePackagePath}/sdks/hermes-engine/utils/*.sh`,
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4458,14 +4458,14 @@ [email protected], depd@^2.0.0:
resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df"
integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==

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

deprecation@^2.0.0, deprecation@^2.3.1:
version "2.3.1"
Expand Down Expand Up @@ -5987,7 +5987,7 @@ interpret@^1.0.0:
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e"
integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==

invariant@*, invariant@^2.2.4:
invariant@^2.2.4:
version "2.2.4"
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
Expand Down Expand Up @@ -8503,7 +8503,7 @@ prompts@^2.0.1, prompts@^2.3.0, prompts@^2.4.0, prompts@^2.4.2:
kleur "^3.0.3"
sisteransi "^1.0.5"

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