react-native 0.73.6 → 0.73.8

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: 73,
15
- patch: 6,
15
+ patch: 8,
16
16
  prerelease: null,
17
17
  };
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(73),
26
- RCTVersionPatch: @(6),
26
+ RCTVersionPatch: @(8),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.73.6
1
+ VERSION_NAME=0.73.8
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
@@ -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", 73,
20
- "patch", 6,
20
+ "patch", 8,
21
21
  "prerelease", null);
22
22
  }
@@ -177,7 +177,7 @@ public class UIImplementation {
177
177
  *
178
178
  * @return The num of root view
179
179
  */
180
- private int getRootViewNum() {
180
+ public int getRootViewNum() {
181
181
  return mOperationsQueue.getNativeViewHierarchyManager().getRootViewNum();
182
182
  }
183
183
 
@@ -610,12 +610,6 @@ public class UIImplementation {
610
610
 
611
611
  /** Invoked at the end of the transaction to commit any updates to the node hierarchy. */
612
612
  public void dispatchViewUpdates(int batchId) {
613
- if (getRootViewNum() <= 0) {
614
- // If there are no RootViews registered, there will be no View updates to dispatch.
615
- // This is a hack to prevent this from being called when Fabric is used everywhere.
616
- // This should no longer be necessary in Bridgeless Mode.
617
- return;
618
- }
619
613
  SystraceMessage.beginSection(
620
614
  Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "UIImplementation.dispatchViewUpdates")
621
615
  .arg("batchId", batchId)
@@ -719,7 +719,12 @@ public class UIManagerModule extends ReactContextBaseJavaModule
719
719
  listener.willDispatchViewUpdates(this);
720
720
  }
721
721
  try {
722
- mUIImplementation.dispatchViewUpdates(batchId);
722
+ // If there are no RootViews registered, there will be no View updates to dispatch.
723
+ // This is a hack to prevent this from being called when Fabric is used everywhere.
724
+ // This should no longer be necessary in Bridgeless Mode.
725
+ if (mUIImplementation.getRootViewNum() > 0) {
726
+ mUIImplementation.dispatchViewUpdates(batchId);
727
+ }
723
728
  } finally {
724
729
  Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
725
730
  }
@@ -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++) {
@@ -807,7 +807,7 @@ public class ReactHorizontalScrollView extends HorizontalScrollView
807
807
  // more information.
808
808
 
809
809
  if (!mScroller.isFinished() && mScroller.getCurrX() != mScroller.getFinalX()) {
810
- int scrollRange = computeHorizontalScrollRange() - getWidth();
810
+ int scrollRange = Math.max(computeHorizontalScrollRange() - getWidth(), 0);
811
811
  if (scrollX >= scrollRange) {
812
812
  mScroller.abortAnimation();
813
813
  scrollX = scrollRange;
@@ -418,10 +418,10 @@ public class ReactViewGroup extends ViewGroup
418
418
  if (!intersects && child.getParent() != null && !isAnimating) {
419
419
  // We can try saving on invalidate call here as the view that we remove is out of visible area
420
420
  // therefore invalidation is not necessary.
421
- super.removeViewsInLayout(idx - clippedSoFar, 1);
421
+ removeViewsInLayout(idx - clippedSoFar, 1);
422
422
  needUpdateClippingRecursive = true;
423
423
  } else if (intersects && child.getParent() == null) {
424
- super.addViewInLayout(child, idx - clippedSoFar, sDefaultLayoutParam, true);
424
+ addViewInLayout(child, idx - clippedSoFar, sDefaultLayoutParam, true);
425
425
  invalidate();
426
426
  needUpdateClippingRecursive = true;
427
427
  } else if (intersects) {
@@ -499,23 +499,18 @@ public class ReactViewGroup extends ViewGroup
499
499
  return ViewUtil.getUIManagerType(getId()) == UIManagerType.FABRIC;
500
500
  }
501
501
 
502
- @Override
503
- public void addView(View child, int index, ViewGroup.LayoutParams params) {
504
- // This will get called for every overload of addView so there is not need to override every
505
- // method.
502
+ private void handleAddView(View view) {
503
+ UiThreadUtil.assertOnUiThread();
506
504
 
507
505
  if (!customDrawOrderDisabled()) {
508
- getDrawingOrderHelper().handleAddView(child);
506
+ getDrawingOrderHelper().handleAddView(view);
509
507
  setChildrenDrawingOrderEnabled(getDrawingOrderHelper().shouldEnableCustomDrawingOrder());
510
508
  } else {
511
509
  setChildrenDrawingOrderEnabled(false);
512
510
  }
513
-
514
- super.addView(child, index, params);
515
511
  }
516
512
 
517
- @Override
518
- public void removeView(View view) {
513
+ private void handleRemoveView(View view) {
519
514
  UiThreadUtil.assertOnUiThread();
520
515
 
521
516
  if (!customDrawOrderDisabled()) {
@@ -524,22 +519,60 @@ public class ReactViewGroup extends ViewGroup
524
519
  } else {
525
520
  setChildrenDrawingOrderEnabled(false);
526
521
  }
522
+ }
523
+
524
+ private void handleRemoveViews(int start, int count) {
525
+ int endIndex = start + count;
526
+ for (int index = start; index < endIndex; index++) {
527
+ if (index < getChildCount()) {
528
+ handleRemoveView(getChildAt(index));
529
+ }
530
+ }
531
+ }
532
+
533
+ @Override
534
+ public void addView(View child, int index, ViewGroup.LayoutParams params) {
535
+ // This will get called for every overload of addView so there is not need to override every
536
+ // method.
537
+ handleAddView(child);
538
+ super.addView(child, index, params);
539
+ }
527
540
 
541
+ @Override
542
+ protected boolean addViewInLayout(
543
+ View child, int index, LayoutParams params, boolean preventRequestLayout) {
544
+ handleAddView(child);
545
+ return super.addViewInLayout(child, index, params, preventRequestLayout);
546
+ }
547
+
548
+ @Override
549
+ public void removeView(View view) {
550
+ handleRemoveView(view);
528
551
  super.removeView(view);
529
552
  }
530
553
 
531
554
  @Override
532
555
  public void removeViewAt(int index) {
533
- UiThreadUtil.assertOnUiThread();
556
+ handleRemoveView(getChildAt(index));
557
+ super.removeViewAt(index);
558
+ }
534
559
 
535
- if (!customDrawOrderDisabled()) {
536
- getDrawingOrderHelper().handleRemoveView(getChildAt(index));
537
- setChildrenDrawingOrderEnabled(getDrawingOrderHelper().shouldEnableCustomDrawingOrder());
538
- } else {
539
- setChildrenDrawingOrderEnabled(false);
540
- }
560
+ @Override
561
+ public void removeViewInLayout(View view) {
562
+ handleRemoveView(view);
563
+ super.removeViewInLayout(view);
564
+ }
541
565
 
542
- super.removeViewAt(index);
566
+ @Override
567
+ public void removeViewsInLayout(int start, int count) {
568
+ handleRemoveViews(start, count);
569
+ super.removeViewsInLayout(start, count);
570
+ }
571
+
572
+ @Override
573
+ public void removeViews(int start, int count) {
574
+ handleRemoveViews(start, count);
575
+ super.removeViews(start, count);
543
576
  }
544
577
 
545
578
  @Override
@@ -663,7 +696,7 @@ public class ReactViewGroup extends ViewGroup
663
696
  clippedSoFar++;
664
697
  }
665
698
  }
666
- super.removeViewsInLayout(index - clippedSoFar, 1);
699
+ removeViewsInLayout(index - clippedSoFar, 1);
667
700
  }
668
701
  removeFromArray(index);
669
702
  }
@@ -17,7 +17,7 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 73;
20
- int32_t Patch = 6;
20
+ int32_t Patch = 8;
21
21
  std::string_view Prerelease = "";
22
22
  } ReactNativeVersion;
23
23
 
@@ -369,11 +369,13 @@ JSCRuntime::JSCRuntime(JSGlobalContextRef ctx)
369
369
  {
370
370
  #ifndef NDEBUG
371
371
  #ifdef _JSC_HAS_INSPECTABLE
372
+ #if (__OSX_AVAILABLE_STARTING(MAC_NA, IPHONE_16_4))
372
373
  if (__builtin_available(macOS 13.3, iOS 16.4, tvOS 16.4, *)) {
373
374
  JSGlobalContextSetInspectable(ctx_, true);
374
375
  }
375
376
  #endif
376
377
  #endif
378
+ #endif
377
379
  }
378
380
 
379
381
  JSCRuntime::~JSCRuntime() {
@@ -50,6 +50,7 @@ Pod::Spec.new do |s|
50
50
  s.dependency "React-jsi"
51
51
 
52
52
  if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
53
+ s.dependency "React-hermes"
53
54
  s.dependency "hermes-engine"
54
55
  else
55
56
  s.dependency "React-jsc"
@@ -32,7 +32,10 @@ Pod::Spec.new do |spec|
32
32
  spec.requires_arc = false
33
33
  spec.pod_target_xcconfig = {
34
34
  'DEFINES_MODULE' => 'YES'
35
- }
35
+ }.merge!(ENV['USE_FRAMEWORKS'] != nil ? {
36
+ 'HEADER_SEARCH_PATHS' => '"$(PODS_TARGET_SRCROOT)"'
37
+ } : {})
38
+
36
39
  spec.compiler_flags = [
37
40
  '-fno-omit-frame-pointer',
38
41
  '-fexceptions',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.73.6",
3
+ "version": "0.73.8",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -45,6 +45,7 @@ class ReactNativePodsUtils
45
45
  def self.set_gcc_preprocessor_definition_for_React_hermes(installer)
46
46
  self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "React-hermes", "Debug")
47
47
  self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "hermes-engine", "Debug")
48
+ self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "React-RuntimeHermes", "Debug")
48
49
  end
49
50
 
50
51
  def self.turn_off_resource_bundle_react_core(installer)
@@ -209,7 +210,7 @@ class ReactNativePodsUtils
209
210
  installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
210
211
  if pod_name.to_s == target_pod_name
211
212
  target_installation_result.native_target.build_configurations.each do |config|
212
- if configuration == nil || (configuration != nil && configuration == config.name)
213
+ if configuration == nil || (configuration != nil && config.name.include?(configuration))
213
214
  config.build_settings[settings_name] ||= '$(inherited) '
214
215
  config.build_settings[settings_name] << settings_value
215
216
  end
@@ -560,6 +561,44 @@ class ReactNativePodsUtils
560
561
  ReactNativePodsUtils.update_header_paths_if_depends_on(target_installation_result, "React-ImageManager", header_search_paths)
561
562
  end
562
563
 
564
+ def self.get_privacy_manifest_paths_from(user_project)
565
+ privacy_manifests = user_project
566
+ .files
567
+ .select { |p|
568
+ p.path&.end_with?('PrivacyInfo.xcprivacy')
569
+ }
570
+ return privacy_manifests
571
+ end
572
+
573
+ def self.add_privacy_manifest_if_needed(installer)
574
+ user_project = installer.aggregate_targets
575
+ .map{ |t| t.user_project }
576
+ .first
577
+ privacy_manifest = self.get_privacy_manifest_paths_from(user_project).first
578
+ if privacy_manifest.nil?
579
+ file_timestamp_reason = {
580
+ "NSPrivacyAccessedAPIType" => "NSPrivacyAccessedAPICategoryFileTimestamp",
581
+ "NSPrivacyAccessedAPITypeReasons" => ["C617.1"],
582
+ }
583
+ user_defaults_reason = {
584
+ "NSPrivacyAccessedAPIType" => "NSPrivacyAccessedAPICategoryUserDefaults",
585
+ "NSPrivacyAccessedAPITypeReasons" => ["CA92.1"],
586
+ }
587
+ boot_time_reason = {
588
+ "NSPrivacyAccessedAPIType" => "NSPrivacyAccessedAPICategorySystemBootTime",
589
+ "NSPrivacyAccessedAPITypeReasons" => ["35F9.1"],
590
+ }
591
+ privacy_manifest = {
592
+ "NSPrivacyCollectedDataTypes" => [],
593
+ "NSPrivacyTracking" => false,
594
+ "NSPrivacyAccessedAPITypes" => [file_timestamp_reason, user_defaults_reason, boot_time_reason]
595
+ }
596
+ path = File.join(user_project.path.parent, "PrivacyInfo.xcprivacy")
597
+ Xcodeproj::Plist.write_to_path(privacy_manifest, path)
598
+ Pod::UI.puts "Your app does not have a privacy manifest! A template has been generated containing Required Reasons API usage in the core React Native library. Please add the PrivacyInfo.xcprivacy file to your project and complete data use, tracking and any additional required reasons your app is using according to Apple's guidance: https://developer.apple.com/.../privacy_manifest_files. Then, you will need to manually add this file to your project in Xcode.".red
599
+ end
600
+ end
601
+
563
602
  def self.react_native_pods
564
603
  return [
565
604
  "DoubleConversion",
@@ -309,6 +309,7 @@ def react_native_post_install(
309
309
  ReactNativePodsUtils.apply_xcode_15_patch(installer)
310
310
  ReactNativePodsUtils.updateOSDeploymentTarget(installer)
311
311
  ReactNativePodsUtils.fix_flipper_for_xcode_15_3(installer)
312
+ ReactNativePodsUtils.add_privacy_manifest_if_needed(installer)
312
313
 
313
314
  NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer)
314
315
  NewArchitectureHelper.modify_flags_for_new_architecture(installer, NewArchitectureHelper.new_arch_enabled)
@@ -1 +1 @@
1
- hermes-2024-02-20-RNv0.73.5-18f99ace4213052c5e7cdbcd39ee9766cd5df7e4
1
+ hermes-2024-04-29-RNv0.73.8-644c8be78af1eae7c138fa4093fb87f0f4f8db85
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,38 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>NSPrivacyCollectedDataTypes</key>
6
+ <array>
7
+ </array>
8
+ <key>NSPrivacyAccessedAPITypes</key>
9
+ <array>
10
+ <dict>
11
+ <key>NSPrivacyAccessedAPIType</key>
12
+ <string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
13
+ <key>NSPrivacyAccessedAPITypeReasons</key>
14
+ <array>
15
+ <string>C617.1</string>
16
+ </array>
17
+ </dict>
18
+ <dict>
19
+ <key>NSPrivacyAccessedAPIType</key>
20
+ <string>NSPrivacyAccessedAPICategoryUserDefaults</string>
21
+ <key>NSPrivacyAccessedAPITypeReasons</key>
22
+ <array>
23
+ <string>CA92.1</string>
24
+ </array>
25
+ </dict>
26
+ <dict>
27
+ <key>NSPrivacyAccessedAPIType</key>
28
+ <string>NSPrivacyAccessedAPICategorySystemBootTime</string>
29
+ <key>NSPrivacyAccessedAPITypeReasons</key>
30
+ <array>
31
+ <string>35F9.1</string>
32
+ </array>
33
+ </dict>
34
+ </array>
35
+ <key>NSPrivacyTracking</key>
36
+ <false/>
37
+ </dict>
38
+ </plist>
@@ -12,6 +12,7 @@
12
12
  13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
13
13
  13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
14
14
  13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
15
+ 6132EF182BDFF13200BBE14D /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 6132EF172BDFF13200BBE14D /* PrivacyInfo.xcprivacy */; };
15
16
  7699B88040F8A987B510C191 /* libPods-HelloWorld-HelloWorldTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-HelloWorld-HelloWorldTests.a */; };
16
17
  81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
17
18
  /* End PBXBuildFile section */
@@ -41,6 +42,7 @@
41
42
  5709B34CF0A7D63546082F79 /* Pods-HelloWorld.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.release.xcconfig"; path = "Target Support Files/Pods-HelloWorld/Pods-HelloWorld.release.xcconfig"; sourceTree = "<group>"; };
42
43
  5B7EB9410499542E8C5724F5 /* Pods-HelloWorld-HelloWorldTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld-HelloWorldTests.debug.xcconfig"; path = "Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests.debug.xcconfig"; sourceTree = "<group>"; };
43
44
  5DCACB8F33CDC322A6C60F78 /* libPods-HelloWorld.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HelloWorld.a"; sourceTree = BUILT_PRODUCTS_DIR; };
45
+ 6132EF172BDFF13200BBE14D /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = HelloWorld/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
44
46
  81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = HelloWorld/LaunchScreen.storyboard; sourceTree = "<group>"; };
45
47
  89C6BE57DB24E9ADA2F236DE /* Pods-HelloWorld-HelloWorldTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld-HelloWorldTests.release.xcconfig"; path = "Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests.release.xcconfig"; sourceTree = "<group>"; };
46
48
  ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
@@ -116,6 +118,7 @@
116
118
  83CBB9F61A601CBA00E9B192 = {
117
119
  isa = PBXGroup;
118
120
  children = (
121
+ 6132EF172BDFF13200BBE14D /* PrivacyInfo.xcprivacy */,
119
122
  13B07FAE1A68108700A75B9A /* HelloWorld */,
120
123
  832341AE1AAA6A7D00B99B32 /* Libraries */,
121
124
  00E356EF1AD99517003FC87E /* HelloWorldTests */,
@@ -241,6 +244,7 @@
241
244
  isa = PBXResourcesBuildPhase;
242
245
  buildActionMask = 2147483647;
243
246
  files = (
247
+ 6132EF182BDFF13200BBE14D /* PrivacyInfo.xcprivacy in Resources */,
244
248
  81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
245
249
  13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
246
250
  );
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "18.2.0",
14
- "react-native": "0.73.6"
14
+ "react-native": "0.73.8"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.20.0",