react-native 0.72.0 → 0.72.2

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 (60) hide show
  1. package/Libraries/Core/ReactNativeVersion.js +1 -1
  2. package/Libraries/LinkingIOS/React-RCTLinking.podspec +4 -1
  3. package/Libraries/Network/React-RCTNetwork.podspec +5 -1
  4. package/Libraries/Settings/React-RCTSettings.podspec +4 -1
  5. package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +1 -1
  6. package/Libraries/Vibration/React-RCTVibration.podspec +3 -1
  7. package/React/Base/RCTVersion.m +1 -1
  8. package/React/CoreModules/React-CoreModules.podspec +1 -1
  9. package/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm +3 -0
  10. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.mm +2 -0
  11. package/React/Fabric/Mounting/RCTComponentViewFactory.mm +22 -3
  12. package/React-Core.podspec +1 -1
  13. package/ReactAndroid/gradle.properties +1 -1
  14. package/ReactAndroid/hermes-engine/build.gradle +2 -0
  15. package/ReactAndroid/src/main/java/com/facebook/react/animated/FrameBasedAnimationDriver.java +14 -1
  16. package/ReactAndroid/src/main/java/com/facebook/react/modules/network/RequestBodyUtil.java +16 -2
  17. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  18. package/ReactAndroid/src/main/java/com/facebook/react/views/text/FontMetricsUtil.java +3 -1
  19. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +4 -1
  20. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +4 -1
  21. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +8 -2
  22. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +8 -2
  23. package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +15 -11
  24. package/ReactCommon/React-Fabric.podspec +3 -2
  25. package/ReactCommon/React-rncore.podspec +12 -0
  26. package/ReactCommon/ReactCommon.podspec +1 -1
  27. package/ReactCommon/cxxreact/CMakeLists.txt +2 -1
  28. package/ReactCommon/cxxreact/Instance.cpp +25 -19
  29. package/ReactCommon/cxxreact/React-cxxreact.podspec +2 -1
  30. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  31. package/ReactCommon/hermes/inspector/CMakeLists.txt +8 -0
  32. package/ReactCommon/jsi/React-jsi.podspec +2 -1
  33. package/ReactCommon/react/config/ReactNativeConfig.cpp +0 -3
  34. package/ReactCommon/react/debug/React-debug.podspec +3 -2
  35. package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -1
  36. package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +1 -1
  37. package/ReactCommon/react/renderer/components/image/ImageShadowNode.h +1 -1
  38. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +26 -7
  39. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +4 -0
  40. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +4 -5
  41. package/ReactCommon/react/renderer/graphics/React-graphics.podspec +4 -2
  42. package/ReactCommon/react/renderer/imagemanager/ImageRequest.h +5 -8
  43. package/ReactCommon/react/renderer/imagemanager/platform/cxx/react/renderer/imagemanager/ImageManager.cpp +1 -1
  44. package/ReactCommon/react/renderer/imagemanager/platform/cxx/react/renderer/imagemanager/ImageRequest.cpp +5 -2
  45. package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +1 -1
  46. package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/ImageRequest.cpp +6 -10
  47. package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTImageManager.mm +2 -4
  48. package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTSyncImageManager.mm +2 -4
  49. package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +1 -1
  50. package/ReactCommon/react/utils/React-utils.podspec +4 -4
  51. package/ReactCommon/react/utils/SharedFunction.h +6 -4
  52. package/package.json +8 -8
  53. package/scripts/cocoapods/__tests__/codegen_utils-test.rb +2 -2
  54. package/scripts/cocoapods/codegen_utils.rb +1 -1
  55. package/scripts/react-native-xcode.sh +1 -1
  56. package/scripts/react_native_pods.rb +1 -1
  57. package/sdks/hermesc/osx-bin/hermesc +0 -0
  58. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  59. package/template/README.md +79 -0
  60. package/template/package.json +3 -4
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
37
37
  "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
38
38
  "GCC_WARN_PEDANTIC" => "YES" }
39
39
  if ENV['USE_FRAMEWORKS']
40
- s.header_mappings_dir = './'
40
+ s.header_mappings_dir = File.absolute_path('./')
41
41
  end
42
42
 
43
43
 
@@ -46,7 +46,7 @@ class ImageShadowNode final : public ConcreteViewShadowNode<
46
46
  ShadowNodeFamilyFragment const &familyFragment,
47
47
  ComponentDescriptor const &componentDescriptor) {
48
48
  auto imageSource = ImageSource{ImageSource::Type::Invalid};
49
- return {imageSource, {imageSource, nullptr}, 0};
49
+ return {imageSource, {imageSource, nullptr, {}}, 0};
50
50
  }
51
51
 
52
52
  #pragma mark - LayoutableShadowNode
@@ -19,7 +19,7 @@
19
19
  namespace facebook {
20
20
  namespace react {
21
21
 
22
- static std::string moduleNameFromComponentName(const std::string &componentName)
22
+ static std::string moduleNameFromComponentNameNoRCTPrefix(const std::string &componentName)
23
23
  {
24
24
  // TODO: remove FB specific code (T56174424)
25
25
  if (componentName == "StickerInputView") {
@@ -46,12 +46,32 @@ static std::string moduleNameFromComponentName(const std::string &componentName)
46
46
  return componentName + "Manager";
47
47
  }
48
48
 
49
- return "RCT" + componentName + "Manager";
49
+ return componentName + "Manager";
50
50
  }
51
51
 
52
52
  inline NSString *RCTNSStringFromString(const std::string &string)
53
53
  {
54
- return [NSString stringWithCString:string.c_str() encoding:NSUTF8StringEncoding];
54
+ return [NSString stringWithUTF8String:string.c_str()];
55
+ }
56
+
57
+ static Class getViewManagerFromComponentName(const std::string &componentName)
58
+ {
59
+ auto viewManagerName = moduleNameFromComponentNameNoRCTPrefix(componentName);
60
+
61
+ // 1. Try to get the manager with the RCT prefix.
62
+ auto rctViewManagerName = "RCT" + viewManagerName;
63
+ Class viewManagerClass = NSClassFromString(RCTNSStringFromString(rctViewManagerName));
64
+ if (viewManagerClass) {
65
+ return viewManagerClass;
66
+ }
67
+
68
+ // 2. Try to get the manager without the prefix.
69
+ viewManagerClass = NSClassFromString(RCTNSStringFromString(viewManagerName));
70
+ if (viewManagerClass) {
71
+ return viewManagerClass;
72
+ }
73
+
74
+ return nil;
55
75
  }
56
76
 
57
77
  static std::shared_ptr<void> const constructCoordinator(
@@ -59,9 +79,8 @@ static std::shared_ptr<void> const constructCoordinator(
59
79
  ComponentDescriptor::Flavor const &flavor)
60
80
  {
61
81
  auto componentName = *std::static_pointer_cast<std::string const>(flavor);
62
- auto moduleName = moduleNameFromComponentName(componentName);
63
- Class module = NSClassFromString(RCTNSStringFromString(moduleName));
64
- assert(module);
82
+ Class viewManagerClass = getViewManagerFromComponentName(componentName);
83
+ assert(viewManagerClass);
65
84
  auto optionalBridge = contextContainer->find<std::shared_ptr<void>>("Bridge");
66
85
  RCTBridge *bridge;
67
86
  if (optionalBridge) {
@@ -80,7 +99,7 @@ static std::shared_ptr<void> const constructCoordinator(
80
99
  bridgeModuleDecorator = unwrapManagedObject(optionalModuleDecorator.value());
81
100
  }
82
101
 
83
- RCTComponentData *componentData = [[RCTComponentData alloc] initWithManagerClass:module
102
+ RCTComponentData *componentData = [[RCTComponentData alloc] initWithManagerClass:viewManagerClass
84
103
  bridge:bridge
85
104
  eventDispatcher:eventDispatcher];
86
105
  return wrapManagedObject([[RCTLegacyViewManagerInteropCoordinator alloc]
@@ -38,6 +38,10 @@ typedef void (^InterceptorBlock)(std::string eventName, folly::dynamic event);
38
38
  reactTag:(NSInteger)tag
39
39
  paperView:(UIView *)paperView;
40
40
 
41
+ - (void)removeViewFromRegistryWithTag:(NSInteger)tag;
42
+
43
+ - (void)addViewToRegistry:(UIView *)view withTag:(NSInteger)tag;
44
+
41
45
  @end
42
46
 
43
47
  NS_ASSUME_NONNULL_END
@@ -131,22 +131,19 @@ using namespace facebook::react;
131
131
  NSArray *newArgs = [@[ [NSNumber numberWithInteger:tag] ] arrayByAddingObjectsFromArray:args];
132
132
 
133
133
  if (_bridge) {
134
- [self _addViewToRegistry:paperView withTag:tag];
135
134
  [_bridge.batchedBridge
136
135
  dispatchBlock:^{
137
136
  [method invokeWithBridge:self->_bridge module:self->_componentData.manager arguments:newArgs];
138
137
  [self->_bridge.uiManager setNeedsLayout];
139
138
  }
140
139
  queue:RCTGetUIManagerQueue()];
141
- [self _removeViewFromRegistryWithTag:tag];
142
140
  } else {
143
141
  // TODO T86826778 - Figure out which queue this should be dispatched to.
144
142
  [method invokeWithBridge:nil module:self->_componentData.manager arguments:newArgs];
145
143
  }
146
144
  }
147
145
 
148
- #pragma mark - Private
149
- - (void)_addViewToRegistry:(UIView *)view withTag:(NSInteger)tag
146
+ - (void)addViewToRegistry:(UIView *)view withTag:(NSInteger)tag
150
147
  {
151
148
  [self _addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
152
149
  if ([viewRegistry objectForKey:@(tag)] != NULL) {
@@ -158,7 +155,7 @@ using namespace facebook::react;
158
155
  }];
159
156
  }
160
157
 
161
- - (void)_removeViewFromRegistryWithTag:(NSInteger)tag
158
+ - (void)removeViewFromRegistryWithTag:(NSInteger)tag
162
159
  {
163
160
  [self _addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
164
161
  if ([viewRegistry objectForKey:@(tag)] == NULL) {
@@ -171,6 +168,8 @@ using namespace facebook::react;
171
168
  }];
172
169
  }
173
170
 
171
+ #pragma mark - Private
172
+
174
173
  - (void)_addUIBlock:(RCTViewManagerUIBlock)block
175
174
  {
176
175
  __weak __typeof__(self) weakSelf = self;
@@ -45,11 +45,13 @@ Pod::Spec.new do |s|
45
45
 
46
46
  if ENV['USE_FRAMEWORKS']
47
47
  s.module_name = "React_graphics"
48
- s.header_mappings_dir = "../../.."
48
+ s.header_mappings_dir = File.absolute_path("../../..")
49
49
  header_search_paths = header_search_paths + ["\"$(PODS_TARGET_SRCROOT)/platform/ios\""]
50
50
  end
51
51
 
52
- s.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", "HEADER_SEARCH_PATHS" => header_search_paths.join(" ") }
52
+ s.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
53
+ "HEADER_SEARCH_PATHS" => header_search_paths.join(" "),
54
+ "DEFINES_MODULE" => "YES" }
53
55
 
54
56
  s.dependency "glog"
55
57
  s.dependency "RCT-Folly/Fabric", folly_version
@@ -12,6 +12,7 @@
12
12
  #include <react/renderer/imagemanager/ImageResponseObserverCoordinator.h>
13
13
  #include <react/renderer/imagemanager/ImageTelemetry.h>
14
14
  #include <react/renderer/imagemanager/primitives.h>
15
+ #include <react/utils/SharedFunction.h>
15
16
 
16
17
  namespace facebook {
17
18
  namespace react {
@@ -30,7 +31,8 @@ class ImageRequest final {
30
31
  */
31
32
  ImageRequest(
32
33
  ImageSource imageSource,
33
- std::shared_ptr<const ImageTelemetry> telemetry);
34
+ std::shared_ptr<const ImageTelemetry> telemetry,
35
+ SharedFunction<> cancelationFunction);
34
36
 
35
37
  /*
36
38
  * The move constructor.
@@ -42,11 +44,6 @@ class ImageRequest final {
42
44
  */
43
45
  ImageRequest(const ImageRequest &other) = delete;
44
46
 
45
- /**
46
- * Set cancelation function.
47
- */
48
- void setCancelationFunction(std::function<void(void)> cancelationFunction);
49
-
50
47
  /*
51
48
  * Calls cancel function if one is defined. Should be when downloading
52
49
  * image isn't needed anymore. E.g. <ImageView /> was removed.
@@ -95,9 +92,9 @@ class ImageRequest final {
95
92
  std::shared_ptr<const ImageResponseObserverCoordinator> coordinator_{};
96
93
 
97
94
  /*
98
- * Function we can call to cancel image request (see destructor).
95
+ * Function we can call to cancel image request.
99
96
  */
100
- std::function<void(void)> cancelRequest_;
97
+ SharedFunction<> cancelRequest_;
101
98
  };
102
99
 
103
100
  } // namespace react
@@ -24,7 +24,7 @@ ImageRequest ImageManager::requestImage(
24
24
  const ImageSource &imageSource,
25
25
  SurfaceId /*surfaceId*/) const {
26
26
  // Not implemented.
27
- return {imageSource, nullptr};
27
+ return {imageSource, nullptr, {}};
28
28
  }
29
29
 
30
30
  } // namespace facebook::react
@@ -13,8 +13,11 @@ namespace facebook::react {
13
13
 
14
14
  ImageRequest::ImageRequest(
15
15
  ImageSource imageSource,
16
- std::shared_ptr<const ImageTelemetry> telemetry)
17
- : imageSource_(std::move(imageSource)), telemetry_(std::move(telemetry)) {
16
+ std::shared_ptr<const ImageTelemetry> telemetry,
17
+ SharedFunction<> cancelationFunction)
18
+ : imageSource_(std::move(imageSource)),
19
+ telemetry_(std::move(telemetry)),
20
+ cancelRequest_(std::move(cancelationFunction)) {
18
21
  // Not implemented.
19
22
  }
20
23
 
@@ -42,7 +42,7 @@ Pod::Spec.new do |s|
42
42
 
43
43
  if ENV['USE_FRAMEWORKS']
44
44
  s.module_name = "React_ImageManager"
45
- s.header_mappings_dir = "./"
45
+ s.header_mappings_dir = File.absolute_path("./")
46
46
  header_search_paths = header_search_paths + [
47
47
  "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers\"",
48
48
  "\"$(PODS_ROOT)/DoubleConversion\"",
@@ -12,20 +12,16 @@ namespace react {
12
12
 
13
13
  ImageRequest::ImageRequest(
14
14
  ImageSource imageSource,
15
- std::shared_ptr<const ImageTelemetry> telemetry)
16
- : imageSource_(std::move(imageSource)), telemetry_(std::move(telemetry)) {
15
+ std::shared_ptr<const ImageTelemetry> telemetry,
16
+ SharedFunction<> cancelationFunction)
17
+ : imageSource_(std::move(imageSource)),
18
+ telemetry_(std::move(telemetry)),
19
+ cancelRequest_(std::move(cancelationFunction)) {
17
20
  coordinator_ = std::make_shared<ImageResponseObserverCoordinator>();
18
21
  }
19
22
 
20
- void ImageRequest::setCancelationFunction(
21
- std::function<void(void)> cancelationFunction) {
22
- cancelRequest_ = cancelationFunction;
23
- }
24
-
25
23
  void ImageRequest::cancel() const {
26
- if (cancelRequest_) {
27
- cancelRequest_();
28
- }
24
+ cancelRequest_();
29
25
  }
30
26
 
31
27
  const ImageSource &ImageRequest::getImageSource() const {
@@ -48,13 +48,11 @@ using namespace facebook::react;
48
48
  telemetry = nullptr;
49
49
  }
50
50
 
51
- auto imageRequest = ImageRequest(imageSource, telemetry);
51
+ auto sharedCancelationFunction = SharedFunction<>();
52
+ auto imageRequest = ImageRequest(imageSource, telemetry, sharedCancelationFunction);
52
53
  auto weakObserverCoordinator =
53
54
  (std::weak_ptr<const ImageResponseObserverCoordinator>)imageRequest.getSharedObserverCoordinator();
54
55
 
55
- auto sharedCancelationFunction = SharedFunction<>();
56
- imageRequest.setCancelationFunction(sharedCancelationFunction);
57
-
58
56
  /*
59
57
  * Even if an image is being loaded asynchronously on some other background thread, some other preparation
60
58
  * work (such as creating an `NSURLRequest` object and some obscure logic inside `RCTImageLoader`) can take a couple
@@ -37,13 +37,11 @@ using namespace facebook::react;
37
37
  - (ImageRequest)requestImage:(ImageSource)imageSource surfaceId:(SurfaceId)surfaceId
38
38
  {
39
39
  auto telemetry = std::make_shared<ImageTelemetry>(surfaceId);
40
- auto imageRequest = ImageRequest(imageSource, telemetry);
40
+ auto sharedCancelationFunction = SharedFunction<>();
41
+ auto imageRequest = ImageRequest(imageSource, telemetry, sharedCancelationFunction);
41
42
  auto weakObserverCoordinator =
42
43
  (std::weak_ptr<const ImageResponseObserverCoordinator>)imageRequest.getSharedObserverCoordinator();
43
44
 
44
- auto sharedCancelationFunction = SharedFunction<>();
45
- imageRequest.setCancelationFunction(sharedCancelationFunction);
46
-
47
45
  dispatch_group_t imageWaitGroup = dispatch_group_create();
48
46
 
49
47
  dispatch_group_enter(imageWaitGroup);
@@ -47,7 +47,7 @@ Pod::Spec.new do |s|
47
47
 
48
48
  if ENV['USE_FRAMEWORKS']
49
49
  s.module_name = "React_runtimescheduler"
50
- s.header_mappings_dir = "../../.."
50
+ s.header_mappings_dir = File.absolute_path("../../..")
51
51
  end
52
52
 
53
53
  s.dependency "React-jsi"
@@ -42,13 +42,13 @@ Pod::Spec.new do |s|
42
42
  s.compiler_flags = folly_compiler_flags
43
43
  s.header_dir = "react/utils"
44
44
  s.exclude_files = "tests"
45
- s.pod_target_xcconfig = {
46
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
47
- "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')}
45
+ s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
46
+ "HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
47
+ "DEFINES_MODULE" => "YES" }
48
48
 
49
49
  if ENV['USE_FRAMEWORKS']
50
50
  s.module_name = "React_utils"
51
- s.header_mappings_dir = "../.."
51
+ s.header_mappings_dir = File.absolute_path("../..")
52
52
  end
53
53
 
54
54
  s.dependency "RCT-Folly", folly_version
@@ -22,9 +22,9 @@ namespace react {
22
22
  * - When captured by `std::function` arguments are not copyable;
23
23
  * - When we need to replace the content of the callable later on the go.
24
24
  */
25
- template <typename ReturnT = void, typename... ArgumentT>
25
+ template <typename... ArgumentT>
26
26
  class SharedFunction {
27
- using T = ReturnT(ArgumentT...);
27
+ using T = void(ArgumentT...);
28
28
 
29
29
  struct Pair {
30
30
  Pair(std::function<T> &&function) : function(std::move(function)) {}
@@ -47,9 +47,11 @@ class SharedFunction {
47
47
  pair_->function = function;
48
48
  }
49
49
 
50
- ReturnT operator()(ArgumentT... args) const {
50
+ void operator()(ArgumentT... args) const {
51
51
  std::shared_lock lock(pair_->mutex);
52
- return pair_->function(args...);
52
+ if (pair_->function) {
53
+ pair_->function(args...);
54
+ }
53
55
  }
54
56
 
55
57
  private:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.72.0",
3
+ "version": "0.72.2",
4
4
  "bin": "./cli.js",
5
5
  "description": "A framework for building native apps using React",
6
6
  "license": "MIT",
@@ -79,15 +79,15 @@
79
79
  },
80
80
  "dependencies": {
81
81
  "@jest/create-cache-key-function": "^29.2.1",
82
- "@react-native-community/cli": "11.3.2",
83
- "@react-native-community/cli-platform-android": "11.3.2",
84
- "@react-native-community/cli-platform-ios": "11.3.2",
82
+ "@react-native-community/cli": "11.3.5",
83
+ "@react-native-community/cli-platform-android": "11.3.5",
84
+ "@react-native-community/cli-platform-ios": "11.3.5",
85
85
  "@react-native/assets-registry": "^0.72.0",
86
86
  "@react-native/codegen": "^0.72.6",
87
- "@react-native/gradle-plugin": "^0.72.10",
87
+ "@react-native/gradle-plugin": "^0.72.11",
88
88
  "@react-native/js-polyfills": "^0.72.1",
89
89
  "@react-native/normalize-colors": "^0.72.0",
90
- "@react-native/virtualized-lists": "^0.72.5",
90
+ "@react-native/virtualized-lists": "^0.72.6",
91
91
  "abort-controller": "^3.0.0",
92
92
  "anser": "^1.4.9",
93
93
  "base64-js": "^1.1.2",
@@ -98,8 +98,8 @@
98
98
  "jest-environment-node": "^29.2.1",
99
99
  "jsc-android": "^250231.0.0",
100
100
  "memoize-one": "^5.0.0",
101
- "metro-runtime": "0.76.5",
102
- "metro-source-map": "0.76.5",
101
+ "metro-runtime": "0.76.7",
102
+ "metro-source-map": "0.76.7",
103
103
  "mkdirp": "^0.5.1",
104
104
  "nullthrows": "^1.1.1",
105
105
  "pretty-format": "^26.5.2",
@@ -373,7 +373,7 @@ class CodegenUtilsTests < Test::Unit::TestCase
373
373
  '[Codegen] warn: using experimental new codegen integration'
374
374
  ])
375
375
  assert_equal(codegen_utils_mock.get_react_codegen_script_phases_params, [{
376
- :app_path => "~/app",
376
+ :app_path => app_path,
377
377
  :config_file_dir => "",
378
378
  :config_key => "codegenConfig",
379
379
  :fabric_enabled => false,
@@ -382,7 +382,7 @@ class CodegenUtilsTests < Test::Unit::TestCase
382
382
  assert_equal(codegen_utils_mock.get_react_codegen_spec_params, [{
383
383
  :fabric_enabled => false,
384
384
  :folly_version=>"2021.07.22.00",
385
- :package_json_file => "../node_modules/react-native/package.json",
385
+ :package_json_file => "#{app_path}/ios/../node_modules/react-native/package.json",
386
386
  :script_phases => "echo TestScript"
387
387
  }])
388
388
  assert_equal(codegen_utils_mock.generate_react_codegen_spec_params, [{
@@ -313,7 +313,7 @@ class CodegenUtils
313
313
  :config_key => config_key
314
314
  )
315
315
  react_codegen_spec = codegen_utils.get_react_codegen_spec(
316
- file_manager.join(react_native_path, "package.json"),
316
+ file_manager.join(relative_installation_root, react_native_path, "package.json"),
317
317
  :folly_version => folly_version,
318
318
  :fabric_enabled => fabric_enabled,
319
319
  :hermes_enabled => hermes_enabled,
@@ -176,7 +176,7 @@ else
176
176
  if [[ $EMIT_SOURCEMAP == true ]]; then
177
177
  EXTRA_COMPILER_ARGS="$EXTRA_COMPILER_ARGS -output-source-map"
178
178
  fi
179
- "$HERMES_CLI_PATH" -emit-binary -max-diagnostic-width=80 "$EXTRA_COMPILER_ARGS" -out "$DEST/main.jsbundle" "$BUNDLE_FILE"
179
+ "$HERMES_CLI_PATH" -emit-binary -max-diagnostic-width=80 $EXTRA_COMPILER_ARGS -out "$DEST/main.jsbundle" "$BUNDLE_FILE"
180
180
  if [[ $EMIT_SOURCEMAP == true ]]; then
181
181
  HBC_SOURCEMAP_FILE="$DEST/main.jsbundle.map"
182
182
  "$NODE_BINARY" "$COMPOSE_SOURCEMAP_PATH" "$PACKAGER_SOURCEMAP_FILE" "$HBC_SOURCEMAP_FILE" -o "$SOURCEMAP_FILE"
@@ -139,7 +139,7 @@ def use_react_native! (
139
139
  pod 'Yoga', :path => "#{prefix}/ReactCommon/yoga", :modular_headers => true
140
140
 
141
141
  pod 'DoubleConversion', :podspec => "#{prefix}/third-party-podspecs/DoubleConversion.podspec"
142
- pod 'glog', :podspec => "#{prefix}/third-party-podspecs/glog.podspec"
142
+ pod 'glog', :podspec => "#{prefix}/third-party-podspecs/glog.podspec", :modular_headers => true
143
143
  pod 'boost', :podspec => "#{prefix}/third-party-podspecs/boost.podspec"
144
144
  pod 'RCT-Folly', :podspec => "#{prefix}/third-party-podspecs/RCT-Folly.podspec", :modular_headers => true
145
145
 
Binary file
Binary file
@@ -0,0 +1,79 @@
1
+ This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
2
+
3
+ # Getting Started
4
+
5
+ >**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
6
+
7
+ ## Step 1: Start the Metro Server
8
+
9
+ First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.
10
+
11
+ To start Metro, run the following command from the _root_ of your React Native project:
12
+
13
+ ```bash
14
+ # using npm
15
+ npm start
16
+
17
+ # OR using Yarn
18
+ yarn start
19
+ ```
20
+
21
+ ## Step 2: Start your Application
22
+
23
+ Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app:
24
+
25
+ ### For Android
26
+
27
+ ```bash
28
+ # using npm
29
+ npm run android
30
+
31
+ # OR using Yarn
32
+ yarn android
33
+ ```
34
+
35
+ ### For iOS
36
+
37
+ ```bash
38
+ # using npm
39
+ npm run ios
40
+
41
+ # OR using Yarn
42
+ yarn ios
43
+ ```
44
+
45
+ If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly.
46
+
47
+ This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.
48
+
49
+ ## Step 3: Modifying your App
50
+
51
+ Now that you have successfully run the app, let's modify it.
52
+
53
+ 1. Open `App.tsx` in your text editor of choice and edit some lines.
54
+ 2. For **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Developer Menu** (<kbd>Ctrl</kbd> + <kbd>M</kbd> (on Window and Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (on macOS)) to see your changes!
55
+
56
+ For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!
57
+
58
+ ## Congratulations! :tada:
59
+
60
+ You've successfully run and modified your React Native App. :partying_face:
61
+
62
+ ### Now what?
63
+
64
+ - If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
65
+ - If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).
66
+
67
+ # Troubleshooting
68
+
69
+ If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
70
+
71
+ # Learn More
72
+
73
+ To learn more about React Native, take a look at the following resources:
74
+
75
+ - [React Native Website](https://reactnative.dev) - learn more about React Native.
76
+ - [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
77
+ - [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
78
+ - [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
79
+ - [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.
@@ -11,22 +11,21 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "18.2.0",
14
- "react-native": "0.72.0"
14
+ "react-native": "0.72.2"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.20.0",
18
18
  "@babel/preset-env": "^7.20.0",
19
19
  "@babel/runtime": "^7.20.0",
20
20
  "@react-native/eslint-config": "^0.72.2",
21
- "@react-native/metro-config": "^0.72.6",
21
+ "@react-native/metro-config": "^0.72.9",
22
22
  "@tsconfig/react-native": "^3.0.0",
23
- "@types/metro-config": "^0.76.3",
24
23
  "@types/react": "^18.0.24",
25
24
  "@types/react-test-renderer": "^18.0.0",
26
25
  "babel-jest": "^29.2.1",
27
26
  "eslint": "^8.19.0",
28
27
  "jest": "^29.2.1",
29
- "metro-react-native-babel-preset": "0.76.5",
28
+ "metro-react-native-babel-preset": "0.76.7",
30
29
  "prettier": "^2.4.1",
31
30
  "react-test-renderer": "18.2.0",
32
31
  "typescript": "4.8.4"