react-native 0.82.0-rc.1 → 0.82.0-rc.3

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 (56) hide show
  1. package/Libraries/Core/ReactNativeVersion.js +1 -1
  2. package/React/Base/RCTVersion.m +1 -1
  3. package/React/FBReactNativeSpec/FBReactNativeSpecJSI-generated.cpp +12 -0
  4. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +18 -0
  5. package/ReactAndroid/gradle.properties +1 -2
  6. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +7 -1
  7. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +11 -1
  8. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +3 -1
  9. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +3 -1
  10. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +12 -1
  11. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Canary_Android.kt +3 -1
  12. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +3 -1
  13. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  14. package/ReactAndroid/src/main/jni/CMakeLists.txt +3 -0
  15. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +15 -1
  16. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +4 -1
  17. package/ReactAndroid/src/main/jni/react/hermes/reactexecutor/CMakeLists.txt +1 -1
  18. package/ReactAndroid/src/main/jni/react/runtime/hermes/jni/CMakeLists.txt +1 -1
  19. package/ReactAndroid/src/main/jni/react/runtime/jni/CMakeLists.txt +1 -1
  20. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  21. package/ReactCommon/hermes/executor/CMakeLists.txt +1 -1
  22. package/ReactCommon/hermes/inspector-modern/CMakeLists.txt +1 -1
  23. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +5 -1
  24. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +6 -1
  25. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +44 -26
  26. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +4 -2
  27. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +5 -1
  28. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +10 -1
  29. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSCanary.h +5 -1
  30. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +2 -1
  31. package/ReactCommon/react/nativemodule/defaults/CMakeLists.txt +1 -0
  32. package/ReactCommon/react/nativemodule/defaults/DefaultTurboModules.cpp +8 -0
  33. package/ReactCommon/react/nativemodule/defaults/React-defaultsnativemodule.podspec +1 -0
  34. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +6 -1
  35. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +3 -1
  36. package/ReactCommon/react/nativemodule/webperformance/CMakeLists.txt +1 -1
  37. package/ReactCommon/react/nativemodule/webperformance/NativePerformance.cpp +9 -9
  38. package/ReactCommon/react/nativemodule/webperformance/NativePerformance.h +3 -0
  39. package/ReactCommon/react/nativemodule/webperformance/React-webperformancenativemodule.podspec +58 -0
  40. package/ReactCommon/react/runtime/CMakeLists.txt +1 -1
  41. package/ReactCommon/react/runtime/hermes/CMakeLists.txt +1 -1
  42. package/ReactCommon/react/timing/primitives.h +12 -0
  43. package/flow/bom.js.flow +4 -4
  44. package/package.json +9 -8
  45. package/scripts/codegen/generate-artifacts-executor/index.js +0 -5
  46. package/scripts/react_native_pods.rb +1 -0
  47. package/sdks/hermes-engine/hermes-engine.podspec +6 -1
  48. package/sdks/hermes-engine/version.properties +1 -0
  49. package/sdks/hermesc/osx-bin/hermes +0 -0
  50. package/sdks/hermesc/osx-bin/hermesc +0 -0
  51. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  52. package/src/private/featureflags/ReactNativeFeatureFlags.js +6 -1
  53. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -1
  54. package/src/private/webapis/performance/Performance.js +26 -7
  55. package/src/private/webapis/performance/ReactNativeStartupTiming.js +3 -24
  56. package/src/private/webapis/performance/specs/NativePerformance.js +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.82.0-rc.1",
3
+ "version": "0.82.0-rc.3",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -162,13 +162,13 @@
162
162
  },
163
163
  "dependencies": {
164
164
  "@jest/create-cache-key-function": "^29.7.0",
165
- "@react-native/assets-registry": "0.82.0-rc.1",
166
- "@react-native/codegen": "0.82.0-rc.1",
167
- "@react-native/community-cli-plugin": "0.82.0-rc.1",
168
- "@react-native/gradle-plugin": "0.82.0-rc.1",
169
- "@react-native/js-polyfills": "0.82.0-rc.1",
170
- "@react-native/normalize-colors": "0.82.0-rc.1",
171
- "@react-native/virtualized-lists": "0.82.0-rc.1",
165
+ "@react-native/assets-registry": "0.82.0-rc.3",
166
+ "@react-native/codegen": "0.82.0-rc.3",
167
+ "@react-native/community-cli-plugin": "0.82.0-rc.3",
168
+ "@react-native/gradle-plugin": "0.82.0-rc.3",
169
+ "@react-native/js-polyfills": "0.82.0-rc.3",
170
+ "@react-native/normalize-colors": "0.82.0-rc.3",
171
+ "@react-native/virtualized-lists": "0.82.0-rc.3",
172
172
  "abort-controller": "^3.0.0",
173
173
  "anser": "^1.4.9",
174
174
  "ansi-regex": "^5.0.0",
@@ -178,6 +178,7 @@
178
178
  "commander": "^12.0.0",
179
179
  "flow-enums-runtime": "^0.0.6",
180
180
  "glob": "^7.1.1",
181
+ "hermes-compiler": "0.0.0",
181
182
  "invariant": "^2.2.4",
182
183
  "jest-environment-node": "^29.7.0",
183
184
  "memoize-one": "^5.0.0",
@@ -99,7 +99,6 @@ function execute(
99
99
 
100
100
  if (codegenEnabledLibraries.length === 0) {
101
101
  codegenLog('No codegen-enabled libraries found.', true);
102
- return;
103
102
  }
104
103
 
105
104
  let platforms =
@@ -114,10 +113,6 @@ function execute(
114
113
  ({name}) => !disabledLibraries.includes(name),
115
114
  );
116
115
 
117
- if (!libraries.length) {
118
- continue;
119
- }
120
-
121
116
  const outputPath = computeOutputPath(
122
117
  projectRoot,
123
118
  baseOutputPath,
@@ -142,6 +142,7 @@ def use_react_native! (
142
142
  pod 'React-featureflagsnativemodule', :path => "#{prefix}/ReactCommon/react/nativemodule/featureflags"
143
143
  pod 'React-microtasksnativemodule', :path => "#{prefix}/ReactCommon/react/nativemodule/microtasks"
144
144
  pod 'React-idlecallbacksnativemodule', :path => "#{prefix}/ReactCommon/react/nativemodule/idlecallbacks"
145
+ pod 'React-webperformancenativemodule', :path => "#{prefix}/ReactCommon/react/nativemodule/webperformance"
145
146
  pod 'React-domnativemodule', :path => "#{prefix}/ReactCommon/react/nativemodule/dom"
146
147
  pod 'React-defaultsnativemodule', :path => "#{prefix}/ReactCommon/react/nativemodule/defaults"
147
148
  pod 'React-Mapbuffer', :path => "#{prefix}/ReactCommon"
@@ -20,9 +20,14 @@ end
20
20
 
21
21
  # package.json
22
22
  package = JSON.parse(File.read(File.join(react_native_path, "package.json")))
23
- # TODO: T231755000 use the Hermes V1 version instead of React Native version
23
+ # TODO: T231755000 read hermes version from version.properties when consuming hermes
24
24
  version = package['version']
25
25
 
26
+ if ENV['RCT_HERMES_V1_ENABLED'] == "1"
27
+ versionProperties = Hash[*File.read("version.properties").split(/[=\n]+/)]
28
+ version = versionProperties['HERMES_V1_VERSION_NAME']
29
+ end
30
+
26
31
  source_type = hermes_source_type(version, react_native_path)
27
32
  source = podspec_source(source_type, version, react_native_path)
28
33
 
@@ -0,0 +1 @@
1
+ HERMES_V1_VERSION_NAME=250829098.0.0
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<<85a053d6a79240a7b4e181d3054ecfd3>>
7
+ * @generated SignedSource<<5ba27aa5af4c69dedd733ca5ccb09fe3>>
8
8
  * @flow strict
9
9
  * @noformat
10
10
  */
@@ -93,6 +93,7 @@ export type ReactNativeFeatureFlags = $ReadOnly<{
93
93
  enableVirtualViewDebugFeatures: Getter<boolean>,
94
94
  enableVirtualViewRenderState: Getter<boolean>,
95
95
  enableVirtualViewWindowFocusDetection: Getter<boolean>,
96
+ enableWebPerformanceAPIsByDefault: Getter<boolean>,
96
97
  fixMappingOfEventPrioritiesBetweenFabricAndReact: Getter<boolean>,
97
98
  fuseboxEnabledRelease: Getter<boolean>,
98
99
  fuseboxNetworkInspectionEnabled: Getter<boolean>,
@@ -370,6 +371,10 @@ export const enableVirtualViewRenderState: Getter<boolean> = createNativeFlagGet
370
371
  * Enables window focus detection for prioritizing VirtualView events.
371
372
  */
372
373
  export const enableVirtualViewWindowFocusDetection: Getter<boolean> = createNativeFlagGetter('enableVirtualViewWindowFocusDetection', false);
374
+ /**
375
+ * Enable Web Performance APIs (Performance Timeline, User Timings, etc.) by default.
376
+ */
377
+ export const enableWebPerformanceAPIsByDefault: Getter<boolean> = createNativeFlagGetter('enableWebPerformanceAPIsByDefault', false);
373
378
  /**
374
379
  * Uses the default event priority instead of the discreet event priority by default when dispatching events from Fabric to React.
375
380
  */
@@ -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<<da22f4c43e3bdcd999e3dd1dd5896c63>>
7
+ * @generated SignedSource<<9feb9fa0298078e66d362b41d21db655>>
8
8
  * @flow strict
9
9
  * @noformat
10
10
  */
@@ -69,6 +69,7 @@ export interface Spec extends TurboModule {
69
69
  +enableVirtualViewDebugFeatures?: () => boolean;
70
70
  +enableVirtualViewRenderState?: () => boolean;
71
71
  +enableVirtualViewWindowFocusDetection?: () => boolean;
72
+ +enableWebPerformanceAPIsByDefault?: () => boolean;
72
73
  +fixMappingOfEventPrioritiesBetweenFabricAndReact?: () => boolean;
73
74
  +fuseboxEnabledRelease?: () => boolean;
74
75
  +fuseboxNetworkInspectionEnabled?: () => boolean;
@@ -63,6 +63,7 @@ const cachedReportMeasure = NativePerformance.reportMeasure;
63
63
  const cachedGetMarkTime = NativePerformance.getMarkTime;
64
64
  const cachedNativeClearMarks = NativePerformance.clearMarks;
65
65
  const cachedNativeClearMeasures = NativePerformance.clearMeasures;
66
+ let cachedTimeOrigin: ?DOMHighResTimeStamp;
66
67
 
67
68
  const MARK_OPTIONS_REUSABLE_OBJECT: PerformanceMarkOptions = {
68
69
  startTime: 0,
@@ -93,7 +94,11 @@ const getMarkTimeForMeasure = (markName: string): number => {
93
94
  * https://www.w3.org/TR/user-timing/#extensions-performance-interface
94
95
  */
95
96
  export default class Performance {
96
- eventCounts: EventCounts = new EventCounts();
97
+ #eventCounts: EventCounts = new EventCounts();
98
+
99
+ get eventCounts(): EventCounts {
100
+ return this.#eventCounts;
101
+ }
97
102
 
98
103
  // Get the current JS memory information.
99
104
  get memory(): MemoryInfo {
@@ -123,22 +128,36 @@ export default class Performance {
123
128
  get rnStartupTiming(): ReactNativeStartupTiming {
124
129
  const {
125
130
  startTime,
126
- endTime,
127
131
  initializeRuntimeStart,
128
- initializeRuntimeEnd,
129
132
  executeJavaScriptBundleEntryPointStart,
130
- executeJavaScriptBundleEntryPointEnd,
133
+ endTime,
131
134
  } = NativePerformance.getReactNativeStartupTiming();
132
135
  return new ReactNativeStartupTiming({
133
136
  startTime,
134
- endTime,
135
137
  initializeRuntimeStart,
136
- initializeRuntimeEnd,
137
138
  executeJavaScriptBundleEntryPointStart,
138
- executeJavaScriptBundleEntryPointEnd,
139
+ endTime,
139
140
  });
140
141
  }
141
142
 
143
+ /**
144
+ * Returns the high resolution timestamp that is used as the baseline for
145
+ * performance-related timestamps.
146
+ * https://developer.mozilla.org/en-US/docs/Web/API/Performance/timeOrigin
147
+ */
148
+ get timeOrigin(): DOMHighResTimeStamp {
149
+ if (cachedTimeOrigin == null) {
150
+ if (NativePerformance.timeOrigin) {
151
+ cachedTimeOrigin = NativePerformance?.timeOrigin();
152
+ } else {
153
+ // Very naive polyfill.
154
+ cachedTimeOrigin = Date.now() - getCurrentTimeStamp();
155
+ }
156
+ }
157
+
158
+ return cachedTimeOrigin;
159
+ }
160
+
142
161
  mark(
143
162
  markName: string,
144
163
  markOptions?: PerformanceMarkOptions,
@@ -16,9 +16,7 @@ type ReactNativeStartupTimingLike = {
16
16
  startTime: ?number,
17
17
  endTime: ?number,
18
18
  initializeRuntimeStart: ?number,
19
- initializeRuntimeEnd: ?number,
20
19
  executeJavaScriptBundleEntryPointStart: ?number,
21
- executeJavaScriptBundleEntryPointEnd: ?number,
22
20
  };
23
21
 
24
22
  // Read-only object with RN startup timing information.
@@ -29,22 +27,17 @@ export default class ReactNativeStartupTiming {
29
27
  // 1. The `ReactNativeStartupTiming` is non-standard API
30
28
  // 2. The timing information is relative to the time origin, which means `0` has valid meaning
31
29
  #startTime: ?number;
32
- #endTime: ?number;
33
30
  #initializeRuntimeStart: ?number;
34
- #initializeRuntimeEnd: ?number;
35
31
  #executeJavaScriptBundleEntryPointStart: ?number;
36
- #executeJavaScriptBundleEntryPointEnd: ?number;
32
+ #endTime: ?number;
37
33
 
38
34
  constructor(startUpTiming: ?ReactNativeStartupTimingLike) {
39
35
  if (startUpTiming != null) {
40
36
  this.#startTime = startUpTiming.startTime;
41
- this.#endTime = startUpTiming.endTime;
42
37
  this.#initializeRuntimeStart = startUpTiming.initializeRuntimeStart;
43
- this.#initializeRuntimeEnd = startUpTiming.initializeRuntimeEnd;
44
38
  this.#executeJavaScriptBundleEntryPointStart =
45
39
  startUpTiming.executeJavaScriptBundleEntryPointStart;
46
- this.#executeJavaScriptBundleEntryPointEnd =
47
- startUpTiming.executeJavaScriptBundleEntryPointEnd;
40
+ this.#endTime = startUpTiming.endTime;
48
41
  }
49
42
  }
50
43
 
@@ -56,7 +49,7 @@ export default class ReactNativeStartupTiming {
56
49
  }
57
50
 
58
51
  /**
59
- * End time of the RN app startup process. This is equal to `executeJavaScriptBundleEntryPointEnd`.
52
+ * End time of the RN app startup process.
60
53
  */
61
54
  get endTime(): ?number {
62
55
  return this.#endTime;
@@ -69,26 +62,12 @@ export default class ReactNativeStartupTiming {
69
62
  return this.#initializeRuntimeStart;
70
63
  }
71
64
 
72
- /**
73
- * End time when RN runtime get initialized. This is the last marker before ends of the app startup process.
74
- */
75
- get initializeRuntimeEnd(): ?number {
76
- return this.#initializeRuntimeEnd;
77
- }
78
-
79
65
  /**
80
66
  * Start time of JS bundle being executed. This indicates the RN JS bundle is loaded and start to be evaluated.
81
67
  */
82
68
  get executeJavaScriptBundleEntryPointStart(): ?number {
83
69
  return this.#executeJavaScriptBundleEntryPointStart;
84
70
  }
85
-
86
- /**
87
- * End time of JS bundle being executed. This indicates all the synchronous entry point jobs are finished.
88
- */
89
- get executeJavaScriptBundleEntryPointEnd(): ?number {
90
- return this.#executeJavaScriptBundleEntryPointEnd;
91
- }
92
71
  }
93
72
 
94
73
  setPlatformObject(ReactNativeStartupTiming);
@@ -54,6 +54,8 @@ export type PerformanceObserverInit = {
54
54
 
55
55
  export interface Spec extends TurboModule {
56
56
  +now: () => number;
57
+ +timeOrigin?: () => number;
58
+
57
59
  +reportMark: (name: string, startTime: number, entry: mixed) => void;
58
60
  +reportMeasure: (
59
61
  name: string,