react-native 0.73.0-rc.2 → 0.73.0-rc.4

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 (72) hide show
  1. package/Libraries/Animated/nodes/AnimatedStyle.js +1 -1
  2. package/Libraries/AppDelegate/RCTAppDelegate.mm +1 -1
  3. package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +6 -2
  4. package/Libraries/Core/ReactNativeVersion.js +1 -1
  5. package/Libraries/LogBox/Data/LogBoxData.js +2 -1
  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/Views/RCTComponentData.m +1 -1
  18. package/React/Views/RCTLayout.h +1 -1
  19. package/React/Views/RCTRootShadowView.h +1 -1
  20. package/React/Views/RCTRootShadowView.m +1 -1
  21. package/React/Views/RCTShadowView.m +1 -1
  22. package/React/Views/ScrollView/RCTScrollView.m +1 -1
  23. package/React-Core.podspec +1 -1
  24. package/ReactAndroid/gradle.properties +1 -1
  25. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +0 -1
  26. package/ReactAndroid/src/main/java/com/facebook/react/ReactApplication.kt +0 -1
  27. package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java +0 -1
  28. package/ReactAndroid/src/main/java/com/facebook/react/{interfaces/ReactHost.kt → ReactHost.kt} +2 -3
  29. package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +1 -1
  30. package/ReactAndroid/src/main/java/com/facebook/react/common/annotations/UnstableReactNativeAPI.kt +1 -1
  31. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHost.kt +58 -8
  32. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactNativeHost.kt +16 -0
  33. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/BridgeDevSupportManager.java +0 -11
  34. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +5 -1
  35. package/ReactAndroid/src/main/java/com/facebook/react/modules/devloading/DevLoadingModule.java +6 -10
  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/JSTimerExecutor.java +4 -1
  40. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java +6 -1
  41. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.java +41 -4
  42. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/FabricViewStateManager.java +95 -0
  43. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java +2 -2
  44. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java +25 -6
  45. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +33 -23
  46. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +4 -1
  47. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  48. package/ReactCommon/hermes/executor/HermesExecutorFactory.cpp +10 -7
  49. package/ReactCommon/react/bridging/Object.h +1 -1
  50. package/ReactCommon/react/renderer/attributedstring/conversions.h +6 -0
  51. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +31 -3
  52. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +3 -1
  53. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +46 -10
  54. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +17 -17
  55. package/gradle/libs.versions.toml +1 -1
  56. package/package.json +10 -10
  57. package/scripts/cocoapods/utils.rb +4 -23
  58. package/scripts/codegen/generate-legacy-interop-components.js +8 -2
  59. package/scripts/react_native_pods.rb +1 -1
  60. package/sdks/hermes-engine/hermes-engine.podspec +7 -1
  61. package/sdks/hermes-engine/hermes-utils.rb +9 -6
  62. package/sdks/hermes-engine/utils/replace_hermes_version.js +8 -8
  63. package/sdks/hermesc/osx-bin/hermes +0 -0
  64. package/sdks/hermesc/osx-bin/hermesc +0 -0
  65. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  66. package/template/android/app/build.gradle +1 -1
  67. package/template/android/app/src/main/java/com/helloworld/MainApplication.kt +3 -10
  68. package/template/package.json +2 -2
  69. package/third-party-podspecs/glog.podspec +14 -1
  70. package/ReactCommon/jsinspector/.clang-tidy +0 -6
  71. package/ReactCommon/jsinspector/InspectorInterfaces.cpp +0 -106
  72. package/ReactCommon/jsinspector/InspectorInterfaces.h +0 -92
@@ -8,6 +8,7 @@
8
8
  #include "RCTLegacyViewManagerInteropCoordinator.h"
9
9
  #include <React/RCTBridge+Private.h>
10
10
  #include <React/RCTBridgeMethod.h>
11
+ #include <React/RCTBridgeProxy.h>
11
12
  #include <React/RCTComponentData.h>
12
13
  #include <React/RCTEventDispatcherProtocol.h>
13
14
  #include <React/RCTFollyConvert.h>
@@ -16,6 +17,7 @@
16
17
  #include <React/RCTUIManager.h>
17
18
  #include <React/RCTUIManagerUtils.h>
18
19
  #include <React/RCTUtils.h>
20
+ #include <React/RCTViewManager.h>
19
21
  #include <folly/json.h>
20
22
  #include <objc/runtime.h>
21
23
 
@@ -25,6 +27,8 @@ using namespace facebook::react;
25
27
  RCTComponentData *_componentData;
26
28
  __weak RCTBridge *_bridge;
27
29
  __weak RCTBridgeModuleDecorator *_bridgelessInteropData;
30
+ __weak RCTBridgeProxy *_bridgeProxy;
31
+
28
32
  /*
29
33
  Each instance of `RCTLegacyViewManagerInteropComponentView` registers a block to which events are dispatched.
30
34
  This is the container that maps unretained UIView pointer to a block to which the event is dispatched.
@@ -40,13 +44,16 @@ using namespace facebook::react;
40
44
  }
41
45
 
42
46
  - (instancetype)initWithComponentData:(RCTComponentData *)componentData
43
- bridge:(RCTBridge *)bridge
47
+ bridge:(nullable RCTBridge *)bridge
48
+ bridgeProxy:(nullable RCTBridgeProxy *)bridgeProxy
44
49
  bridgelessInteropData:(RCTBridgeModuleDecorator *)bridgelessInteropData;
45
50
  {
46
51
  if (self = [super init]) {
47
52
  _componentData = componentData;
48
53
  _bridge = bridge;
49
54
  _bridgelessInteropData = bridgelessInteropData;
55
+ _bridgeProxy = bridgeProxy;
56
+
50
57
  if (bridgelessInteropData) {
51
58
  // During bridge mode, RCTBridgeModules will be decorated with these APIs by the bridge.
52
59
  RCTAssert(
@@ -62,7 +69,9 @@ using namespace facebook::react;
62
69
  if (strongSelf) {
63
70
  InterceptorBlock block = [strongSelf->_eventInterceptors objectForKey:reactTag];
64
71
  if (block) {
65
- block(std::string([RCTNormalizeInputEventName(eventName) UTF8String]), convertIdToFollyDynamic(event ?: @{}));
72
+ block(
73
+ std::string([RCTNormalizeInputEventName(eventName) UTF8String]),
74
+ convertIdToFollyDynamic(event ? event : @{}));
66
75
  }
67
76
  }
68
77
  };
@@ -92,6 +101,10 @@ using namespace facebook::react;
92
101
  if (props.isObject()) {
93
102
  NSDictionary<NSString *, id> *convertedProps = convertFollyDynamicToId(props);
94
103
  [_componentData setProps:convertedProps forView:view];
104
+
105
+ if ([view respondsToSelector:@selector(didSetProps:)]) {
106
+ [view performSelector:@selector(didSetProps:) withObject:[convertedProps allKeys]];
107
+ }
95
108
  }
96
109
  }
97
110
 
@@ -131,15 +144,9 @@ using namespace facebook::react;
131
144
  NSArray *newArgs = [@[ [NSNumber numberWithInteger:tag] ] arrayByAddingObjectsFromArray:args];
132
145
 
133
146
  if (_bridge) {
134
- [_bridge.batchedBridge
135
- dispatchBlock:^{
136
- [method invokeWithBridge:self->_bridge module:self->_componentData.manager arguments:newArgs];
137
- [self->_bridge.uiManager setNeedsLayout];
138
- }
139
- queue:RCTGetUIManagerQueue()];
147
+ [self _handleCommandsOnBridge:method withArgs:newArgs];
140
148
  } else {
141
- // TODO T86826778 - Figure out which queue this should be dispatched to.
142
- [method invokeWithBridge:nil module:self->_componentData.manager arguments:newArgs];
149
+ [self _handleCommandsOnBridgeless:method withArgs:newArgs];
143
150
  }
144
151
  }
145
152
 
@@ -169,8 +176,37 @@ using namespace facebook::react;
169
176
  }
170
177
 
171
178
  #pragma mark - Private
179
+ - (void)_handleCommandsOnBridge:(id<RCTBridgeMethod>)method withArgs:(NSArray *)newArgs
180
+ {
181
+ [_bridge.batchedBridge
182
+ dispatchBlock:^{
183
+ [method invokeWithBridge:self->_bridge module:self->_componentData.manager arguments:newArgs];
184
+ [self->_bridge.uiManager setNeedsLayout];
185
+ }
186
+ queue:RCTGetUIManagerQueue()];
187
+ }
188
+
189
+ - (void)_handleCommandsOnBridgeless:(id<RCTBridgeMethod>)method withArgs:(NSArray *)newArgs
190
+ {
191
+ RCTViewManager *componentViewManager = self->_componentData.manager;
192
+ [componentViewManager setValue:_bridgeProxy forKey:@"bridge"];
193
+
194
+ [self->_bridgeProxy.uiManager
195
+ addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
196
+ [method invokeWithBridge:nil module:componentViewManager arguments:newArgs];
197
+ }];
198
+ }
172
199
 
173
200
  - (void)_addUIBlock:(RCTViewManagerUIBlock)block
201
+ {
202
+ if (_bridge) {
203
+ [self _addUIBlockOnBridge:block];
204
+ } else {
205
+ [self->_bridgeProxy.uiManager addUIBlock:block];
206
+ }
207
+ }
208
+
209
+ - (void)_addUIBlockOnBridge:(RCTViewManagerUIBlock)block
174
210
  {
175
211
  __weak __typeof__(self) weakSelf = self;
176
212
  [_bridge.batchedBridge
@@ -227,24 +227,23 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
227
227
  RuntimeExecutor bufferedRuntimeExecutor = _reactInstance->getBufferedRuntimeExecutor();
228
228
  timerManager->setRuntimeExecutor(bufferedRuntimeExecutor);
229
229
 
230
- RCTBridgeProxy *bridgeProxy = RCTTurboModuleInteropEnabled() && RCTTurboModuleInteropBridgeProxyEnabled()
231
- ? [[RCTBridgeProxy alloc] initWithViewRegistry:_bridgeModuleDecorator.viewRegistry_DEPRECATED
232
- moduleRegistry:_bridgeModuleDecorator.moduleRegistry
233
- bundleManager:_bridgeModuleDecorator.bundleManager
234
- callableJSModules:_bridgeModuleDecorator.callableJSModules
235
- dispatchToJSThread:^(dispatch_block_t block) {
236
- __strong __typeof(self) strongSelf = weakSelf;
237
- if (strongSelf && strongSelf->_valid) {
238
- strongSelf->_reactInstance->getBufferedRuntimeExecutor()([=](jsi::Runtime &runtime) { block(); });
239
- }
230
+ RCTBridgeProxy *bridgeProxy =
231
+ [[RCTBridgeProxy alloc] initWithViewRegistry:_bridgeModuleDecorator.viewRegistry_DEPRECATED
232
+ moduleRegistry:_bridgeModuleDecorator.moduleRegistry
233
+ bundleManager:_bridgeModuleDecorator.bundleManager
234
+ callableJSModules:_bridgeModuleDecorator.callableJSModules
235
+ dispatchToJSThread:^(dispatch_block_t block) {
236
+ __strong __typeof(self) strongSelf = weakSelf;
237
+ if (strongSelf && strongSelf->_valid) {
238
+ strongSelf->_reactInstance->getBufferedRuntimeExecutor()([=](jsi::Runtime &runtime) { block(); });
240
239
  }
241
- registerSegmentWithId:^(NSNumber *segmentId, NSString *path) {
242
- __strong __typeof(self) strongSelf = weakSelf;
243
- if (strongSelf && strongSelf->_valid) {
244
- [strongSelf registerSegmentWithId:segmentId path:path];
245
- }
246
- }]
247
- : nil;
240
+ }
241
+ registerSegmentWithId:^(NSNumber *segmentId, NSString *path) {
242
+ __strong __typeof(self) strongSelf = weakSelf;
243
+ if (strongSelf && strongSelf->_valid) {
244
+ [strongSelf registerSegmentWithId:segmentId path:path];
245
+ }
246
+ }];
248
247
 
249
248
  // Set up TurboModules
250
249
  _turboModuleManager = [[RCTTurboModuleManager alloc]
@@ -269,6 +268,7 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
269
268
  facebook::react::wrapManagedObject([_turboModuleManager moduleForName:"RCTEventDispatcher"]));
270
269
  contextContainer->insert("RCTBridgeModuleDecorator", facebook::react::wrapManagedObject(_bridgeModuleDecorator));
271
270
  contextContainer->insert("RuntimeScheduler", std::weak_ptr<RuntimeScheduler>(_reactInstance->getRuntimeScheduler()));
271
+ contextContainer->insert("RCTBridgeProxy", facebook::react::wrapManagedObject(bridgeProxy));
272
272
 
273
273
  _surfacePresenter = [[RCTSurfacePresenter alloc]
274
274
  initWithContextContainer:contextContainer
@@ -16,7 +16,7 @@ assertj = "3.21.0"
16
16
  download = "5.4.0"
17
17
  fbjni = "0.5.1"
18
18
  flipper = "0.201.0"
19
- fresco = "3.0.0"
19
+ fresco = "3.1.3"
20
20
  infer-annotation = "0.18.0"
21
21
  javax-inject = "1"
22
22
  jsr305 = "3.0.2"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.73.0-rc.2",
3
+ "version": "0.73.0-rc.4",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -93,29 +93,29 @@
93
93
  },
94
94
  "dependencies": {
95
95
  "@jest/create-cache-key-function": "^29.6.3",
96
- "@react-native-community/cli": "12.0.0-alpha.17",
97
- "@react-native-community/cli-platform-android": "12.0.0-alpha.17",
98
- "@react-native-community/cli-platform-ios": "12.0.0-alpha.17",
96
+ "@react-native-community/cli": "12.0.0",
97
+ "@react-native-community/cli-platform-android": "12.0.0",
98
+ "@react-native-community/cli-platform-ios": "12.0.0",
99
99
  "@react-native/assets-registry": "^0.73.1",
100
- "@react-native/community-cli-plugin": "^0.73.6",
100
+ "@react-native/community-cli-plugin": "^0.73.8",
101
101
  "@react-native/codegen": "^0.73.1",
102
- "@react-native/gradle-plugin": "^0.73.1",
102
+ "@react-native/gradle-plugin": "^0.73.3",
103
103
  "@react-native/js-polyfills": "^0.73.1",
104
104
  "@react-native/normalize-colors": "^0.73.2",
105
- "@react-native/virtualized-lists": "^0.73.1",
105
+ "@react-native/virtualized-lists": "^0.73.3",
106
106
  "abort-controller": "^3.0.0",
107
107
  "anser": "^1.4.9",
108
108
  "ansi-regex": "^5.0.0",
109
109
  "base64-js": "^1.5.1",
110
- "deprecated-react-native-prop-types": "4.2.1",
110
+ "deprecated-react-native-prop-types": "^5.0.0",
111
111
  "event-target-shim": "^5.0.1",
112
112
  "flow-enums-runtime": "^0.0.6",
113
113
  "invariant": "^2.2.4",
114
114
  "jest-environment-node": "^29.6.3",
115
115
  "jsc-android": "^250231.0.0",
116
116
  "memoize-one": "^5.0.0",
117
- "metro-runtime": "0.79.1",
118
- "metro-source-map": "0.79.1",
117
+ "metro-runtime": "^0.80.0",
118
+ "metro-source-map": "^0.80.0",
119
119
  "mkdirp": "^0.5.1",
120
120
  "nullthrows": "^1.1.1",
121
121
  "pretty-format": "^26.5.2",
@@ -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();
@@ -258,7 +258,7 @@ def react_native_post_install(
258
258
  flipper_post_install(installer)
259
259
  end
260
260
 
261
- fabric_enabled = ReactNativePodsUtils.has_pod(installer, 'React-Fabric')
261
+ fabric_enabled = ENV['RCT_FABRIC_ENABLED'] == '1'
262
262
  hermes_enabled = ReactNativePodsUtils.has_pod(installer, "React-hermes")
263
263
 
264
264
  if hermes_enabled
@@ -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
@@ -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()
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "18.2.0",
14
- "react-native": "0.73.0-rc.2"
14
+ "react-native": "0.73.0-rc.4"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.20.0",
@@ -19,7 +19,7 @@
19
19
  "@babel/runtime": "^7.20.0",
20
20
  "@react-native/babel-preset": "^0.73.18",
21
21
  "@react-native/eslint-config": "^0.73.1",
22
- "@react-native/metro-config": "^0.73.1",
22
+ "@react-native/metro-config": "^0.73.2",
23
23
  "@react-native/typescript-config": "^0.73.1",
24
24
  "@types/react": "^18.2.6",
25
25
  "@types/react-test-renderer": "^18.0.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.
@@ -1,6 +0,0 @@
1
- ---
2
- Checks: '>
3
- clang-diagnostic-*,
4
- '
5
- InheritParentConfig: true
6
- ...
@@ -1,106 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- #include "InspectorInterfaces.h"
9
-
10
- #include <mutex>
11
- #include <tuple>
12
- #include <unordered_map>
13
-
14
- namespace facebook::react {
15
-
16
- // pure destructors in C++ are odd. You would think they don't want an
17
- // implementation, but in fact the linker requires one. Define them to be
18
- // empty so that people don't count on them for any particular behaviour.
19
- IDestructible::~IDestructible() {}
20
- ILocalConnection::~ILocalConnection() {}
21
- IRemoteConnection::~IRemoteConnection() {}
22
- IInspector::~IInspector() {}
23
-
24
- namespace {
25
-
26
- class InspectorImpl : public IInspector {
27
- public:
28
- int addPage(
29
- const std::string& title,
30
- const std::string& vm,
31
- ConnectFunc connectFunc) override;
32
- void removePage(int pageId) override;
33
-
34
- std::vector<InspectorPage> getPages() const override;
35
- std::unique_ptr<ILocalConnection> connect(
36
- int pageId,
37
- std::unique_ptr<IRemoteConnection> remote) override;
38
-
39
- private:
40
- mutable std::mutex mutex_;
41
- int nextPageId_{1};
42
- std::unordered_map<int, std::tuple<std::string, std::string>> titles_;
43
- std::unordered_map<int, ConnectFunc> connectFuncs_;
44
- };
45
-
46
- int InspectorImpl::addPage(
47
- const std::string& title,
48
- const std::string& vm,
49
- ConnectFunc connectFunc) {
50
- std::scoped_lock lock(mutex_);
51
-
52
- int pageId = nextPageId_++;
53
- titles_[pageId] = std::make_tuple(title, vm);
54
- connectFuncs_[pageId] = std::move(connectFunc);
55
-
56
- return pageId;
57
- }
58
-
59
- void InspectorImpl::removePage(int pageId) {
60
- std::scoped_lock lock(mutex_);
61
-
62
- titles_.erase(pageId);
63
- connectFuncs_.erase(pageId);
64
- }
65
-
66
- std::vector<InspectorPage> InspectorImpl::getPages() const {
67
- std::scoped_lock lock(mutex_);
68
-
69
- std::vector<InspectorPage> inspectorPages;
70
- for (auto& it : titles_) {
71
- inspectorPages.push_back(InspectorPage{
72
- it.first, std::get<0>(it.second), std::get<1>(it.second)});
73
- }
74
-
75
- return inspectorPages;
76
- }
77
-
78
- std::unique_ptr<ILocalConnection> InspectorImpl::connect(
79
- int pageId,
80
- std::unique_ptr<IRemoteConnection> remote) {
81
- IInspector::ConnectFunc connectFunc;
82
-
83
- {
84
- std::scoped_lock lock(mutex_);
85
-
86
- auto it = connectFuncs_.find(pageId);
87
- if (it != connectFuncs_.end()) {
88
- connectFunc = it->second;
89
- }
90
- }
91
-
92
- return connectFunc ? connectFunc(std::move(remote)) : nullptr;
93
- }
94
-
95
- } // namespace
96
-
97
- IInspector& getInspectorInstance() {
98
- static InspectorImpl instance;
99
- return instance;
100
- }
101
-
102
- std::unique_ptr<IInspector> makeTestInspectorInstance() {
103
- return std::make_unique<InspectorImpl>();
104
- }
105
-
106
- } // namespace facebook::react