react-native 0.72.13 → 0.72.15

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: 13,
15
+ patch: 15,
16
16
  prerelease: null,
17
17
  };
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(72),
26
- RCTVersionPatch: @(13),
26
+ RCTVersionPatch: @(15),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.72.13
1
+ VERSION_NAME=0.72.15
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  # JVM Versions
@@ -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", 13,
20
+ "patch", 15,
21
21
  "prerelease", null);
22
22
  }
@@ -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 = 13;
20
+ int32_t Patch = 15;
21
21
  std::string_view Prerelease = "";
22
22
  } ReactNativeVersion;
23
23
 
@@ -403,11 +403,13 @@ JSCRuntime::JSCRuntime(JSGlobalContextRef ctx)
403
403
  {
404
404
  #ifndef NDEBUG
405
405
  #ifdef _JSC_HAS_INSPECTABLE
406
+ #if (__OSX_AVAILABLE_STARTING(MAC_NA, IPHONE_16_4))
406
407
  if (__builtin_available(macOS 13.3, iOS 16.4, tvOS 16.4, *)) {
407
408
  JSGlobalContextSetInspectable(ctx_, true);
408
409
  }
409
410
  #endif
410
411
  #endif
412
+ #endif
411
413
  }
412
414
 
413
415
  JSCRuntime::~JSCRuntime() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.72.13",
3
+ "version": "0.72.15",
4
4
  "bin": "./cli.js",
5
5
  "description": "A framework for building native apps using React",
6
6
  "license": "MIT",
@@ -0,0 +1,165 @@
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ #
3
+ # This source code is licensed under the MIT license found in the
4
+ # LICENSE file in the root directory of this source tree.
5
+
6
+ module PrivacyManifestUtils
7
+ def self.add_aggregated_privacy_manifest(installer)
8
+ user_project = get_user_project_from(installer)
9
+ targets = get_application_targets(user_project)
10
+ file_path = get_privacyinfo_file_path(user_project)
11
+
12
+ privacy_info = read_privacyinfo_file(file_path) || {
13
+ "NSPrivacyCollectedDataTypes" => [],
14
+ "NSPrivacyTracking" => false
15
+ }
16
+
17
+ # Get all required reason APIs defined in current pods
18
+ required_reason_apis = get_used_required_reason_apis(installer)
19
+
20
+ # Add the Required Reason APIs from React Native core
21
+ get_core_accessed_apis.each do |accessed_api|
22
+ api_type = accessed_api["NSPrivacyAccessedAPIType"]
23
+ reasons = accessed_api["NSPrivacyAccessedAPITypeReasons"]
24
+ required_reason_apis[api_type] ||= []
25
+ required_reason_apis[api_type] += reasons
26
+ end
27
+
28
+ # Merge the Required Reason APIs from pods with the ones from the existing PrivacyInfo file
29
+ (privacy_info["NSPrivacyAccessedAPITypes"] || []).each do |accessed_api|
30
+ api_type = accessed_api["NSPrivacyAccessedAPIType"]
31
+ reasons = accessed_api["NSPrivacyAccessedAPITypeReasons"]
32
+ # Add reasons from existing PrivacyInfo file to the ones from pods
33
+ required_reason_apis[api_type] ||= []
34
+ required_reason_apis[api_type] += reasons
35
+ end
36
+
37
+ # Update the existing PrivacyInfo file with the new aggregated data
38
+ privacy_info["NSPrivacyAccessedAPITypes"] = required_reason_apis.map { |api_type, reasons|
39
+ {
40
+ "NSPrivacyAccessedAPIType" => api_type,
41
+ "NSPrivacyAccessedAPITypeReasons" => reasons.uniq
42
+ }
43
+ }
44
+
45
+ Xcodeproj::Plist.write_to_path(privacy_info, file_path)
46
+
47
+ targets.each do |target|
48
+ ensure_reference(file_path, user_project, target)
49
+ end
50
+ end
51
+
52
+ def self.get_application_targets(user_project)
53
+ return user_project.targets.filter { |t| t.symbol_type == :application }
54
+ end
55
+
56
+ def self.read_privacyinfo_file(file_path)
57
+ # Maybe add missing default NSPrivacyTracking, NSPrivacyTrackingDomains, NSPrivacyCollectedDataTypes, but this works without those keys
58
+ source_data = nil
59
+ # Try to read an existing PrivacyInfo.xcprivacy file
60
+ begin
61
+ source_data = Xcodeproj::Plist.read_from_path(file_path)
62
+ Pod::UI.puts "[Privacy Manifest Aggregation] Appending aggregated reasons to existing PrivacyInfo.xcprivacy file."
63
+ rescue => e
64
+ Pod::UI.puts "[Privacy Manifest Aggregation] No existing PrivacyInfo.xcprivacy file found, creating a new one."
65
+ end
66
+ return source_data
67
+ end
68
+
69
+ def self.ensure_reference(file_path, user_project, target)
70
+ reference_exists = target.resources_build_phase.files_references.any? { |file_ref| file_ref.path.end_with? "PrivacyInfo.xcprivacy" }
71
+ unless reference_exists
72
+ # We try to find the main group, but if it doesn't exist, we default to adding the file to the project root – both work
73
+ file_root = user_project.root_object.main_group.children.first { |group| group.name == target.name } || user_project
74
+ file_ref = file_root.new_file(file_path)
75
+ build_file = target.resources_build_phase.add_file_reference(file_ref, true)
76
+ end
77
+ end
78
+
79
+ def self.get_privacyinfo_file_path(user_project)
80
+ # We try to find a file we know exists in the project to get the path to the main group directory
81
+ info_plist_path = user_project.files.find { |file_ref| file_ref.name == "Info.plist" }
82
+ if info_plist_path.nil?
83
+ # return path that is sibling to .xcodeproj
84
+ path = user_project.path
85
+ return File.join(File.dirname(path), "PrivacyInfo.xcprivacy")
86
+ end
87
+ return File.join(File.dirname(info_plist_path.real_path),"PrivacyInfo.xcprivacy")
88
+ end
89
+
90
+ def self.get_used_required_reason_apis(installer)
91
+ # A dictionary with keys of type string (NSPrivacyAccessedAPIType) and values of type string[] (NSPrivacyAccessedAPITypeReasons[])
92
+ used_apis = {}
93
+ Pod::UI.puts "[Privacy Manifest Aggregation] Reading .xcprivacy files to aggregate all used Required Reason APIs."
94
+ installer.pod_targets.each do |pod_target|
95
+ # puts pod_target
96
+ pod_target.file_accessors.each do |file_accessor|
97
+ file_accessor.resource_bundles.each do |bundle_name, bundle_files|
98
+ bundle_files.each do |file_path|
99
+ # This needs to be named like that due to apple requirements
100
+ if File.basename(file_path) == 'PrivacyInfo.xcprivacy'
101
+ content = Xcodeproj::Plist.read_from_path(file_path)
102
+ accessed_api_types = content["NSPrivacyAccessedAPITypes"]
103
+ accessed_api_types&.each do |accessed_api|
104
+ api_type = accessed_api["NSPrivacyAccessedAPIType"]
105
+ reasons = accessed_api["NSPrivacyAccessedAPITypeReasons"]
106
+ next unless api_type
107
+ used_apis[api_type] ||= []
108
+ used_apis[api_type] += reasons
109
+ end
110
+ end
111
+ end
112
+ end
113
+ end
114
+ end
115
+ return used_apis
116
+ end
117
+
118
+ def self.get_privacy_manifest_paths_from(user_project)
119
+ privacy_manifests = user_project
120
+ .files
121
+ .select { |p|
122
+ p.path&.end_with?('PrivacyInfo.xcprivacy')
123
+ }
124
+ return privacy_manifests
125
+ end
126
+
127
+ def self.get_core_accessed_apis()
128
+ file_timestamp_accessed_api = {
129
+ "NSPrivacyAccessedAPIType" => "NSPrivacyAccessedAPICategoryFileTimestamp",
130
+ "NSPrivacyAccessedAPITypeReasons" => ["C617.1"],
131
+ }
132
+ user_defaults_accessed_api = {
133
+ "NSPrivacyAccessedAPIType" => "NSPrivacyAccessedAPICategoryUserDefaults",
134
+ "NSPrivacyAccessedAPITypeReasons" => ["CA92.1"],
135
+ }
136
+ boot_time_accessed_api = {
137
+ "NSPrivacyAccessedAPIType" => "NSPrivacyAccessedAPICategorySystemBootTime",
138
+ "NSPrivacyAccessedAPITypeReasons" => ["35F9.1"],
139
+ }
140
+ return [file_timestamp_accessed_api, user_defaults_accessed_api, boot_time_accessed_api]
141
+ end
142
+
143
+
144
+ def self.get_user_project_from(installer)
145
+ user_project = installer.aggregate_targets
146
+ .map{ |t| t.user_project }
147
+ .first
148
+ return user_project
149
+ end
150
+
151
+ def self.add_privacy_manifest_if_needed(installer)
152
+ user_project = get_user_project_from(installer)
153
+ privacy_manifest = self.get_privacy_manifest_paths_from(user_project).first
154
+ if privacy_manifest.nil?
155
+ privacy_manifest = {
156
+ "NSPrivacyCollectedDataTypes" => [],
157
+ "NSPrivacyTracking" => false,
158
+ "NSPrivacyAccessedAPITypes" => get_core_accessed_apis
159
+ }
160
+ path = File.join(user_project.path.parent, "PrivacyInfo.xcprivacy")
161
+ Xcodeproj::Plist.write_to_path(privacy_manifest, path)
162
+ 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/documentation/bundleresources/privacy_manifest_files. Then, you will need to manually add this file to your project in Xcode.".red
163
+ end
164
+ end
165
+ end
@@ -505,44 +505,6 @@ class ReactNativePodsUtils
505
505
  ])
506
506
  end
507
507
 
508
- def self.get_privacy_manifest_paths_from(user_project)
509
- privacy_manifests = user_project
510
- .files
511
- .select { |p|
512
- p.path&.end_with?('PrivacyInfo.xcprivacy')
513
- }
514
- return privacy_manifests
515
- end
516
-
517
- def self.add_privacy_manifest_if_needed(installer)
518
- user_project = installer.aggregate_targets
519
- .map{ |t| t.user_project }
520
- .first
521
- privacy_manifest = self.get_privacy_manifest_paths_from(user_project).first
522
- if privacy_manifest.nil?
523
- file_timestamp_reason = {
524
- "NSPrivacyAccessedAPIType" => "NSPrivacyAccessedAPICategoryFileTimestamp",
525
- "NSPrivacyAccessedAPITypeReasons" => ["C617.1"],
526
- }
527
- user_defaults_reason = {
528
- "NSPrivacyAccessedAPIType" => "NSPrivacyAccessedAPICategoryUserDefaults",
529
- "NSPrivacyAccessedAPITypeReasons" => ["CA92.1"],
530
- }
531
- boot_time_reason = {
532
- "NSPrivacyAccessedAPIType" => "NSPrivacyAccessedAPICategorySystemBootTime",
533
- "NSPrivacyAccessedAPITypeReasons" => ["35F9.1"],
534
- }
535
- privacy_manifest = {
536
- "NSPrivacyCollectedDataTypes" => [],
537
- "NSPrivacyTracking" => false,
538
- "NSPrivacyAccessedAPITypes" => [file_timestamp_reason, user_defaults_reason, boot_time_reason]
539
- }
540
- path = File.join(user_project.path.parent, "PrivacyInfo.xcprivacy")
541
- Xcodeproj::Plist.write_to_path(privacy_manifest, path)
542
- 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
543
- end
544
- end
545
-
546
508
  def self.react_native_pods
547
509
  return [
548
510
  "DoubleConversion",
@@ -16,6 +16,7 @@ require_relative './cocoapods/utils.rb'
16
16
  require_relative './cocoapods/new_architecture.rb'
17
17
  require_relative './cocoapods/local_podspec_patch.rb'
18
18
  require_relative './cocoapods/helpers.rb'
19
+ require_relative './cocoapods/privacy_manifest_utils.rb'
19
20
 
20
21
  $CODEGEN_OUTPUT_DIR = 'build/generated/ios'
21
22
  $CODEGEN_COMPONENT_DIR = 'react/renderer/components'
@@ -74,7 +75,8 @@ def use_react_native! (
74
75
  flipper_configuration: FlipperConfiguration.disabled,
75
76
  app_path: '..',
76
77
  config_file_dir: '',
77
- ios_folder: 'ios'
78
+ ios_folder: 'ios',
79
+ privacy_file_aggregation_enabled: true
78
80
  )
79
81
 
80
82
  # Set the app_path as env variable so the podspecs can access it.
@@ -93,6 +95,7 @@ def use_react_native! (
93
95
  fabric_enabled = fabric_enabled || new_arch_enabled
94
96
  ENV['RCT_FABRIC_ENABLED'] = fabric_enabled ? "1" : "0"
95
97
  ENV['USE_HERMES'] = hermes_enabled ? "1" : "0"
98
+ ENV['RCT_AGGREGATE_PRIVACY_FILES'] = privacy_file_aggregation_enabled ? "1" : "0"
96
99
 
97
100
  prefix = path
98
101
 
@@ -238,6 +241,8 @@ def react_native_post_install(
238
241
  if ReactNativePodsUtils.has_pod(installer, 'Flipper')
239
242
  flipper_post_install(installer)
240
243
  end
244
+
245
+ privacy_file_aggregation_enabled = ENV['RCT_AGGREGATE_PRIVACY_FILES'] == '1'
241
246
 
242
247
  fabric_enabled = ReactNativePodsUtils.has_pod(installer, 'React-Fabric')
243
248
 
@@ -249,7 +254,12 @@ def react_native_post_install(
249
254
  ReactNativePodsUtils.apply_xcode_15_patch(installer)
250
255
  ReactNativePodsUtils.updateIphoneOSDeploymentTarget(installer)
251
256
  ReactNativePodsUtils.fix_flipper_for_xcode_15_3(installer)
252
- ReactNativePodsUtils.add_privacy_manifest_if_needed(installer)
257
+
258
+ if privacy_file_aggregation_enabled
259
+ PrivacyManifestUtils.add_aggregated_privacy_manifest(installer)
260
+ else
261
+ PrivacyManifestUtils.add_privacy_manifest_if_needed(installer)
262
+ end
253
263
 
254
264
  NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer)
255
265
  is_new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == "1"
@@ -1 +1 @@
1
- hermes-2023-08-07-RNv0.72.4-813b2def12bc9df02654b3e3653ae4a68d0572e0
1
+ hermes-2024-04-29-RNv0.72.14-3815fec63d1a6667ca3195160d6e12fee6a0d8d5
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 */,
@@ -242,6 +245,7 @@
242
245
  isa = PBXResourcesBuildPhase;
243
246
  buildActionMask = 2147483647;
244
247
  files = (
248
+ 6132EF182BDFF13200BBE14D /* PrivacyInfo.xcprivacy in Resources */,
245
249
  81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
246
250
  13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
247
251
  );
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "18.2.0",
14
- "react-native": "0.72.13"
14
+ "react-native": "0.72.15"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.20.0",