@office-iss/react-native-win32 0.0.0-canary.299 → 0.0.0-canary.300

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 (99) hide show
  1. package/.flowconfig +3 -6
  2. package/CHANGELOG.json +46 -1
  3. package/CHANGELOG.md +19 -6
  4. package/IntegrationTests/IntegrationTestsApp.js +1 -1
  5. package/Libraries/Alert/RCTAlertManager.android.js +2 -0
  6. package/Libraries/Animated/Animated.d.ts +2 -0
  7. package/Libraries/Animated/AnimatedImplementation.js +2 -0
  8. package/Libraries/Animated/Easing.js +2 -0
  9. package/Libraries/Animated/animations/Animation.js +14 -14
  10. package/Libraries/Animated/animations/TimingAnimation.js +2 -0
  11. package/Libraries/Animated/nodes/AnimatedNode.js +7 -7
  12. package/Libraries/Animated/nodes/AnimatedObject.js +7 -7
  13. package/Libraries/Animated/nodes/AnimatedProps.js +30 -30
  14. package/Libraries/Animated/nodes/AnimatedStyle.js +17 -17
  15. package/Libraries/Animated/nodes/AnimatedTransform.js +5 -5
  16. package/Libraries/Animated/nodes/AnimatedValue.js +18 -18
  17. package/Libraries/AppState/AppState.js +3 -3
  18. package/Libraries/BatchedBridge/MessageQueue.js +4 -0
  19. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +1 -1
  20. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +1 -1
  21. package/Libraries/Components/Pressable/Pressable.js +10 -1
  22. package/Libraries/Components/Pressable/Pressable.win32.js +9 -0
  23. package/Libraries/Components/StatusBar/StatusBar.js +2 -2
  24. package/Libraries/Components/Switch/Switch.js +1 -1
  25. package/Libraries/Components/TextInput/TextInput.js +2 -2
  26. package/Libraries/Components/TextInput/TextInput.win32.js +2 -1
  27. package/Libraries/Components/Touchable/TouchableBounce.js +1 -1
  28. package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
  29. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -1
  30. package/Libraries/Components/Touchable/TouchableOpacity.js +1 -1
  31. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -2
  32. package/Libraries/Components/View/View.js +86 -168
  33. package/Libraries/Core/ReactNativeVersion.js +37 -10
  34. package/Libraries/Core/Timers/queueMicrotask.js +1 -0
  35. package/Libraries/Core/setUpPerformance.js +2 -1
  36. package/Libraries/Interaction/InteractionManager.js +118 -171
  37. package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -0
  38. package/Libraries/LogBox/Data/LogBoxData.js +4 -1
  39. package/Libraries/Modal/Modal.js +1 -1
  40. package/Libraries/NativeComponent/ViewConfig.js +1 -1
  41. package/Libraries/Network/XMLHttpRequest.js +18 -5
  42. package/Libraries/Pressability/Pressability.js +1 -1
  43. package/Libraries/Pressability/Pressability.win32.js +1 -1
  44. package/Libraries/ReactNative/AppRegistryImpl.js +4 -2
  45. package/Libraries/Renderer/implementations/ReactFabric-dev.js +38 -35
  46. package/Libraries/Renderer/implementations/ReactFabric-prod.js +51 -22
  47. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +54 -24
  48. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +36 -33
  49. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +5 -5
  50. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +5 -5
  51. package/Libraries/Renderer/shims/ReactFabric.js +3 -1
  52. package/Libraries/Renderer/shims/ReactFeatureFlags.js +3 -1
  53. package/Libraries/Renderer/shims/ReactNative.js +3 -1
  54. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -1
  55. package/Libraries/Renderer/shims/createReactNativeComponentClass.js +3 -1
  56. package/Libraries/Utilities/useMergeRefs.js +1 -1
  57. package/Libraries/promiseRejectionTrackingOptions.js +17 -31
  58. package/flow/HermesInternalType.js +114 -0
  59. package/flow/Stringish.js +14 -0
  60. package/flow/bom.js.flow +554 -0
  61. package/flow/console.js +49 -0
  62. package/flow/cssom.js.flow +575 -0
  63. package/flow/dom.js.flow +6289 -0
  64. package/flow/global.js +88 -0
  65. package/flow/prettier.js.flow +14 -0
  66. package/flow/streams.js.flow +140 -0
  67. package/index.js +5 -2
  68. package/index.win32.js +6 -2
  69. package/jest/mockComponent.js +1 -1
  70. package/jest/setup.js +11 -0
  71. package/overrides.json +11 -11
  72. package/package.json +19 -19
  73. package/src/private/animated/NativeAnimatedHelper.js +8 -1
  74. package/src/private/animated/NativeAnimatedHelper.win32.js +8 -1
  75. package/src/private/animated/createAnimatedPropsHook.js +2 -49
  76. package/src/private/animated/createAnimatedPropsMemoHook.js +2 -48
  77. package/src/private/components/virtualview/VirtualView.js +22 -6
  78. package/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js +93 -0
  79. package/src/private/devsupport/devmenu/elementinspector/ReactDevToolsOverlay.js +2 -2
  80. package/src/private/featureflags/ReactNativeFeatureFlags.js +71 -51
  81. package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +19 -0
  82. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +15 -5
  83. package/src/private/webapis/dom/nodes/ReadOnlyElement.js +1 -1
  84. package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +2 -2
  85. package/src/private/webapis/dom/oldstylecollections/NodeList.js +2 -2
  86. package/src/private/webapis/geometry/DOMRectList.js +2 -2
  87. package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +19 -74
  88. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +0 -4
  89. package/src/private/webapis/performance/EventTiming.js +5 -9
  90. package/src/private/webapis/performance/Performance.js +251 -191
  91. package/src/private/webapis/performance/PerformanceObserver.js +8 -29
  92. package/src/private/webapis/performance/UserTiming.js +24 -23
  93. package/src/private/webapis/performance/UserTimingExtensibility.js.flow +38 -0
  94. package/src/private/webapis/performance/internals/Utilities.js +9 -0
  95. package/src/private/webapis/performance/specs/NativePerformance.js +19 -33
  96. package/src/private/webapis/structuredClone/structuredClone.js +1 -1
  97. package/Libraries/Interaction/InteractionManagerStub.js +0 -184
  98. package/Libraries/Interaction/TaskQueue.js +0 -197
  99. package/Libraries/ReactNative/ReactNativeFeatureFlags.js +0 -31
@@ -9,14 +9,41 @@
9
9
  * @generated by scripts/releases/set-version.js
10
10
  */
11
11
 
12
- export const version: $ReadOnly<{
13
- major: number,
14
- minor: number,
15
- patch: number,
16
- prerelease: string | null,
17
- }> = {
18
- major: 0,
19
- minor: 81,
20
- patch: 0,
21
- prerelease: 'nightly-20250709-6892dde36',
12
+ /**
13
+ * Object containing the current React Native version.
14
+ *
15
+ * Specifically, this is the source of truth for the resolved `react-native`
16
+ * package in the JavaScript bundle. Apps and libraries can use this to
17
+ * determine compatibility or enable version-specific features.
18
+ *
19
+ * @example
20
+ * ```js
21
+ * // Get the full version string
22
+ * const version = ReactNativeVersion.getVersionString();
23
+ *
24
+ * // Access individual version components
25
+ * const major = ReactNativeVersion.major;
26
+ * ```
27
+ */
28
+ export default class ReactNativeVersion {
29
+ static major: number = 0;
30
+ static minor: number = 82;
31
+ static patch: number = 0;
32
+ static prerelease: string | null = 'nightly-20250806-5936f29d6';
33
+
34
+ static getVersionString(): string {
35
+ return `${this.major}.${this.minor}.${this.patch}${this.prerelease != null ? `-${this.prerelease}` : ''}`;
36
+ }
37
+ }
38
+
39
+ /**
40
+ * @deprecated Compatibility export — please import `ReactNativeVersion` from
41
+ * `react-native`.
42
+ * See https://github.com/react-native-community/discussions-and-proposals/pull/894.
43
+ */
44
+ export const version = {
45
+ major: ReactNativeVersion.major,
46
+ minor: ReactNativeVersion.minor,
47
+ patch: ReactNativeVersion.patch,
48
+ prerelease: ReactNativeVersion.prerelease,
22
49
  };
@@ -30,6 +30,7 @@ export default function queueMicrotask(callback: Function) {
30
30
  }
31
31
 
32
32
  // Try to reuse a lazily allocated resolved promise from closure.
33
+ // $FlowFixMe[constant-condition]
33
34
  (resolvedPromise || (resolvedPromise = Promise.resolve()))
34
35
  .then(callback)
35
36
  .catch(error =>
@@ -8,12 +8,13 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import Performance from '../../src/private/webapis/performance/Performance';
12
11
  import NativePerformance from '../../src/private/webapis/performance/specs/NativePerformance';
13
12
 
14
13
  // In case if the native implementation of the Performance API is available, use it,
15
14
  // otherwise fall back to the legacy/default one, which only defines 'Performance.now()'
16
15
  if (NativePerformance) {
16
+ const Performance =
17
+ require('../../src/private/webapis/performance/Performance').default;
17
18
  // $FlowExpectedError[cannot-write]
18
19
  global.performance = new Performance();
19
20
  } else {
@@ -4,180 +4,32 @@
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
- * @flow strict-local
7
+ * @flow strict
8
8
  * @format
9
9
  */
10
10
 
11
11
  import type {EventSubscription} from '../vendor/emitter/EventEmitter';
12
- import type {Task} from './TaskQueue';
13
12
 
14
- import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
15
- import EventEmitter from '../vendor/emitter/EventEmitter';
16
-
17
- const BatchedBridge = require('../BatchedBridge/BatchedBridge').default;
18
- const TaskQueue = require('./TaskQueue').default;
19
13
  const invariant = require('invariant');
20
14
 
21
- export type {Task, SimpleTask, PromiseTask} from './TaskQueue';
22
-
23
- export type Handle = number;
24
-
25
- const _emitter = new EventEmitter<{
26
- interactionComplete: [],
27
- interactionStart: [],
28
- }>();
29
-
30
- const DEBUG_DELAY: 0 = 0;
31
- const DEBUG: false = false;
32
-
33
- const InteractionManagerImpl = {
34
- Events: {
35
- interactionStart: 'interactionStart',
36
- interactionComplete: 'interactionComplete',
37
- },
38
-
39
- /**
40
- * Schedule a function to run after all interactions have completed. Returns a cancellable
41
- * "promise".
42
- */
43
- runAfterInteractions(task: ?Task): {
44
- then: <U>(
45
- onFulfill?: ?(void) => ?(Promise<U> | U),
46
- onReject?: ?(error: mixed) => ?(Promise<U> | U),
47
- ) => Promise<U>,
48
- cancel: () => void,
49
- ...
50
- } {
51
- const tasks: Array<Task> = [];
52
- const promise = new Promise((resolve: () => void) => {
53
- _scheduleUpdate();
54
- if (task) {
55
- tasks.push(task);
56
- }
57
- tasks.push({
58
- run: resolve,
59
- name: 'resolve ' + ((task && task.name) || '?'),
60
- });
61
- _taskQueue.enqueueTasks(tasks);
62
- });
63
- return {
64
- // $FlowFixMe[method-unbinding] added when improving typing for this parameters
65
- then: promise.then.bind(promise),
66
- cancel: function () {
67
- _taskQueue.cancelTasks(tasks);
68
- },
69
- };
70
- },
71
-
72
- /**
73
- * Notify manager that an interaction has started.
74
- */
75
- createInteractionHandle(): Handle {
76
- /* $FlowFixMe[constant-condition] Error discovered during Constant
77
- * Condition roll out. See https://fburl.com/workplace/1v97vimq. */
78
- DEBUG && console.log('InteractionManager: create interaction handle');
79
- _scheduleUpdate();
80
- const handle = ++_inc;
81
- _addInteractionSet.add(handle);
82
- return handle;
83
- },
84
-
85
- /**
86
- * Notify manager that an interaction has completed.
87
- */
88
- clearInteractionHandle(handle: Handle) {
89
- /* $FlowFixMe[constant-condition] Error discovered during Constant
90
- * Condition roll out. See https://fburl.com/workplace/1v97vimq. */
91
- DEBUG && console.log('InteractionManager: clear interaction handle');
92
- invariant(!!handle, 'InteractionManager: Must provide a handle to clear.');
93
- _scheduleUpdate();
94
- _addInteractionSet.delete(handle);
95
- _deleteInteractionSet.add(handle);
96
- },
97
-
98
- // $FlowFixMe[unclear-type] unclear type of _emitter
99
- // $FlowFixMe[method-unbinding] added when improving typing for this parameters
100
- addListener: _emitter.addListener.bind(_emitter) as (
101
- eventType: string,
102
- // $FlowFixMe[unclear-type] unclear type of arguments
103
- listener: (...args: any) => mixed,
104
- context: mixed,
105
- ) => EventSubscription,
106
-
107
- /**
108
- * A positive number will use setTimeout to schedule any tasks after the
109
- * eventLoopRunningTime hits the deadline value, otherwise all tasks will be
110
- * executed in one setImmediate batch (default).
111
- */
112
- setDeadline(deadline: number) {
113
- _deadline = deadline;
114
- },
15
+ export type SimpleTask = {
16
+ name: string,
17
+ run: () => void,
115
18
  };
19
+ export type PromiseTask = {
20
+ name: string,
21
+ gen: () => Promise<void>,
22
+ };
23
+ export type Task = SimpleTask | PromiseTask | (() => void);
116
24
 
117
- const _interactionSet = new Set<number | Handle>();
118
- const _addInteractionSet = new Set<number | Handle>();
119
- const _deleteInteractionSet = new Set<Handle>();
120
- const _taskQueue = new TaskQueue({onMoreTasks: _scheduleUpdate});
121
- let _nextUpdateHandle: $FlowFixMe | TimeoutID = 0;
122
- let _inc = 0;
123
- let _deadline = -1;
124
-
125
- /**
126
- * Schedule an asynchronous update to the interaction state.
127
- */
128
- function _scheduleUpdate() {
129
- if (!_nextUpdateHandle) {
130
- if (_deadline > 0) {
131
- _nextUpdateHandle = setTimeout(_processUpdate, 0 + DEBUG_DELAY);
132
- } else {
133
- _nextUpdateHandle = setImmediate(_processUpdate);
134
- }
135
- }
136
- }
137
-
138
- /**
139
- * Notify listeners, process queue, etc
140
- */
141
- function _processUpdate() {
142
- _nextUpdateHandle = 0;
143
-
144
- const interactionCount = _interactionSet.size;
145
- _addInteractionSet.forEach(handle => _interactionSet.add(handle));
146
- _deleteInteractionSet.forEach(handle => _interactionSet.delete(handle));
147
- const nextInteractionCount = _interactionSet.size;
148
-
149
- if (interactionCount !== 0 && nextInteractionCount === 0) {
150
- // transition from 1+ --> 0 interactions
151
- /* $FlowFixMe[prop-missing] Natural Inference rollout. See
152
- * https://fburl.com/workplace/6291gfvu */
153
- /* $FlowFixMe[invalid-computed-prop] Natural Inference rollout. See
154
- * https://fburl.com/workplace/6291gfvu */
155
- _emitter.emit(InteractionManager.Events.interactionComplete);
156
- } else if (interactionCount === 0 && nextInteractionCount !== 0) {
157
- // transition from 0 --> 1+ interactions
158
- /* $FlowFixMe[prop-missing] Natural Inference rollout. See
159
- * https://fburl.com/workplace/6291gfvu */
160
- /* $FlowFixMe[invalid-computed-prop] Natural Inference rollout. See
161
- * https://fburl.com/workplace/6291gfvu */
162
- _emitter.emit(InteractionManager.Events.interactionStart);
163
- }
25
+ export type Handle = number;
164
26
 
165
- // process the queue regardless of a transition
166
- if (nextInteractionCount === 0) {
167
- while (_taskQueue.hasTasksToProcess()) {
168
- _taskQueue.processNext();
169
- if (
170
- _deadline > 0 &&
171
- BatchedBridge.getEventLoopRunningTime() >= _deadline
172
- ) {
173
- // Hit deadline before processing all tasks, so process more later.
174
- _scheduleUpdate();
175
- break;
176
- }
177
- }
178
- }
179
- _addInteractionSet.clear();
180
- _deleteInteractionSet.clear();
27
+ // NOTE: The original implementation of `InteractionManager` never rejected
28
+ // the returned promise. This preserves that behavior in the stub.
29
+ function reject(error: Error): void {
30
+ setTimeout(() => {
31
+ throw error;
32
+ }, 0);
181
33
  }
182
34
 
183
35
  /**
@@ -231,11 +83,106 @@ function _processUpdate() {
231
83
  *
232
84
  * @deprecated
233
85
  */
234
- const InteractionManager = (
235
- ReactNativeFeatureFlags.disableInteractionManager()
236
- ? // $FlowFixMe[incompatible-variance]
237
- require('./InteractionManagerStub').default
238
- : InteractionManagerImpl
239
- ) as typeof InteractionManagerImpl;
86
+ const InteractionManagerStub = {
87
+ Events: {
88
+ interactionStart: 'interactionStart',
89
+ interactionComplete: 'interactionComplete',
90
+ },
91
+
92
+ /**
93
+ * Schedule a function to run after all interactions have completed. Returns a cancellable
94
+ * "promise".
95
+ *
96
+ * @deprecated
97
+ */
98
+ runAfterInteractions(task: ?Task): {
99
+ then: <U>(
100
+ onFulfill?: ?(void) => ?(Promise<U> | U),
101
+ onReject?: ?(error: mixed) => ?(Promise<U> | U),
102
+ ) => Promise<U>,
103
+ cancel: () => void,
104
+ ...
105
+ } {
106
+ let immediateID: ?$FlowFixMe;
107
+ const promise = new Promise(resolve => {
108
+ immediateID = setImmediate(() => {
109
+ if (typeof task === 'object' && task !== null) {
110
+ if (typeof task.gen === 'function') {
111
+ task.gen().then(resolve, reject);
112
+ } else if (typeof task.run === 'function') {
113
+ try {
114
+ task.run();
115
+ resolve();
116
+ } catch (error) {
117
+ reject(error);
118
+ }
119
+ } else {
120
+ reject(new TypeError(`Task "${task.name}" missing gen or run.`));
121
+ }
122
+ } else if (typeof task === 'function') {
123
+ try {
124
+ task();
125
+ resolve();
126
+ } catch (error) {
127
+ reject(error);
128
+ }
129
+ } else {
130
+ reject(new TypeError('Invalid task of type: ' + typeof task));
131
+ }
132
+ });
133
+ });
134
+
135
+ return {
136
+ // $FlowFixMe[method-unbinding] added when improving typing for this parameters
137
+ then: promise.then.bind(promise),
138
+ cancel() {
139
+ clearImmediate(immediateID);
140
+ },
141
+ };
142
+ },
143
+
144
+ /**
145
+ * Notify manager that an interaction has started.
146
+ *
147
+ * @deprecated
148
+ */
149
+ createInteractionHandle(): Handle {
150
+ return -1;
151
+ },
152
+
153
+ /**
154
+ * Notify manager that an interaction has completed.
155
+ *
156
+ * @deprecated
157
+ */
158
+ clearInteractionHandle(handle: Handle) {
159
+ invariant(!!handle, 'InteractionManager: Must provide a handle to clear.');
160
+ },
161
+
162
+ /**
163
+ * @deprecated
164
+ */
165
+ addListener(
166
+ eventType: string,
167
+ // $FlowIgnore[unclear-type]
168
+ listener: (...args: any) => mixed,
169
+ context: mixed,
170
+ ): EventSubscription {
171
+ return {
172
+ remove() {},
173
+ };
174
+ },
175
+
176
+ /**
177
+ * A positive number will use setTimeout to schedule any tasks after the
178
+ * eventLoopRunningTime hits the deadline value, otherwise all tasks will be
179
+ * executed in one setImmediate batch (default).
180
+ *
181
+ * @deprecated
182
+ */
183
+ setDeadline(deadline: number) {
184
+ // Do nothing.
185
+ },
186
+ };
240
187
 
241
- export default InteractionManager;
188
+ export default InteractionManagerStub;
@@ -108,6 +108,8 @@ function configureNext(
108
108
  if (UIManager?.configureNextLayoutAnimation) {
109
109
  UIManager.configureNextLayoutAnimation(
110
110
  config,
111
+ /* $FlowFixMe[constant-condition] Error discovered during Constant
112
+ * Condition roll out. See https://fburl.com/workplace/1v97vimq. */
111
113
  onAnimationComplete ?? function () {},
112
114
  onAnimationDidFail ??
113
115
  function () {} /* this should never be called in Non-Fabric */,
@@ -20,7 +20,6 @@ import type {
20
20
 
21
21
  import DebuggerSessionObserver from '../../../src/private/devsupport/rndevtools/FuseboxSessionObserver';
22
22
  import parseErrorStack from '../../Core/Devtools/parseErrorStack';
23
- import NativeDevSettings from '../../NativeModules/specs/NativeDevSettings';
24
23
  import NativeLogBox from '../../NativeModules/specs/NativeLogBox';
25
24
  import LogBoxLog from './LogBoxLog';
26
25
  import {parseLogBoxException} from './parseLogBoxLog';
@@ -493,6 +492,10 @@ function showFuseboxWarningsMigrationMessageOnce() {
493
492
  return;
494
493
  }
495
494
  hasShownFuseboxWarningsMigrationMessage = true;
495
+
496
+ const NativeDevSettings =
497
+ require('../../NativeModules/specs/NativeDevSettings').default;
498
+
496
499
  appendNewLog(
497
500
  new LogBoxLog({
498
501
  level: 'warn',
@@ -292,7 +292,7 @@ class Modal extends React.Component<ModalProps, ModalState> {
292
292
  backgroundColor:
293
293
  this.props.transparent === true
294
294
  ? 'transparent'
295
- : this.props.backdropColor ?? 'white',
295
+ : (this.props.backdropColor ?? 'white'),
296
296
  };
297
297
 
298
298
  let animationType = this.props.animationType || 'none';
@@ -47,6 +47,6 @@ function composeIndexers<T>(
47
47
  maybeB: ?{+[string]: T},
48
48
  ): {+[string]: T} {
49
49
  return maybeA == null || maybeB == null
50
- ? maybeA ?? maybeB ?? {}
50
+ ? (maybeA ?? maybeB ?? {})
51
51
  : {...maybeA, ...maybeB};
52
52
  }
@@ -34,6 +34,9 @@ const RCTNetworking = require('./RCTNetworking').default;
34
34
  const base64 = require('base64-js');
35
35
  const invariant = require('invariant');
36
36
 
37
+ const PERFORMANCE_TRACK_NAME = 'Network (JS-initiated only)';
38
+ const PERFORMANCE_TRACK_GROUP = 'Chrome DevTools Temp Compat';
39
+
37
40
  declare var performance: Performance;
38
41
 
39
42
  const DEBUG_NETWORK_SEND_DELAY: false = false; // Set to a number of milliseconds when debugging
@@ -385,6 +388,9 @@ class XMLHttpRequest extends EventTarget {
385
388
  if (requestId !== this._requestId) {
386
389
  return;
387
390
  }
391
+
392
+ const start = XMLHttpRequest._profiling ? performance.now() : undefined;
393
+
388
394
  if (!this._response) {
389
395
  this._response = responseText;
390
396
  } else {
@@ -392,8 +398,12 @@ class XMLHttpRequest extends EventTarget {
392
398
  }
393
399
 
394
400
  if (XMLHttpRequest._profiling) {
395
- performance.mark(
396
- 'Track:XMLHttpRequest:Incremental Data: ' + this._getMeasureURL(),
401
+ console.timeStamp(
402
+ 'Incremental Data: ' + this._getMeasureURL(),
403
+ start,
404
+ undefined,
405
+ PERFORMANCE_TRACK_NAME,
406
+ PERFORMANCE_TRACK_GROUP,
397
407
  );
398
408
  }
399
409
  XMLHttpRequest._interceptor &&
@@ -442,10 +452,13 @@ class XMLHttpRequest extends EventTarget {
442
452
  this.setReadyState(this.DONE);
443
453
  if (XMLHttpRequest._profiling && this._startTime != null) {
444
454
  const start = this._startTime;
445
- performance.measure('Track:XMLHttpRequest:' + this._getMeasureURL(), {
455
+ console.timeStamp(
456
+ this._getMeasureURL(),
446
457
  start,
447
- end: performance.now(),
448
- });
458
+ undefined,
459
+ PERFORMANCE_TRACK_NAME,
460
+ PERFORMANCE_TRACK_GROUP,
461
+ );
449
462
  }
450
463
  if (error) {
451
464
  XMLHttpRequest._interceptor &&
@@ -16,8 +16,8 @@ import type {
16
16
  MouseEvent,
17
17
  } from '../Types/CoreEventTypes';
18
18
 
19
+ import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
19
20
  import SoundManager from '../Components/Sound/SoundManager';
20
- import ReactNativeFeatureFlags from '../ReactNative/ReactNativeFeatureFlags';
21
21
  import UIManager from '../ReactNative/UIManager';
22
22
  import {type RectOrSize, normalizeRect} from '../StyleSheet/Rect';
23
23
  import {type PointerEvent} from '../Types/CoreEventTypes';
@@ -17,8 +17,8 @@ import type {
17
17
  MouseEvent,
18
18
  } from '../Types/CoreEventTypes';
19
19
 
20
+ import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
20
21
  import SoundManager from '../Components/Sound/SoundManager';
21
- import ReactNativeFeatureFlags from '../ReactNative/ReactNativeFeatureFlags';
22
22
  import UIManager from '../ReactNative/UIManager';
23
23
  import {type RectOrSize, normalizeRect} from '../StyleSheet/Rect';
24
24
  import {type PointerEvent} from '../Types/CoreEventTypes';
@@ -26,8 +26,6 @@ import createPerformanceLogger from '../Utilities/createPerformanceLogger';
26
26
  import SceneTracker from '../Utilities/SceneTracker';
27
27
  import {coerceDisplayMode} from './DisplayMode';
28
28
  import HeadlessJsTaskError from './HeadlessJsTaskError';
29
- import NativeHeadlessJsTaskSupport from './NativeHeadlessJsTaskSupport';
30
- import renderApplication from './renderApplication';
31
29
  import {unmountComponentAtNodeAndRemoveContainer} from './RendererProxy';
32
30
  import invariant from 'invariant';
33
31
 
@@ -86,6 +84,7 @@ export function registerComponent(
86
84
  ): string {
87
85
  const scopedPerformanceLogger = createPerformanceLogger();
88
86
  runnables[appKey] = (appParameters, displayMode) => {
87
+ const renderApplication = require('./renderApplication').default;
89
88
  renderApplication(
90
89
  componentProviderInstrumentationHook(
91
90
  componentProvider,
@@ -258,6 +257,9 @@ export function startHeadlessTask(
258
257
  taskKey: string,
259
258
  data: any,
260
259
  ): void {
260
+ const NativeHeadlessJsTaskSupport =
261
+ require('./NativeHeadlessJsTaskSupport').default;
262
+
261
263
  const taskProvider = taskProviders.get(taskKey);
262
264
  if (!taskProvider) {
263
265
  console.warn(`No task registered for key ${taskKey}`);