diff --git a/.gitignore b/.gitignore index 3f859431ebc679..b830fc9423b532 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/Gemfile b/Gemfile index 34784a7cd94f43..1f657254243488 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/Gemfile.lock b/Gemfile.lock index 1e4588d70504e5..7df1764a245cd0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) @@ -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 diff --git a/packages/react-native/Libraries/vendor/emitter/EventEmitter.js b/packages/react-native/Libraries/vendor/emitter/EventEmitter.js index 6bd20257222d73..a98ce92939b3c1 100644 --- a/packages/react-native/Libraries/vendor/emitter/EventEmitter.js +++ b/packages/react-native/Libraries/vendor/emitter/EventEmitter.js @@ -109,7 +109,9 @@ export default class EventEmitter Registration<$ElementType>, > = 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); } } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java index 5fa72a0ffd02b0..41e4a62c2fc1ce 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java @@ -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; @@ -72,6 +73,7 @@ AppearanceModule.class, AppStateModule.class, BlobModule.class, + DevLoadingModule.class, FileReaderModule.class, ClipboardModule.class, DialogModule.class, @@ -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: @@ -371,6 +375,7 @@ public ReactModuleInfoProvider getReactModuleInfoProvider() { AppearanceModule.class, AppStateModule.class, BlobModule.class, + DevLoadingModule.class, FileReaderModule.class, ClipboardModule.class, DialogModule.class, diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 878177b8cfcacd..3b33a28db06bb7 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -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", diff --git a/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb b/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb index 845e60836e3b95..47d6c632dbabb9 100644 --- a/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb +++ b/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb @@ -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 @@ -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 diff --git a/packages/react-native/scripts/cocoapods/utils.rb b/packages/react-native/scripts/cocoapods/utils.rb index d34b17e01e017b..d4bf3a09478b70 100644 --- a/packages/react-native/scripts/cocoapods/utils.rb +++ b/packages/react-native/scripts/cocoapods/utils.rb @@ -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() @@ -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 diff --git a/packages/react-native/template/Gemfile b/packages/react-native/template/Gemfile index 1fa2c2e1abdee6..6a7d5c7a49c357 100644 --- a/packages/react-native/template/Gemfile +++ b/packages/react-native/template/Gemfile @@ -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' diff --git a/packages/rn-tester/Gemfile b/packages/rn-tester/Gemfile index a66fd6c04cbc12..4de6c10e5d6df3 100644 --- a/packages/rn-tester/Gemfile +++ b/packages/rn-tester/Gemfile @@ -3,3 +3,4 @@ source 'https://rubygems.org' gem 'cocoapods', '~> 1.12' gem 'rexml' +gem 'activesupport', '>= 6.1.7.3', '< 7.1.0' diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index ee5f16842fcdaf..81ae3a3a65b5fe 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -614,4 +614,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 23258155130fc3ae417bc5bb12e76438f3b9a394 -COCOAPODS: 1.13.0 +COCOAPODS: 1.12.0 diff --git a/scripts/testing-utils.js b/scripts/testing-utils.js index be4bc78b9c7f61..b48d1a85d25d29 100644 --- a/scripts/testing-utils.js +++ b/scripts/testing-utils.js @@ -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 /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 /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 /utils/. cp( `${reactNativePackagePath}/sdks/hermes-engine/utils/*.sh`, diff --git a/yarn.lock b/yarn.lock index 5b845ea6b794f7..676e80e854802b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4458,14 +4458,14 @@ depd@2.0.0, 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" @@ -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== @@ -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==