react-native 0.74.0 → 0.74.1

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 (62) hide show
  1. package/Libraries/AppDelegate/RCTAppDelegate+Protected.h +16 -0
  2. package/Libraries/AppDelegate/RCTAppDelegate.mm +32 -1
  3. package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +1 -0
  4. package/Libraries/Components/Touchable/TouchableBounce.js +1 -0
  5. package/Libraries/Components/Touchable/TouchableOpacity.js +1 -0
  6. package/Libraries/Core/ReactNativeVersion.js +1 -1
  7. package/React/Base/RCTUtils.m +28 -8
  8. package/React/Base/RCTVersion.m +1 -1
  9. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +0 -3
  10. package/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.mm +22 -1
  11. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +5 -1
  12. package/React/Fabric/RCTScheduler.h +2 -0
  13. package/React/Fabric/RCTScheduler.mm +6 -0
  14. package/React/Fabric/RCTSurfacePresenter.mm +5 -0
  15. package/React/Modules/RCTUIManager.m +8 -9
  16. package/React/Views/RCTComponentData.m +14 -1
  17. package/ReactAndroid/api/ReactAndroid.api +1 -2
  18. package/ReactAndroid/gradle.properties +1 -1
  19. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +2 -2
  20. package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java +24 -9
  21. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPoint.kt +15 -0
  22. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +19 -7
  23. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +31 -11
  24. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +7 -3
  25. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +7 -3
  26. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +34 -12
  27. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +7 -3
  28. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  29. package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessCatalystInstance.kt +11 -18
  30. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java +10 -0
  31. package/ReactAndroid/src/main/jni/react/fabric/Binding.cpp +38 -3
  32. package/ReactAndroid/src/main/jni/react/fabric/Binding.h +8 -0
  33. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +43 -15
  34. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +10 -4
  35. package/ReactCommon/ReactCommon.podspec +1 -0
  36. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  37. package/ReactCommon/jsc/JSCRuntime.cpp +2 -0
  38. package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +2 -1
  39. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +13 -5
  40. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +16 -6
  41. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +62 -26
  42. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +8 -4
  43. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +13 -5
  44. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +4 -2
  45. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +16 -6
  46. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +7 -3
  47. package/ReactCommon/react/renderer/mounting/MountingTransaction.cpp +13 -0
  48. package/ReactCommon/react/renderer/mounting/MountingTransaction.h +9 -0
  49. package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +7 -2
  50. package/ReactCommon/react/renderer/scheduler/SchedulerDelegate.h +11 -0
  51. package/package.json +11 -11
  52. package/scripts/cocoapods/privacy_manifest_utils.rb +172 -0
  53. package/scripts/cocoapods/utils.rb +1 -38
  54. package/scripts/react_native_pods.rb +12 -3
  55. package/sdks/.hermesversion +1 -1
  56. package/sdks/hermesc/osx-bin/hermes +0 -0
  57. package/sdks/hermesc/osx-bin/hermesc +0 -0
  58. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  59. package/src/private/featureflags/NativeReactNativeFeatureFlags.js +4 -2
  60. package/src/private/featureflags/ReactNativeFeatureFlags.js +16 -6
  61. package/template/package.json +5 -5
  62. package/third-party-podspecs/RCT-Folly.podspec +1 -0
@@ -44,6 +44,7 @@ class ReactNativePodsUtils
44
44
  def self.set_gcc_preprocessor_definition_for_React_hermes(installer)
45
45
  self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "React-hermes", "Debug")
46
46
  self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "hermes-engine", "Debug")
47
+ self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "React-RuntimeHermes", "Debug")
47
48
  end
48
49
 
49
50
  def self.turn_off_resource_bundle_react_core(installer)
@@ -591,44 +592,6 @@ class ReactNativePodsUtils
591
592
  ReactNativePodsUtils.update_header_paths_if_depends_on(target_installation_result, "React-ImageManager", header_search_paths)
592
593
  end
593
594
 
594
- def self.get_privacy_manifest_paths_from(user_project)
595
- privacy_manifests = user_project
596
- .files
597
- .select { |p|
598
- p.path&.end_with?('PrivacyInfo.xcprivacy')
599
- }
600
- return privacy_manifests
601
- end
602
-
603
- def self.add_privacy_manifest_if_needed(installer)
604
- user_project = installer.aggregate_targets
605
- .map{ |t| t.user_project }
606
- .first
607
- privacy_manifest = self.get_privacy_manifest_paths_from(user_project).first
608
- if privacy_manifest.nil?
609
- file_timestamp_reason = {
610
- "NSPrivacyAccessedAPIType" => "NSPrivacyAccessedAPICategoryFileTimestamp",
611
- "NSPrivacyAccessedAPITypeReasons" => ["C617.1"],
612
- }
613
- user_defaults_reason = {
614
- "NSPrivacyAccessedAPIType" => "NSPrivacyAccessedAPICategoryUserDefaults",
615
- "NSPrivacyAccessedAPITypeReasons" => ["CA92.1"],
616
- }
617
- boot_time_reason = {
618
- "NSPrivacyAccessedAPIType" => "NSPrivacyAccessedAPICategorySystemBootTime",
619
- "NSPrivacyAccessedAPITypeReasons" => ["35F9.1"],
620
- }
621
- privacy_manifest = {
622
- "NSPrivacyCollectedDataTypes" => [],
623
- "NSPrivacyTracking" => false,
624
- "NSPrivacyAccessedAPITypes" => [file_timestamp_reason, user_defaults_reason, boot_time_reason]
625
- }
626
- path = File.join(user_project.path.parent, "PrivacyInfo.xcprivacy")
627
- Xcodeproj::Plist.write_to_path(privacy_manifest, path)
628
- 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
629
- end
630
- end
631
-
632
595
  def self.react_native_pods
633
596
  return [
634
597
  "DoubleConversion",
@@ -16,6 +16,7 @@ require_relative './cocoapods/new_architecture.rb'
16
16
  require_relative './cocoapods/local_podspec_patch.rb'
17
17
  require_relative './cocoapods/runtime.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'
@@ -73,7 +74,8 @@ def use_react_native! (
73
74
  production: false, # deprecated
74
75
  hermes_enabled: ENV['USE_HERMES'] && ENV['USE_HERMES'] == '0' ? false : true,
75
76
  app_path: '..',
76
- config_file_dir: ''
77
+ config_file_dir: '',
78
+ privacy_file_aggregation_enabled: true
77
79
  )
78
80
 
79
81
  # Set the app_path as env variable so the podspecs can access it.
@@ -97,6 +99,7 @@ def use_react_native! (
97
99
 
98
100
  ENV['RCT_FABRIC_ENABLED'] = fabric_enabled ? "1" : "0"
99
101
  ENV['USE_HERMES'] = hermes_enabled ? "1" : "0"
102
+ ENV['RCT_AGGREGATE_PRIVACY_FILES'] = privacy_file_aggregation_enabled ? "1" : "0"
100
103
 
101
104
  prefix = path
102
105
 
@@ -278,6 +281,7 @@ def react_native_post_install(
278
281
 
279
282
  fabric_enabled = ENV['RCT_FABRIC_ENABLED'] == '1'
280
283
  hermes_enabled = ENV['USE_HERMES'] == '1'
284
+ privacy_file_aggregation_enabled = ENV['RCT_AGGREGATE_PRIVACY_FILES'] == '1'
281
285
 
282
286
  if hermes_enabled
283
287
  ReactNativePodsUtils.set_gcc_preprocessor_definition_for_React_hermes(installer)
@@ -288,11 +292,16 @@ def react_native_post_install(
288
292
  ReactNativePodsUtils.set_use_hermes_build_setting(installer, hermes_enabled)
289
293
  ReactNativePodsUtils.set_node_modules_user_settings(installer, react_native_path)
290
294
  ReactNativePodsUtils.set_ccache_compiler_and_linker_build_settings(installer, react_native_path, ccache_enabled)
291
- ReactNativePodsUtils.apply_xcode_15_patch(installer)
295
+ ReactNativePodsUtils.apply_xcode_15_patch(installer)
292
296
  ReactNativePodsUtils.updateOSDeploymentTarget(installer)
293
297
  ReactNativePodsUtils.set_dynamic_frameworks_flags(installer)
294
298
  ReactNativePodsUtils.add_ndebug_flag_to_pods_in_release(installer)
295
- ReactNativePodsUtils.add_privacy_manifest_if_needed(installer)
299
+
300
+ if privacy_file_aggregation_enabled
301
+ PrivacyManifestUtils.add_aggregated_privacy_manifest(installer)
302
+ else
303
+ PrivacyManifestUtils.add_privacy_manifest_if_needed(installer)
304
+ end
296
305
 
297
306
  NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer)
298
307
  NewArchitectureHelper.modify_flags_for_new_architecture(installer, NewArchitectureHelper.new_arch_enabled)
@@ -1 +1 @@
1
- hermes-2024-02-20-RNv0.74.0-999cfd9979b5f57b1269119679ab8cdf60897de9
1
+ hermes-2024-04-25-RNv0.74.1-b54a3a01c531f4f5f1904cb0770033e8b7153dff
Binary file
Binary file
Binary file
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<8509d5ee87efb5aa8da7efcd2085d0a2>>
7
+ * @generated SignedSource<<8f82962343a5146622f36c2de071ff6a>>
8
8
  * @flow strict-local
9
9
  */
10
10
 
@@ -24,10 +24,12 @@ import * as TurboModuleRegistry from '../../../Libraries/TurboModule/TurboModule
24
24
 
25
25
  export interface Spec extends TurboModule {
26
26
  +commonTestFlag?: () => boolean;
27
+ +androidEnablePendingFabricTransactions?: () => boolean;
28
+ +batchRenderingUpdatesInEventLoop?: () => boolean;
29
+ +destroyFabricSurfacesInReactInstanceManager?: () => boolean;
27
30
  +enableBackgroundExecutor?: () => boolean;
28
31
  +useModernRuntimeScheduler?: () => boolean;
29
32
  +enableMicrotasks?: () => boolean;
30
- +batchRenderingUpdatesInEventLoop?: () => boolean;
31
33
  +enableSpannableBuildingUnification?: () => boolean;
32
34
  +enableCustomDrawOrderFabric?: () => boolean;
33
35
  +enableFixForClippedSubviewsCrash?: () => boolean;
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<7c83d5613c3be517efe48378e6356e79>>
7
+ * @generated SignedSource<<b7ebc6e4360a4b7733335f283300a4bb>>
8
8
  * @flow strict-local
9
9
  */
10
10
 
@@ -41,10 +41,12 @@ export type ReactNativeFeatureFlagsJsOnlyOverrides = Partial<ReactNativeFeatureF
41
41
  export type ReactNativeFeatureFlags = {
42
42
  ...ReactNativeFeatureFlagsJsOnly,
43
43
  commonTestFlag: Getter<boolean>,
44
+ androidEnablePendingFabricTransactions: Getter<boolean>,
45
+ batchRenderingUpdatesInEventLoop: Getter<boolean>,
46
+ destroyFabricSurfacesInReactInstanceManager: Getter<boolean>,
44
47
  enableBackgroundExecutor: Getter<boolean>,
45
48
  useModernRuntimeScheduler: Getter<boolean>,
46
49
  enableMicrotasks: Getter<boolean>,
47
- batchRenderingUpdatesInEventLoop: Getter<boolean>,
48
50
  enableSpannableBuildingUnification: Getter<boolean>,
49
51
  enableCustomDrawOrderFabric: Getter<boolean>,
50
52
  enableFixForClippedSubviewsCrash: Getter<boolean>,
@@ -96,6 +98,18 @@ export const shouldUseRemoveClippedSubviewsAsDefaultOnIOS: Getter<boolean> = cre
96
98
  * Common flag for testing. Do NOT modify.
97
99
  */
98
100
  export const commonTestFlag: Getter<boolean> = createNativeFlagGetter('commonTestFlag', false);
101
+ /**
102
+ * To be used with batchRenderingUpdatesInEventLoop. When enbled, the Android mounting layer will concatenate pending transactions to ensure they're applied atomatically
103
+ */
104
+ export const androidEnablePendingFabricTransactions: Getter<boolean> = createNativeFlagGetter('androidEnablePendingFabricTransactions', false);
105
+ /**
106
+ * When enabled, the RuntimeScheduler processing the event loop will batch all rendering updates and dispatch them together at the end of each iteration of the loop.
107
+ */
108
+ export const batchRenderingUpdatesInEventLoop: Getter<boolean> = createNativeFlagGetter('batchRenderingUpdatesInEventLoop', false);
109
+ /**
110
+ * When enabled, ReactInstanceManager will clean up Fabric surfaces on destroy().
111
+ */
112
+ export const destroyFabricSurfacesInReactInstanceManager: Getter<boolean> = createNativeFlagGetter('destroyFabricSurfacesInReactInstanceManager', false);
99
113
  /**
100
114
  * Enables the use of a background executor to compute layout and commit updates on Fabric (this system is deprecated and should not be used).
101
115
  */
@@ -108,10 +122,6 @@ export const useModernRuntimeScheduler: Getter<boolean> = createNativeFlagGetter
108
122
  * Enables the use of microtasks in Hermes (scheduling) and RuntimeScheduler (execution).
109
123
  */
110
124
  export const enableMicrotasks: Getter<boolean> = createNativeFlagGetter('enableMicrotasks', false);
111
- /**
112
- * When enabled, the RuntimeScheduler processing the event loop will batch all rendering updates and dispatch them together at the end of each iteration of the loop.
113
- */
114
- export const batchRenderingUpdatesInEventLoop: Getter<boolean> = createNativeFlagGetter('batchRenderingUpdatesInEventLoop', false);
115
125
  /**
116
126
  * Uses new, deduplicated logic for constructing Android Spannables from text fragments
117
127
  */
@@ -11,16 +11,16 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "18.2.0",
14
- "react-native": "0.74.0"
14
+ "react-native": "0.74.1"
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
- "@react-native/babel-preset": "0.74.81",
21
- "@react-native/eslint-config": "0.74.81",
22
- "@react-native/metro-config": "0.74.81",
23
- "@react-native/typescript-config": "0.74.81",
20
+ "@react-native/babel-preset": "0.74.83",
21
+ "@react-native/eslint-config": "0.74.83",
22
+ "@react-native/metro-config": "0.74.83",
23
+ "@react-native/typescript-config": "0.74.83",
24
24
  "@types/react": "^18.2.6",
25
25
  "@types/react-test-renderer": "^18.0.0",
26
26
  "babel-jest": "^29.6.3",
@@ -81,6 +81,7 @@ Pod::Spec.new do |spec|
81
81
  'folly/system/*.h',
82
82
  spec.libraries = "c++abi" # NOTE Apple-only: Keep c++abi here due to https://github.com/react-native-community/releases/issues/251
83
83
  spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
84
+ "DEFINES_MODULE" => "YES",
84
85
  "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
85
86
  "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\"",
86
87
  # In dynamic framework (use_frameworks!) mode, ignore the unused and undefined boost symbols when generating the library.