react-native 0.73.0-rc.1 → 0.73.0-rc.3

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 (67) hide show
  1. package/Libraries/AppDelegate/RCTAppDelegate.mm +1 -1
  2. package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +6 -2
  3. package/Libraries/Core/ReactNativeVersion.js +1 -1
  4. package/Libraries/LogBox/Data/LogBoxData.js +2 -1
  5. package/Libraries/NativeComponent/NativeComponentRegistry.js +10 -4
  6. package/Libraries/promiseRejectionTrackingOptions.js +21 -7
  7. package/React/Base/RCTBridgeProxy.mm +11 -3
  8. package/React/Base/RCTConstants.h +1 -1
  9. package/React/Base/RCTConstants.m +1 -1
  10. package/React/Base/RCTVersion.m +1 -1
  11. package/React/Base/Surface/RCTSurfaceRootShadowView.h +1 -1
  12. package/React/Base/Surface/RCTSurfaceRootShadowView.m +1 -1
  13. package/React/CoreModules/RCTDeviceInfo.mm +1 -1
  14. package/React/CoreModules/React-CoreModules.podspec +1 -1
  15. package/React/Modules/RCTUIManager.h +7 -0
  16. package/React/Modules/RCTUIManager.m +1 -1
  17. package/React/UIUtils/RCTUIUtils.h +1 -1
  18. package/React/Views/RCTComponentData.m +1 -1
  19. package/React/Views/RCTLayout.h +1 -1
  20. package/React/Views/RCTRootShadowView.h +1 -1
  21. package/React/Views/RCTRootShadowView.m +1 -1
  22. package/React/Views/RCTShadowView.m +1 -1
  23. package/React/Views/ScrollView/RCTScrollView.m +1 -1
  24. package/React/Views/UIView+React.m +30 -23
  25. package/React-Core.podspec +1 -1
  26. package/ReactAndroid/gradle.properties +1 -1
  27. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +0 -1
  28. package/ReactAndroid/src/main/java/com/facebook/react/ReactApplication.kt +0 -1
  29. package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java +0 -1
  30. package/ReactAndroid/src/main/java/com/facebook/react/{interfaces/ReactHost.kt → ReactHost.kt} +2 -3
  31. package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +1 -1
  32. package/ReactAndroid/src/main/java/com/facebook/react/common/annotations/UnstableReactNativeAPI.kt +1 -1
  33. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHost.kt +58 -8
  34. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactNativeHost.kt +16 -0
  35. package/ReactAndroid/src/main/java/com/facebook/react/modules/devloading/DevLoadingModule.java +3 -1
  36. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  37. package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessReactContext.java +8 -0
  38. package/ReactAndroid/src/main/java/com/facebook/react/runtime/CoreReactPackage.java +5 -0
  39. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java +1 -1
  40. package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +5 -0
  41. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/FabricViewStateManager.java +95 -0
  42. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java +2 -2
  43. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java +25 -6
  44. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +33 -23
  45. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  46. package/ReactCommon/hermes/executor/HermesExecutorFactory.cpp +10 -7
  47. package/ReactCommon/react/bridging/Object.h +1 -1
  48. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +8 -0
  49. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +3 -1
  50. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +42 -10
  51. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +17 -17
  52. package/gradle/libs.versions.toml +1 -1
  53. package/package.json +4 -4
  54. package/scripts/cocoapods/utils.rb +4 -23
  55. package/scripts/codegen/generate-legacy-interop-components.js +8 -2
  56. package/sdks/hermes-engine/hermes-engine.podspec +7 -1
  57. package/sdks/hermes-engine/hermes-utils.rb +9 -6
  58. package/sdks/hermes-engine/utils/replace_hermes_version.js +8 -8
  59. package/sdks/hermesc/osx-bin/hermes +0 -0
  60. package/sdks/hermesc/osx-bin/hermesc +0 -0
  61. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  62. package/template/Gemfile +2 -1
  63. package/template/android/app/build.gradle +1 -1
  64. package/template/android/app/src/main/java/com/helloworld/MainApplication.kt +3 -10
  65. package/template/index.js +0 -9
  66. package/template/package.json +1 -1
  67. package/third-party-podspecs/glog.podspec +14 -1
@@ -291,32 +291,13 @@ class ReactNativePodsUtils
291
291
  end
292
292
 
293
293
  def self.updateOSDeploymentTarget(installer)
294
- pod_to_update = Set.new([
295
- "boost",
296
- "CocoaAsyncSocket",
297
- "Flipper",
298
- "Flipper-DoubleConversion",
299
- "Flipper-Fmt",
300
- "Flipper-Boost-iOSX",
301
- "Flipper-Folly",
302
- "Flipper-Glog",
303
- "Flipper-PeerTalk",
304
- "FlipperKit",
305
- "fmt",
306
- "libevent",
307
- "OpenSSL-Universal",
308
- "RCT-Folly",
309
- "SocketRocket",
310
- "YogaKit"
311
- ])
312
-
313
294
  installer.target_installation_results.pod_target_installation_results
314
295
  .each do |pod_name, target_installation_result|
315
- unless pod_to_update.include?(pod_name)
316
- next
317
- end
318
296
  target_installation_result.native_target.build_configurations.each do |config|
319
- config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = Helpers::Constants.min_ios_version_supported
297
+ old_iphone_deploy_target = config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] ?
298
+ config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] :
299
+ Helpers::Constants.min_ios_version_supported
300
+ config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = [Helpers::Constants.min_ios_version_supported.to_f, old_iphone_deploy_target.to_f].max.to_s
320
301
  end
321
302
  end
322
303
  end
@@ -11,6 +11,7 @@
11
11
 
12
12
  const yargs = require('yargs');
13
13
  const fs = require('fs');
14
+ const p = require('path');
14
15
 
15
16
  const CONFIG_FILE_NAME = 'react-native.config.js';
16
17
  const PROJECT_FIELD = 'project';
@@ -93,7 +94,11 @@ function extractComponentsNames(reactNativeConfig) {
93
94
  }
94
95
 
95
96
  function generateRCTLegacyInteropComponents() {
96
- const configFilePath = `${appRoot}/${CONFIG_FILE_NAME}`;
97
+ const cwd = process.cwd();
98
+ const configFilePath = p.join(cwd, appRoot, CONFIG_FILE_NAME);
99
+ console.log(
100
+ `Looking for a react-native.config.js file at ${configFilePath}...`,
101
+ );
97
102
  let reactNativeConfig = null;
98
103
  try {
99
104
  reactNativeConfig = require(configFilePath);
@@ -107,7 +112,7 @@ function generateRCTLegacyInteropComponents() {
107
112
  console.log('Skip LegacyInterop generation');
108
113
  return;
109
114
  }
110
-
115
+ console.log(`Components found: ${componentNames}`);
111
116
  let componentsArray = componentNames.map(name => `\t\t\t@"${name}",`);
112
117
  // Remove the last comma
113
118
  if (componentsArray.length > 0) {
@@ -118,6 +123,7 @@ function generateRCTLegacyInteropComponents() {
118
123
 
119
124
  const filePath = `${outputPath}/${OUTPUT_FILE_NAME}`;
120
125
  fs.writeFileSync(filePath, fileBody(componentsArray.join('\n')));
126
+ console.log(`${filePath} updated!`);
121
127
  }
122
128
 
123
129
  generateRCTLegacyInteropComponents();
@@ -60,7 +60,13 @@ Pod::Spec.new do |spec|
60
60
  :execution_position => :before_compile,
61
61
  :script => <<-EOS
62
62
  . "$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh"
63
- "$NODE_BINARY" "$REACT_NATIVE_PATH/sdks/hermes-engine/utils/replace_hermes_version.js" -c "$CONFIGURATION" -r "#{version}" -p "$REACT_NATIVE_PATH"
63
+
64
+ CONFIG="Release"
65
+ if echo $GCC_PREPROCESSOR_DEFINITIONS | grep -q "DEBUG=1"; then
66
+ CONFIG="Debug"
67
+ fi
68
+
69
+ "$NODE_BINARY" "$REACT_NATIVE_PATH/sdks/hermes-engine/utils/replace_hermes_version.js" -c "$CONFIG" -r "#{version}" -p "$PODS_ROOT"
64
70
  EOS
65
71
  }
66
72
  end
@@ -125,7 +125,7 @@ def podspec_source_build_from_local_source_dir(react_native_path)
125
125
  source_dir_path = ENV['REACT_NATIVE_OVERRIDE_HERMES_DIR']
126
126
  if Dir.exist?(source_dir_path)
127
127
  hermes_log("Using source code from local path: #{source_dir_path}")
128
- tarball_path = File.join(react_native_path, "sdks", "hermes-engine", "hermes-engine-from-local-source-dir.tar.gz")
128
+ tarball_path = File.join(artifacts_dir(), "hermes-engine-from-local-source-dir.tar.gz")
129
129
  exclude_paths = [
130
130
  "__tests__",
131
131
  "./external/flowtest",
@@ -192,6 +192,10 @@ end
192
192
 
193
193
  # HELPERS
194
194
 
195
+ def artifacts_dir()
196
+ return File.join(Pod::Config.instance.project_pods_root, "hermes-engine-artifacts")
197
+ end
198
+
195
199
  def hermestag_file(react_native_path)
196
200
  return File.join(react_native_path, "sdks", ".hermesversion")
197
201
  end
@@ -208,15 +212,14 @@ def download_stable_hermes(react_native_path, version, configuration)
208
212
  end
209
213
 
210
214
  def download_hermes_tarball(react_native_path, tarball_url, version, configuration)
211
- destination_folder = "#{react_native_path}/sdks/downloads"
212
215
  destination_path = configuration == nil ?
213
- "#{destination_folder}/hermes-ios-#{version}.tar.gz" :
214
- "#{destination_folder}/hermes-ios-#{version}-#{configuration}.tar.gz"
216
+ "#{artifacts_dir()}/hermes-ios-#{version}.tar.gz" :
217
+ "#{artifacts_dir()}/hermes-ios-#{version}-#{configuration}.tar.gz"
215
218
 
216
219
  unless File.exist?(destination_path)
217
220
  # Download to a temporary file first so we don't cache incomplete downloads.
218
- tmp_file = "#{destination_folder}/hermes-ios.download"
219
- `mkdir -p "#{destination_folder}" && curl "#{tarball_url}" -Lo "#{tmp_file}" && mv "#{tmp_file}" "#{destination_path}"`
221
+ tmp_file = "#{artifacts_dir()}/hermes-ios.download"
222
+ `mkdir -p "#{artifacts_dir()}" && curl "#{tarball_url}" -Lo "#{tmp_file}" && mv "#{tmp_file}" "#{destination_path}"`
220
223
  end
221
224
  return destination_path
222
225
  end
@@ -52,8 +52,8 @@ function shouldReplaceHermesConfiguration(configuration) {
52
52
  return true;
53
53
  }
54
54
 
55
- function replaceHermesConfiguration(configuration, version, reactNativePath) {
56
- const tarballURLPath = `${reactNativePath}/sdks/downloads/hermes-ios-${version}-${configuration}.tar.gz`;
55
+ function replaceHermesConfiguration(configuration, version, podsRoot) {
56
+ const tarballURLPath = `${podsRoot}/hermes-engine-artifacts/hermes-ios-${version}-${configuration}.tar.gz`;
57
57
 
58
58
  const finalLocation = 'hermes-engine';
59
59
  console.log('Preparing the final location');
@@ -68,7 +68,7 @@ function updateLastBuildConfiguration(configuration) {
68
68
  fs.writeFileSync(LAST_BUILD_FILENAME, configuration);
69
69
  }
70
70
 
71
- function main(configuration, version, reactNativePath) {
71
+ function main(configuration, version, podsRoot) {
72
72
  validateBuildConfiguration(configuration);
73
73
  validateVersion(version);
74
74
 
@@ -76,7 +76,7 @@ function main(configuration, version, reactNativePath) {
76
76
  return;
77
77
  }
78
78
 
79
- replaceHermesConfiguration(configuration, version, reactNativePath);
79
+ replaceHermesConfiguration(configuration, version, podsRoot);
80
80
  updateLastBuildConfiguration(configuration);
81
81
  console.log('Done replacing hermes-engine');
82
82
  }
@@ -94,13 +94,13 @@ const argv = yargs
94
94
  'The Version of React Native associated with the Hermes tarball.',
95
95
  })
96
96
  .option('p', {
97
- alias: 'reactNativePath',
98
- description: 'The path to the React Native root folder',
97
+ alias: 'podsRoot',
98
+ description: 'The path to the Pods root folder',
99
99
  })
100
100
  .usage('Usage: $0 -c Debug -r <version> -p <path/to/react-native>').argv;
101
101
 
102
102
  const configuration = argv.configuration;
103
103
  const version = argv.reactNativeVersion;
104
- const reactNativePath = argv.reactNativePath;
104
+ const podsRoot = argv.podsRoot;
105
105
 
106
- main(configuration, version, reactNativePath);
106
+ main(configuration, version, podsRoot);
Binary file
Binary file
Binary file
package/template/Gemfile CHANGED
@@ -3,4 +3,5 @@ source 'https://rubygems.org'
3
3
  # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4
4
  ruby ">= 2.6.10"
5
5
 
6
- gem 'cocoapods', '~> 1.12'
6
+ gem 'cocoapods', '~> 1.13'
7
+ gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
@@ -71,7 +71,7 @@ def jscFlavor = 'org.webkit:android-jsc:+'
71
71
 
72
72
  android {
73
73
  ndkVersion rootProject.ext.ndkVersion
74
-
74
+ buildToolsVersion rootProject.ext.buildToolsVersion
75
75
  compileSdk rootProject.ext.compileSdkVersion
76
76
 
77
77
  namespace "com.helloworld"
@@ -3,17 +3,15 @@ package com.helloworld
3
3
  import android.app.Application
4
4
  import com.facebook.react.PackageList
5
5
  import com.facebook.react.ReactApplication
6
+ import com.facebook.react.ReactHost
6
7
  import com.facebook.react.ReactNativeHost
7
8
  import com.facebook.react.ReactPackage
8
- import com.facebook.react.common.annotations.UnstableReactNativeAPI
9
9
  import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
10
- import com.facebook.react.defaults.DefaultReactHost
10
+ import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
11
11
  import com.facebook.react.defaults.DefaultReactNativeHost
12
12
  import com.facebook.react.flipper.ReactNativeFlipper
13
- import com.facebook.react.interfaces.ReactHost
14
13
  import com.facebook.soloader.SoLoader
15
14
 
16
- @UnstableReactNativeAPI
17
15
  class MainApplication : Application(), ReactApplication {
18
16
 
19
17
  override val reactNativeHost: ReactNativeHost =
@@ -33,12 +31,7 @@ class MainApplication : Application(), ReactApplication {
33
31
  }
34
32
 
35
33
  override val reactHost: ReactHost
36
- get() =
37
- DefaultReactHost.getDefaultReactHost(
38
- context = this,
39
- packageList = PackageList(this).packages,
40
- jsMainModulePath = "index",
41
- isHermesEnabled = BuildConfig.IS_HERMES_ENABLED)
34
+ get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
42
35
 
43
36
  override fun onCreate() {
44
37
  super.onCreate()
package/template/index.js CHANGED
@@ -6,13 +6,4 @@ import {AppRegistry} from 'react-native';
6
6
  import App from './App';
7
7
  import {name as appName} from './app.json';
8
8
 
9
- if (global.RN$Bridgeless) {
10
- require('react-native/Libraries/NativeComponent/NativeComponentRegistry').setRuntimeConfigProvider(
11
- name => {
12
- // In bridgeless mode, never load native ViewConfig.
13
- return {native: false, strict: false, verify: false};
14
- },
15
- );
16
- }
17
-
18
9
  AppRegistry.registerComponent(appName, () => App);
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "18.2.0",
14
- "react-native": "0.73.0-rc.1"
14
+ "react-native": "0.73.0-rc.3"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.20.0",
@@ -29,10 +29,23 @@ Pod::Spec.new do |spec|
29
29
  'src/base/*.h'
30
30
  spec.exclude_files = "src/windows/**/*"
31
31
  spec.compiler_flags = '-Wno-shorten-64-to-32'
32
+
33
+ # TODO: T167482718 Remove this code after April 2024, when Apple will
34
+ # push the lower version of Xcode required to upload apps to the Store.
35
+ xcode_path = `xcodebuild -version` # This return the current version of Xcode
36
+
37
+ match = xcode_path.match(/Xcode (\d+)\.(\d+)/)
38
+ major_version = match[1].to_i
39
+ minor_version = match[2].to_i
40
+ is_greater_than_15 = major_version >= 15
41
+ is_greater_than_14_3 = major_version == 14 && minor_version >= 3
42
+ should_define_modules = is_greater_than_15 ? "YES" : is_greater_than_14_3 ? "YES" : "NO"
43
+ # End TODO.
44
+
32
45
  spec.pod_target_xcconfig = {
33
46
  "USE_HEADERMAP" => "NO",
34
47
  "HEADER_SEARCH_PATHS" => "$(PODS_TARGET_SRCROOT)/src",
35
- "DEFINES_MODULE" => "YES"
48
+ "DEFINES_MODULE" => should_define_modules # When the workaround is removed, set this var to "YES"
36
49
  }
37
50
 
38
51
  # Pinning to the same version as React.podspec.