react-native 0.72.9 → 0.72.11

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.
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 72,
15
- patch: 9,
15
+ patch: 11,
16
16
  prerelease: null,
17
17
  };
@@ -36,6 +36,11 @@ let rejectionTrackingOptions: $Call<ExtractOptionsType, enable> = {
36
36
  ? rejection
37
37
  : JSON.stringify((rejection: $FlowFixMe));
38
38
  }
39
+ // It could although this object is not a standard error, it still has stack information to unwind
40
+ // $FlowFixMe ignore types just check if stack is there
41
+ if (rejection.stack && typeof rejection.stack === 'string') {
42
+ stack = rejection.stack;
43
+ }
39
44
  }
40
45
 
41
46
  const warning = `Possible unhandled promise rejection (id: ${id}):\n${
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(72),
26
- RCTVersionPatch: @(9),
26
+ RCTVersionPatch: @(11),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.72.9
1
+ VERSION_NAME=0.72.11
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  # JVM Versions
@@ -113,6 +113,7 @@ public abstract class ReactActivity extends AppCompatActivity
113
113
  @Override
114
114
  public void onRequestPermissionsResult(
115
115
  int requestCode, String[] permissions, int[] grantResults) {
116
+ super.onRequestPermissionsResult(requestCode, permissions, grantResults);
116
117
  mDelegate.onRequestPermissionsResult(requestCode, permissions, grantResults);
117
118
  }
118
119
 
@@ -17,6 +17,6 @@ public class ReactNativeVersion {
17
17
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
18
18
  "major", 0,
19
19
  "minor", 72,
20
- "patch", 9,
20
+ "patch", 11,
21
21
  "prerelease", null);
22
22
  }
@@ -10,6 +10,8 @@ package com.facebook.react.uimanager;
10
10
  import android.view.View;
11
11
  import android.view.ViewGroup;
12
12
  import androidx.annotation.Nullable;
13
+ import com.facebook.common.logging.FLog;
14
+ import com.facebook.react.common.ReactConstants;
13
15
  import java.util.ArrayList;
14
16
  import java.util.Collections;
15
17
  import java.util.Comparator;
@@ -65,6 +67,17 @@ public class ViewGroupDrawingOrderHelper {
65
67
  * ViewGroup#getChildDrawingOrder}.
66
68
  */
67
69
  public int getChildDrawingOrder(int childCount, int index) {
70
+ if (mDrawingOrderIndices != null
71
+ && (index >= mDrawingOrderIndices.length || mDrawingOrderIndices[index] >= childCount)) {
72
+ FLog.w(
73
+ ReactConstants.TAG,
74
+ "getChildDrawingOrder index out of bounds! Please check any custom view manipulations you"
75
+ + " may have done. childCount = %d, index = %d",
76
+ childCount,
77
+ index);
78
+ update();
79
+ }
80
+
68
81
  if (mDrawingOrderIndices == null) {
69
82
  ArrayList<View> viewsToSort = new ArrayList<>();
70
83
  for (int i = 0; i < childCount; i++) {
@@ -420,10 +420,10 @@ public class ReactViewGroup extends ViewGroup
420
420
  if (!intersects && child.getParent() != null && !isAnimating) {
421
421
  // We can try saving on invalidate call here as the view that we remove is out of visible area
422
422
  // therefore invalidation is not necessary.
423
- super.removeViewsInLayout(idx - clippedSoFar, 1);
423
+ removeViewsInLayout(idx - clippedSoFar, 1);
424
424
  needUpdateClippingRecursive = true;
425
425
  } else if (intersects && child.getParent() == null) {
426
- super.addViewInLayout(child, idx - clippedSoFar, sDefaultLayoutParam, true);
426
+ addViewInLayout(child, idx - clippedSoFar, sDefaultLayoutParam, true);
427
427
  invalidate();
428
428
  needUpdateClippingRecursive = true;
429
429
  } else if (intersects) {
@@ -501,23 +501,18 @@ public class ReactViewGroup extends ViewGroup
501
501
  return ViewUtil.getUIManagerType(getId()) == UIManagerType.FABRIC;
502
502
  }
503
503
 
504
- @Override
505
- public void addView(View child, int index, ViewGroup.LayoutParams params) {
506
- // This will get called for every overload of addView so there is not need to override every
507
- // method.
504
+ private void handleAddView(View view) {
505
+ UiThreadUtil.assertOnUiThread();
508
506
 
509
507
  if (!customDrawOrderDisabled()) {
510
- getDrawingOrderHelper().handleAddView(child);
508
+ getDrawingOrderHelper().handleAddView(view);
511
509
  setChildrenDrawingOrderEnabled(getDrawingOrderHelper().shouldEnableCustomDrawingOrder());
512
510
  } else {
513
511
  setChildrenDrawingOrderEnabled(false);
514
512
  }
515
-
516
- super.addView(child, index, params);
517
513
  }
518
514
 
519
- @Override
520
- public void removeView(View view) {
515
+ private void handleRemoveView(View view) {
521
516
  UiThreadUtil.assertOnUiThread();
522
517
 
523
518
  if (!customDrawOrderDisabled()) {
@@ -526,22 +521,60 @@ public class ReactViewGroup extends ViewGroup
526
521
  } else {
527
522
  setChildrenDrawingOrderEnabled(false);
528
523
  }
524
+ }
525
+
526
+ private void handleRemoveViews(int start, int count) {
527
+ int endIndex = start + count;
528
+ for (int index = start; index < endIndex; index++) {
529
+ if (index < getChildCount()) {
530
+ handleRemoveView(getChildAt(index));
531
+ }
532
+ }
533
+ }
534
+
535
+ @Override
536
+ public void addView(View child, int index, ViewGroup.LayoutParams params) {
537
+ // This will get called for every overload of addView so there is not need to override every
538
+ // method.
539
+ handleAddView(child);
540
+ super.addView(child, index, params);
541
+ }
529
542
 
543
+ @Override
544
+ protected boolean addViewInLayout(
545
+ View child, int index, LayoutParams params, boolean preventRequestLayout) {
546
+ handleAddView(child);
547
+ return super.addViewInLayout(child, index, params, preventRequestLayout);
548
+ }
549
+
550
+ @Override
551
+ public void removeView(View view) {
552
+ handleRemoveView(view);
530
553
  super.removeView(view);
531
554
  }
532
555
 
533
556
  @Override
534
557
  public void removeViewAt(int index) {
535
- UiThreadUtil.assertOnUiThread();
558
+ handleRemoveView(getChildAt(index));
559
+ super.removeViewAt(index);
560
+ }
536
561
 
537
- if (!customDrawOrderDisabled()) {
538
- getDrawingOrderHelper().handleRemoveView(getChildAt(index));
539
- setChildrenDrawingOrderEnabled(getDrawingOrderHelper().shouldEnableCustomDrawingOrder());
540
- } else {
541
- setChildrenDrawingOrderEnabled(false);
542
- }
562
+ @Override
563
+ public void removeViewInLayout(View view) {
564
+ handleRemoveView(view);
565
+ super.removeViewInLayout(view);
566
+ }
543
567
 
544
- super.removeViewAt(index);
568
+ @Override
569
+ public void removeViewsInLayout(int start, int count) {
570
+ handleRemoveViews(start, count);
571
+ super.removeViewsInLayout(start, count);
572
+ }
573
+
574
+ @Override
575
+ public void removeViews(int start, int count) {
576
+ handleRemoveViews(start, count);
577
+ super.removeViews(start, count);
545
578
  }
546
579
 
547
580
  @Override
@@ -665,7 +698,7 @@ public class ReactViewGroup extends ViewGroup
665
698
  clippedSoFar++;
666
699
  }
667
700
  }
668
- super.removeViewsInLayout(index - clippedSoFar, 1);
701
+ removeViewsInLayout(index - clippedSoFar, 1);
669
702
  }
670
703
  removeFromArray(index);
671
704
  }
@@ -33,7 +33,8 @@ Pod::Spec.new do |s|
33
33
  s.source = source
34
34
  s.source_files = "dummyFile.cpp"
35
35
  s.pod_target_xcconfig = { "USE_HEADERMAP" => "YES",
36
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" }
36
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
37
+ "DEFINES_MODULE" => "YES" }
37
38
 
38
39
  if ENV['USE_FRAMEWORKS']
39
40
  s.header_mappings_dir = './'
@@ -17,7 +17,7 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 72;
20
- int32_t Patch = 9;
20
+ int32_t Patch = 11;
21
21
  std::string_view Prerelease = "";
22
22
  } ReactNativeVersion;
23
23
 
@@ -27,7 +27,10 @@ Pod::Spec.new do |s|
27
27
  s.source = source
28
28
  s.source_files = "**/*.{cpp,h}"
29
29
  s.header_dir = "react/debug"
30
- s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" }
30
+ s.pod_target_xcconfig = {
31
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
32
+ "DEFINES_MODULE" => "YES"
33
+ }
31
34
 
32
35
  if ENV['USE_FRAMEWORKS']
33
36
  s.module_name = "React_debug"
@@ -49,7 +49,11 @@ Pod::Spec.new do |s|
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 = {
53
+ "USE_HEADERMAP" => "NO",
54
+ "HEADER_SEARCH_PATHS" => header_search_paths.join(" "),
55
+ "DEFINES_MODULE" => "YES"
56
+ }
53
57
 
54
58
  s.dependency "glog"
55
59
  s.dependency "RCT-Folly/Fabric", folly_version
@@ -44,7 +44,9 @@ Pod::Spec.new do |s|
44
44
  s.exclude_files = "tests"
45
45
  s.pod_target_xcconfig = {
46
46
  "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
47
- "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')}
47
+ "HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
48
+ "DEFINES_MODULE" => "YES"
49
+ }
48
50
 
49
51
  if ENV['USE_FRAMEWORKS']
50
52
  s.module_name = "React_utils"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.72.9",
3
+ "version": "0.72.11",
4
4
  "bin": "./cli.js",
5
5
  "description": "A framework for building native apps using React",
6
6
  "license": "MIT",
@@ -79,9 +79,9 @@
79
79
  },
80
80
  "dependencies": {
81
81
  "@jest/create-cache-key-function": "^29.2.1",
82
- "@react-native-community/cli": "11.3.10",
83
- "@react-native-community/cli-platform-android": "11.3.10",
84
- "@react-native-community/cli-platform-ios": "11.3.10",
82
+ "@react-native-community/cli": "^11.4.1",
83
+ "@react-native-community/cli-platform-android": "^11.4.1",
84
+ "@react-native-community/cli-platform-ios": "^11.4.1",
85
85
  "@react-native/assets-registry": "^0.72.0",
86
86
  "@react-native/codegen": "^0.72.8",
87
87
  "@react-native/gradle-plugin": "^0.72.11",
@@ -99,8 +99,8 @@
99
99
  "jest-environment-node": "^29.2.1",
100
100
  "jsc-android": "^250231.0.0",
101
101
  "memoize-one": "^5.0.0",
102
- "metro-runtime": "0.76.8",
103
- "metro-source-map": "0.76.8",
102
+ "metro-runtime": "^0.76.9",
103
+ "metro-source-map": "^0.76.9",
104
104
  "mkdirp": "^0.5.1",
105
105
  "nullthrows": "^1.1.1",
106
106
  "pretty-format": "^26.5.2",
@@ -179,11 +179,33 @@ class UtilsTests < Test::Unit::TestCase
179
179
  # ============================ #
180
180
  # Test - Exclude Architectures #
181
181
  # ============================ #
182
- def test_excludeArchitectures_whenHermesEngineIsNotIncluded_excludeNothing
182
+ def test_excludeArchitectures_whenHermesEngineIsNotIncluded_withNoValue_leaveUnset
183
+ # Arrange
184
+ user_project_mock = prepare_empty_user_project_mock()
185
+ pods_projects_mock = PodsProjectMock.new()
186
+ installer = InstallerMock.new(PodsProjectMock.new(), [
187
+ AggregatedProjectMock.new(user_project_mock)
188
+ ])
189
+
190
+ # Act
191
+ ReactNativePodsUtils.exclude_i386_architecture_while_using_hermes(installer)
192
+
193
+ # Assert
194
+ user_project_mock.build_configurations.each do |config|
195
+ assert_equal(config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"], nil)
196
+ end
197
+ assert_equal(user_project_mock.save_invocation_count, 0)
198
+ assert_equal(pods_projects_mock.save_invocation_count, 0)
199
+ end
200
+
201
+ def test_excludeArchitectures_whenHermesEngineIsNotIncluded_withExistingValue_preserveExistingValue
183
202
  # Arrange
184
203
  user_project_mock = prepare_empty_user_project_mock()
204
+ user_project_mock.build_configurations.each do |config|
205
+ config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
206
+ end
185
207
  pods_projects_mock = PodsProjectMock.new()
186
- installer = InstallerMock.new(PodsProjectMock.new(), [
208
+ installer = InstallerMock.new(pods_projects_mock, [
187
209
  AggregatedProjectMock.new(user_project_mock)
188
210
  ])
189
211
 
@@ -192,13 +214,14 @@ class UtilsTests < Test::Unit::TestCase
192
214
 
193
215
  # Assert
194
216
  user_project_mock.build_configurations.each do |config|
195
- assert_equal(config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"], "")
217
+ assert_equal(config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"], "arm64")
196
218
  end
197
- assert_equal(user_project_mock.save_invocation_count, 1)
219
+
220
+ assert_equal(user_project_mock.save_invocation_count, 0)
198
221
  assert_equal(pods_projects_mock.save_invocation_count, 0)
199
222
  end
200
223
 
201
- def test_excludeArchitectures_whenHermesEngineIsIncluded_excludeI386
224
+ def test_excludeArchitectures_whenHermesEngineIsIncluded_withNoValue_onlyExcludeI386
202
225
  # Arrange
203
226
  user_project_mock = prepare_empty_user_project_mock()
204
227
  pods_projects_mock = PodsProjectMock.new([], {"hermes-engine" => {}})
@@ -218,6 +241,29 @@ class UtilsTests < Test::Unit::TestCase
218
241
  assert_equal(pods_projects_mock.save_invocation_count, 1)
219
242
  end
220
243
 
244
+ def test_excludeArchitectures_whenHermesEngineIsIncluded_withExistingValue_appendI386
245
+ # Arrange
246
+ user_project_mock = prepare_empty_user_project_mock()
247
+ user_project_mock.build_configurations.each do |config|
248
+ config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
249
+ end
250
+ pods_projects_mock = PodsProjectMock.new([], {"hermes-engine" => {}})
251
+ installer = InstallerMock.new(pods_projects_mock, [
252
+ AggregatedProjectMock.new(user_project_mock)
253
+ ])
254
+
255
+ # Act
256
+ ReactNativePodsUtils.exclude_i386_architecture_while_using_hermes(installer)
257
+
258
+ # Assert
259
+ user_project_mock.build_configurations.each do |config|
260
+ assert_equal(config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"], "arm64 i386")
261
+ end
262
+
263
+ assert_equal(user_project_mock.save_invocation_count, 1)
264
+ assert_equal(pods_projects_mock.save_invocation_count, 1)
265
+ end
266
+
221
267
  # ================= #
222
268
  # Test - Fix Config #
223
269
  # ================= #
@@ -38,7 +38,7 @@ end
38
38
  module Helpers
39
39
  class Constants
40
40
  def self.min_ios_version_supported
41
- return '13.4'
41
+ return '12.4'
42
42
  end
43
43
  end
44
44
  end
@@ -54,18 +54,28 @@ class ReactNativePodsUtils
54
54
  end
55
55
 
56
56
  def self.exclude_i386_architecture_while_using_hermes(installer)
57
- projects = self.extract_projects(installer)
57
+ is_using_hermes = self.has_pod(installer, 'hermes-engine')
58
58
 
59
- # Hermes does not support `i386` architecture
60
- excluded_archs_default = self.has_pod(installer, 'hermes-engine') ? "i386" : ""
59
+ if is_using_hermes
60
+ key = "EXCLUDED_ARCHS[sdk=iphonesimulator*]"
61
61
 
62
- projects.each do |project|
63
- project.build_configurations.each do |config|
64
- config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = excluded_archs_default
65
- end
62
+ projects = self.extract_projects(installer)
66
63
 
67
- project.save()
68
- end
64
+ projects.each do |project|
65
+ project.build_configurations.each do |config|
66
+ current_setting = config.build_settings[key] || ""
67
+
68
+ excluded_archs_includes_I386 = current_setting.include?("i386")
69
+
70
+ if !excluded_archs_includes_I386
71
+ # Hermes does not support `i386` architecture
72
+ config.build_settings[key] = "#{current_setting} i386".strip
73
+ end
74
+ end
75
+
76
+ project.save()
77
+ end
78
+ end
69
79
  end
70
80
 
71
81
  def self.set_node_modules_user_settings(installer, react_native_path)
@@ -137,7 +147,7 @@ class ReactNativePodsUtils
137
147
 
138
148
  # fix for weak linking
139
149
  self.safe_init(config, other_ld_flags_key)
140
- if self.is_using_xcode15_or_greter(:xcodebuild_manager => xcodebuild_manager)
150
+ if self.is_using_xcode15_0(:xcodebuild_manager => xcodebuild_manager)
141
151
  self.add_value_to_setting_if_missing(config, other_ld_flags_key, xcode15_compatibility_flags)
142
152
  else
143
153
  self.remove_value_from_setting_if_present(config, other_ld_flags_key, xcode15_compatibility_flags)
@@ -321,7 +331,7 @@ class ReactNativePodsUtils
321
331
  end
322
332
  end
323
333
 
324
- def self.is_using_xcode15_or_greter(xcodebuild_manager: Xcodebuild)
334
+ def self.is_using_xcode15_0(xcodebuild_manager: Xcodebuild)
325
335
  xcodebuild_version = xcodebuild_manager.version
326
336
 
327
337
  # The output of xcodebuild -version is something like
@@ -332,7 +342,8 @@ class ReactNativePodsUtils
332
342
  regex = /(\d+)\.(\d+)(?:\.(\d+))?/
333
343
  if match_data = xcodebuild_version.match(regex)
334
344
  major = match_data[1].to_i
335
- return major >= 15
345
+ minor = match_data[2].to_i
346
+ return major == 15 && minor == 0
336
347
  end
337
348
 
338
349
  return false
@@ -52,13 +52,9 @@ function build_host_hermesc {
52
52
 
53
53
  # Utility function to configure an Apple framework
54
54
  function configure_apple_framework {
55
- local build_cli_tools enable_bitcode enable_debugger cmake_build_type xcode_15_flags xcode_major_version
55
+ local build_cli_tools enable_debugger cmake_build_type xcode_15_flags xcode_major_version
56
+
56
57
 
57
- if [[ $1 == iphoneos || $1 == catalyst ]]; then
58
- enable_bitcode="true"
59
- else
60
- enable_bitcode="false"
61
- fi
62
58
  if [[ $1 == macosx ]]; then
63
59
  build_cli_tools="true"
64
60
  else
@@ -94,7 +90,7 @@ function configure_apple_framework {
94
90
  -DHERMES_ENABLE_LIBFUZZER:BOOLEAN=false \
95
91
  -DHERMES_ENABLE_FUZZILLI:BOOLEAN=false \
96
92
  -DHERMES_ENABLE_TEST_SUITE:BOOLEAN=false \
97
- -DHERMES_ENABLE_BITCODE:BOOLEAN="$enable_bitcode" \
93
+ -DHERMES_ENABLE_BITCODE:BOOLEAN=false \
98
94
  -DHERMES_BUILD_APPLE_FRAMEWORK:BOOLEAN=true \
99
95
  -DHERMES_BUILD_APPLE_DSYM:BOOLEAN=true \
100
96
  -DHERMES_ENABLE_TOOLS:BOOLEAN="$build_cli_tools" \
Binary file
Binary file
Binary file
Binary file
package/template/Gemfile CHANGED
@@ -3,5 +3,7 @@ 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.13'
6
+ # Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
7
+ # bound in the template on Cocoapods with next React Native release.
8
+ gem 'cocoapods', '>= 1.13', '< 1.15'
7
9
  gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
@@ -11,21 +11,21 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "18.2.0",
14
- "react-native": "0.72.9"
14
+ "react-native": "0.72.11"
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.11",
21
+ "@react-native/metro-config": "^0.72.12",
22
22
  "@tsconfig/react-native": "^3.0.0",
23
23
  "@types/react": "^18.0.24",
24
24
  "@types/react-test-renderer": "^18.0.0",
25
25
  "babel-jest": "^29.2.1",
26
26
  "eslint": "^8.19.0",
27
27
  "jest": "^29.2.1",
28
- "metro-react-native-babel-preset": "0.76.8",
28
+ "metro-react-native-babel-preset": "^0.76.9",
29
29
  "prettier": "^2.4.1",
30
30
  "react-test-renderer": "18.2.0",
31
31
  "typescript": "4.8.4"