@expo/cli 0.23.0 → 0.23.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 (76) hide show
  1. package/build/bin/cli +1 -1
  2. package/build/src/customize/templates.js +15 -1
  3. package/build/src/customize/templates.js.map +1 -1
  4. package/build/src/lint/ESlintPrerequisite.js +30 -46
  5. package/build/src/lint/ESlintPrerequisite.js.map +1 -1
  6. package/build/src/start/doctor/apple/XcodePrerequisite.js +1 -1
  7. package/build/src/start/doctor/apple/XcodePrerequisite.js.map +1 -1
  8. package/build/src/start/server/metro/MetroTerminalReporter.js +28 -1
  9. package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -1
  10. package/build/src/start/server/metro/debugging/createDebugMiddleware.js +19 -19
  11. package/build/src/start/server/metro/debugging/createDebugMiddleware.js.map +1 -1
  12. package/build/src/start/server/metro/instantiateMetro.js +2 -2
  13. package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
  14. package/build/src/start/server/metro/log-box/LogBoxSymbolication.js +21 -2
  15. package/build/src/start/server/metro/log-box/LogBoxSymbolication.js.map +1 -1
  16. package/build/src/start/server/metro/metroErrorInterface.js +19 -8
  17. package/build/src/start/server/metro/metroErrorInterface.js.map +1 -1
  18. package/build/src/start/server/metro/withMetroMultiPlatform.js +0 -9
  19. package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
  20. package/build/src/start/server/middleware/inspector/JsInspector.js +2 -25
  21. package/build/src/start/server/middleware/inspector/JsInspector.js.map +1 -1
  22. package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
  23. package/build/src/utils/telemetry/utils/context.js +1 -1
  24. package/package.json +8 -8
  25. package/static/canary/react-is/cjs/react-is.development.js +118 -185
  26. package/static/canary/react-is/cjs/react-is.production.js +2 -2
  27. package/static/canary/react-native/Libraries/Renderer/implementations/ReactFabric-dev.js +16582 -26565
  28. package/static/canary/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js +3495 -3357
  29. package/static/canary/react-native/Libraries/Renderer/implementations/ReactFabric-profiling.js +3929 -3801
  30. package/static/canary/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +16869 -27032
  31. package/static/canary/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3535 -3428
  32. package/static/canary/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4198 -4095
  33. package/static/canary/scheduler/cjs/scheduler-unstable_mock.development.js +387 -684
  34. package/static/canary/scheduler/cjs/scheduler-unstable_mock.production.js +0 -9
  35. package/static/canary/scheduler/cjs/scheduler-unstable_post_task.development.js +137 -195
  36. package/static/canary/scheduler/cjs/scheduler-unstable_post_task.production.js +0 -5
  37. package/static/canary/scheduler/cjs/scheduler.development.js +339 -600
  38. package/static/canary/scheduler/cjs/scheduler.native.development.js +324 -512
  39. package/static/canary/scheduler/cjs/scheduler.native.production.js +6 -5
  40. package/static/canary/scheduler/cjs/scheduler.production.js +16 -17
  41. package/static/canary-full/react/cjs/react-compiler-runtime.development.js +13 -68
  42. package/static/canary-full/react/cjs/react-jsx-dev-runtime.development.js +317 -1251
  43. package/static/canary-full/react/cjs/react-jsx-dev-runtime.react-server.development.js +353 -1286
  44. package/static/canary-full/react/cjs/react-jsx-runtime.development.js +326 -1279
  45. package/static/canary-full/react/cjs/react-jsx-runtime.react-server.development.js +353 -1286
  46. package/static/canary-full/react/cjs/react.development.js +1204 -2771
  47. package/static/canary-full/react/cjs/react.production.js +25 -20
  48. package/static/canary-full/react/cjs/react.react-server.development.js +783 -2162
  49. package/static/canary-full/react/cjs/react.react-server.production.js +13 -63
  50. package/static/canary-full/react/package.json +1 -1
  51. package/static/canary-full/react-dom/cjs/react-dom-client.development.js +24847 -37099
  52. package/static/canary-full/react-dom/cjs/react-dom-client.production.js +8261 -7475
  53. package/static/canary-full/react-dom/cjs/react-dom-profiling.development.js +25252 -37571
  54. package/static/canary-full/react-dom/cjs/react-dom-profiling.profiling.js +9442 -8662
  55. package/static/canary-full/react-dom/cjs/react-dom-server-legacy.browser.development.js +8944 -11568
  56. package/static/canary-full/react-dom/cjs/react-dom-server-legacy.browser.production.js +1378 -944
  57. package/static/canary-full/react-dom/cjs/react-dom-server-legacy.node.development.js +8944 -11568
  58. package/static/canary-full/react-dom/cjs/react-dom-server-legacy.node.production.js +1386 -954
  59. package/static/canary-full/react-dom/cjs/react-dom-server.browser.development.js +9344 -11600
  60. package/static/canary-full/react-dom/cjs/react-dom-server.browser.production.js +1545 -954
  61. package/static/canary-full/react-dom/cjs/react-dom-server.bun.development.js +8286 -11064
  62. package/static/canary-full/react-dom/cjs/react-dom-server.bun.production.js +1437 -976
  63. package/static/canary-full/react-dom/cjs/react-dom-server.edge.development.js +9356 -11609
  64. package/static/canary-full/react-dom/cjs/react-dom-server.edge.production.js +1542 -970
  65. package/static/canary-full/react-dom/cjs/react-dom-server.node.development.js +9227 -11571
  66. package/static/canary-full/react-dom/cjs/react-dom-server.node.production.js +1787 -1183
  67. package/static/canary-full/react-dom/cjs/react-dom-test-utils.development.js +13 -59
  68. package/static/canary-full/react-dom/cjs/react-dom.development.js +402 -604
  69. package/static/canary-full/react-dom/cjs/react-dom.production.js +4 -3
  70. package/static/canary-full/react-dom/cjs/react-dom.react-server.development.js +322 -382
  71. package/static/canary-full/react-dom/cjs/react-dom.react-server.production.js +6 -7
  72. package/static/canary-full/react-dom/package.json +5 -5
  73. package/static/canary-full/react-dom/static.browser.js +1 -0
  74. package/static/canary-full/react-dom/static.edge.js +1 -0
  75. package/static/canary-full/react-dom/static.node.js +1 -0
  76. package/static/template/eslint.config.js +10 -0
@@ -8,618 +8,357 @@
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
10
 
11
- 'use strict';
12
-
13
- if (process.env.NODE_ENV !== "production") {
14
- (function() {
15
-
16
- 'use strict';
17
-
18
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
19
- if (
20
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
21
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
22
- 'function'
23
- ) {
24
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
25
- }
26
- var enableSchedulerDebugging = false;
27
- var enableProfiling = false;
28
- var frameYieldMs = 5;
29
- var userBlockingPriorityTimeout = 250;
30
- var normalPriorityTimeout = 5000;
31
- var lowPriorityTimeout = 10000;
32
-
33
- function push(heap, node) {
34
- var index = heap.length;
35
- heap.push(node);
36
- siftUp(heap, node, index);
37
- }
38
- function peek(heap) {
39
- return heap.length === 0 ? null : heap[0];
40
- }
41
- function pop(heap) {
42
- if (heap.length === 0) {
43
- return null;
44
- }
45
-
46
- var first = heap[0];
47
- var last = heap.pop();
48
-
49
- if (last !== first) {
50
- heap[0] = last;
51
- siftDown(heap, last, 0);
52
- }
53
-
54
- return first;
55
- }
56
-
57
- function siftUp(heap, node, i) {
58
- var index = i;
59
-
60
- while (index > 0) {
61
- var parentIndex = index - 1 >>> 1;
62
- var parent = heap[parentIndex];
63
-
64
- if (compare(parent, node) > 0) {
65
- // The parent is larger. Swap positions.
66
- heap[parentIndex] = node;
67
- heap[index] = parent;
68
- index = parentIndex;
69
- } else {
70
- // The parent is smaller. Exit.
71
- return;
72
- }
73
- }
74
- }
75
-
76
- function siftDown(heap, node, i) {
77
- var index = i;
78
- var length = heap.length;
79
- var halfLength = length >>> 1;
80
-
81
- while (index < halfLength) {
82
- var leftIndex = (index + 1) * 2 - 1;
83
- var left = heap[leftIndex];
84
- var rightIndex = leftIndex + 1;
85
- var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.
86
-
87
- if (compare(left, node) < 0) {
88
- if (rightIndex < length && compare(right, left) < 0) {
89
- heap[index] = right;
90
- heap[rightIndex] = node;
91
- index = rightIndex;
92
- } else {
93
- heap[index] = left;
94
- heap[leftIndex] = node;
95
- index = leftIndex;
11
+ "use strict";
12
+ "production" !== process.env.NODE_ENV &&
13
+ (function () {
14
+ function performWorkUntilDeadline() {
15
+ needsPaint = !1;
16
+ if (isMessageLoopRunning) {
17
+ var currentTime = exports.unstable_now();
18
+ startTime = currentTime;
19
+ var hasMoreWork = !0;
20
+ try {
21
+ a: {
22
+ isHostCallbackScheduled = !1;
23
+ isHostTimeoutScheduled &&
24
+ ((isHostTimeoutScheduled = !1),
25
+ localClearTimeout(taskTimeoutID),
26
+ (taskTimeoutID = -1));
27
+ isPerformingWork = !0;
28
+ var previousPriorityLevel = currentPriorityLevel;
29
+ try {
30
+ b: {
31
+ advanceTimers(currentTime);
32
+ for (
33
+ currentTask = peek(taskQueue);
34
+ null !== currentTask &&
35
+ !(
36
+ currentTask.expirationTime > currentTime &&
37
+ shouldYieldToHost()
38
+ );
39
+
40
+ ) {
41
+ var callback = currentTask.callback;
42
+ if ("function" === typeof callback) {
43
+ currentTask.callback = null;
44
+ currentPriorityLevel = currentTask.priorityLevel;
45
+ var continuationCallback = callback(
46
+ currentTask.expirationTime <= currentTime
47
+ );
48
+ currentTime = exports.unstable_now();
49
+ if ("function" === typeof continuationCallback) {
50
+ currentTask.callback = continuationCallback;
51
+ advanceTimers(currentTime);
52
+ hasMoreWork = !0;
53
+ break b;
54
+ }
55
+ currentTask === peek(taskQueue) && pop(taskQueue);
56
+ advanceTimers(currentTime);
57
+ } else pop(taskQueue);
58
+ currentTask = peek(taskQueue);
59
+ }
60
+ if (null !== currentTask) hasMoreWork = !0;
61
+ else {
62
+ var firstTimer = peek(timerQueue);
63
+ null !== firstTimer &&
64
+ requestHostTimeout(
65
+ handleTimeout,
66
+ firstTimer.startTime - currentTime
67
+ );
68
+ hasMoreWork = !1;
69
+ }
70
+ }
71
+ break a;
72
+ } finally {
73
+ (currentTask = null),
74
+ (currentPriorityLevel = previousPriorityLevel),
75
+ (isPerformingWork = !1);
76
+ }
77
+ hasMoreWork = void 0;
78
+ }
79
+ } finally {
80
+ hasMoreWork
81
+ ? schedulePerformWorkUntilDeadline()
82
+ : (isMessageLoopRunning = !1);
83
+ }
96
84
  }
97
- } else if (rightIndex < length && compare(right, node) < 0) {
98
- heap[index] = right;
99
- heap[rightIndex] = node;
100
- index = rightIndex;
101
- } else {
102
- // Neither child is smaller. Exit.
103
- return;
104
- }
105
- }
106
- }
107
-
108
- function compare(a, b) {
109
- // Compare sort index first, then task id.
110
- var diff = a.sortIndex - b.sortIndex;
111
- return diff !== 0 ? diff : a.id - b.id;
112
- }
113
-
114
- // TODO: Use symbols?
115
- var ImmediatePriority = 1;
116
- var UserBlockingPriority = 2;
117
- var NormalPriority = 3;
118
- var LowPriority = 4;
119
- var IdlePriority = 5;
120
-
121
- function markTaskErrored(task, ms) {
122
- }
123
-
124
- /* eslint-disable no-var */
125
- exports.unstable_now = void 0;
126
- var hasPerformanceNow = // $FlowFixMe[method-unbinding]
127
- typeof performance === 'object' && typeof performance.now === 'function';
128
-
129
- if (hasPerformanceNow) {
130
- var localPerformance = performance;
131
-
132
- exports.unstable_now = function () {
133
- return localPerformance.now();
134
- };
135
- } else {
136
- var localDate = Date;
137
- var initialTime = localDate.now();
138
-
139
- exports.unstable_now = function () {
140
- return localDate.now() - initialTime;
141
- };
142
- } // Max 31 bit integer. The max integer size in V8 for 32-bit systems.
143
- // Math.pow(2, 30) - 1
144
- // 0b111111111111111111111111111111
145
-
146
-
147
- var maxSigned31BitInt = 1073741823; // Tasks are stored on a min heap
148
-
149
- var taskQueue = [];
150
- var timerQueue = []; // Incrementing id counter. Used to maintain insertion order.
151
-
152
- var taskIdCounter = 1; // Pausing the scheduler is useful for debugging.
153
- var currentTask = null;
154
- var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrance.
155
-
156
- var isPerformingWork = false;
157
- var isHostCallbackScheduled = false;
158
- var isHostTimeoutScheduled = false; // Capture local references to native APIs, in case a polyfill overrides them.
159
-
160
- var localSetTimeout = typeof setTimeout === 'function' ? setTimeout : null;
161
- var localClearTimeout = typeof clearTimeout === 'function' ? clearTimeout : null;
162
- var localSetImmediate = typeof setImmediate !== 'undefined' ? setImmediate : null; // IE and Node.js + jsdom
163
-
164
- function advanceTimers(currentTime) {
165
- // Check for tasks that are no longer delayed and add them to the queue.
166
- var timer = peek(timerQueue);
167
-
168
- while (timer !== null) {
169
- if (timer.callback === null) {
170
- // Timer was cancelled.
171
- pop(timerQueue);
172
- } else if (timer.startTime <= currentTime) {
173
- // Timer fired. Transfer to the task queue.
174
- pop(timerQueue);
175
- timer.sortIndex = timer.expirationTime;
176
- push(taskQueue, timer);
177
- } else {
178
- // Remaining timers are pending.
179
- return;
180
85
  }
181
-
182
- timer = peek(timerQueue);
183
- }
184
- }
185
-
186
- function handleTimeout(currentTime) {
187
- isHostTimeoutScheduled = false;
188
- advanceTimers(currentTime);
189
-
190
- if (!isHostCallbackScheduled) {
191
- if (peek(taskQueue) !== null) {
192
- isHostCallbackScheduled = true;
193
- requestHostCallback();
194
- } else {
195
- var firstTimer = peek(timerQueue);
196
-
197
- if (firstTimer !== null) {
198
- requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
86
+ function push(heap, node) {
87
+ var index = heap.length;
88
+ heap.push(node);
89
+ a: for (; 0 < index; ) {
90
+ var parentIndex = (index - 1) >>> 1,
91
+ parent = heap[parentIndex];
92
+ if (0 < compare(parent, node))
93
+ (heap[parentIndex] = node),
94
+ (heap[index] = parent),
95
+ (index = parentIndex);
96
+ else break a;
199
97
  }
200
98
  }
201
- }
202
- }
203
-
204
- function flushWork(initialTime) {
205
-
206
-
207
- isHostCallbackScheduled = false;
208
-
209
- if (isHostTimeoutScheduled) {
210
- // We scheduled a timeout but it's no longer needed. Cancel it.
211
- isHostTimeoutScheduled = false;
212
- cancelHostTimeout();
213
- }
214
-
215
- isPerformingWork = true;
216
- var previousPriorityLevel = currentPriorityLevel;
217
-
218
- try {
219
- var currentTime; if (enableProfiling) ; else {
220
- // No catch in prod code path.
221
- return workLoop(initialTime);
99
+ function peek(heap) {
100
+ return 0 === heap.length ? null : heap[0];
222
101
  }
223
- } finally {
224
- currentTask = null;
225
- currentPriorityLevel = previousPriorityLevel;
226
- isPerformingWork = false;
227
- }
228
- }
229
-
230
- function workLoop(initialTime) {
231
- var currentTime = initialTime;
232
- advanceTimers(currentTime);
233
- currentTask = peek(taskQueue);
234
-
235
- while (currentTask !== null && !(enableSchedulerDebugging )) {
236
- if (currentTask.expirationTime > currentTime && shouldYieldToHost()) {
237
- // This currentTask hasn't expired, and we've reached the deadline.
238
- break;
239
- } // $FlowFixMe[incompatible-use] found when upgrading Flow
240
-
241
-
242
- var callback = currentTask.callback;
243
-
244
- if (typeof callback === 'function') {
245
- // $FlowFixMe[incompatible-use] found when upgrading Flow
246
- currentTask.callback = null; // $FlowFixMe[incompatible-use] found when upgrading Flow
247
-
248
- currentPriorityLevel = currentTask.priorityLevel; // $FlowFixMe[incompatible-use] found when upgrading Flow
249
-
250
- var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
251
-
252
- var continuationCallback = callback(didUserCallbackTimeout);
253
- currentTime = exports.unstable_now();
254
-
255
- if (typeof continuationCallback === 'function') {
256
- // If a continuation is returned, immediately yield to the main thread
257
- // regardless of how much time is left in the current time slice.
258
- // $FlowFixMe[incompatible-use] found when upgrading Flow
259
- currentTask.callback = continuationCallback;
260
-
261
- advanceTimers(currentTime);
262
- return true;
263
- } else {
264
-
265
- if (currentTask === peek(taskQueue)) {
266
- pop(taskQueue);
102
+ function pop(heap) {
103
+ if (0 === heap.length) return null;
104
+ var first = heap[0],
105
+ last = heap.pop();
106
+ if (last !== first) {
107
+ heap[0] = last;
108
+ a: for (
109
+ var index = 0, length = heap.length, halfLength = length >>> 1;
110
+ index < halfLength;
111
+
112
+ ) {
113
+ var leftIndex = 2 * (index + 1) - 1,
114
+ left = heap[leftIndex],
115
+ rightIndex = leftIndex + 1,
116
+ right = heap[rightIndex];
117
+ if (0 > compare(left, last))
118
+ rightIndex < length && 0 > compare(right, left)
119
+ ? ((heap[index] = right),
120
+ (heap[rightIndex] = last),
121
+ (index = rightIndex))
122
+ : ((heap[index] = left),
123
+ (heap[leftIndex] = last),
124
+ (index = leftIndex));
125
+ else if (rightIndex < length && 0 > compare(right, last))
126
+ (heap[index] = right),
127
+ (heap[rightIndex] = last),
128
+ (index = rightIndex);
129
+ else break a;
267
130
  }
268
-
269
- advanceTimers(currentTime);
270
131
  }
271
- } else {
272
- pop(taskQueue);
132
+ return first;
273
133
  }
274
-
275
- currentTask = peek(taskQueue);
276
- } // Return whether there's additional work
277
-
278
-
279
- if (currentTask !== null) {
280
- return true;
281
- } else {
282
- var firstTimer = peek(timerQueue);
283
-
284
- if (firstTimer !== null) {
285
- requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
134
+ function compare(a, b) {
135
+ var diff = a.sortIndex - b.sortIndex;
136
+ return 0 !== diff ? diff : a.id - b.id;
286
137
  }
287
-
288
- return false;
289
- }
290
- }
291
-
292
- function unstable_runWithPriority(priorityLevel, eventHandler) {
293
- switch (priorityLevel) {
294
- case ImmediatePriority:
295
- case UserBlockingPriority:
296
- case NormalPriority:
297
- case LowPriority:
298
- case IdlePriority:
299
- break;
300
-
301
- default:
302
- priorityLevel = NormalPriority;
303
- }
304
-
305
- var previousPriorityLevel = currentPriorityLevel;
306
- currentPriorityLevel = priorityLevel;
307
-
308
- try {
309
- return eventHandler();
310
- } finally {
311
- currentPriorityLevel = previousPriorityLevel;
312
- }
313
- }
314
-
315
- function unstable_next(eventHandler) {
316
- var priorityLevel;
317
-
318
- switch (currentPriorityLevel) {
319
- case ImmediatePriority:
320
- case UserBlockingPriority:
321
- case NormalPriority:
322
- // Shift down to normal priority
323
- priorityLevel = NormalPriority;
324
- break;
325
-
326
- default:
327
- // Anything lower than normal priority should remain at the current level.
328
- priorityLevel = currentPriorityLevel;
329
- break;
330
- }
331
-
332
- var previousPriorityLevel = currentPriorityLevel;
333
- currentPriorityLevel = priorityLevel;
334
-
335
- try {
336
- return eventHandler();
337
- } finally {
338
- currentPriorityLevel = previousPriorityLevel;
339
- }
340
- }
341
-
342
- function unstable_wrapCallback(callback) {
343
- var parentPriorityLevel = currentPriorityLevel; // $FlowFixMe[incompatible-return]
344
- // $FlowFixMe[missing-this-annot]
345
-
346
- return function () {
347
- // This is a fork of runWithPriority, inlined for performance.
348
- var previousPriorityLevel = currentPriorityLevel;
349
- currentPriorityLevel = parentPriorityLevel;
350
-
351
- try {
352
- return callback.apply(this, arguments);
353
- } finally {
354
- currentPriorityLevel = previousPriorityLevel;
138
+ function advanceTimers(currentTime) {
139
+ for (var timer = peek(timerQueue); null !== timer; ) {
140
+ if (null === timer.callback) pop(timerQueue);
141
+ else if (timer.startTime <= currentTime)
142
+ pop(timerQueue),
143
+ (timer.sortIndex = timer.expirationTime),
144
+ push(taskQueue, timer);
145
+ else break;
146
+ timer = peek(timerQueue);
147
+ }
355
148
  }
356
- };
357
- }
358
-
359
- function unstable_scheduleCallback(priorityLevel, callback, options) {
360
- var currentTime = exports.unstable_now();
361
- var startTime;
362
-
363
- if (typeof options === 'object' && options !== null) {
364
- var delay = options.delay;
365
-
366
- if (typeof delay === 'number' && delay > 0) {
367
- startTime = currentTime + delay;
368
- } else {
369
- startTime = currentTime;
149
+ function handleTimeout(currentTime) {
150
+ isHostTimeoutScheduled = !1;
151
+ advanceTimers(currentTime);
152
+ if (!isHostCallbackScheduled)
153
+ if (null !== peek(taskQueue))
154
+ (isHostCallbackScheduled = !0),
155
+ isMessageLoopRunning ||
156
+ ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline());
157
+ else {
158
+ var firstTimer = peek(timerQueue);
159
+ null !== firstTimer &&
160
+ requestHostTimeout(
161
+ handleTimeout,
162
+ firstTimer.startTime - currentTime
163
+ );
164
+ }
370
165
  }
371
- } else {
372
- startTime = currentTime;
373
- }
374
-
375
- var timeout;
376
-
377
- switch (priorityLevel) {
378
- case ImmediatePriority:
379
- // Times out immediately
380
- timeout = -1;
381
- break;
382
-
383
- case UserBlockingPriority:
384
- // Eventually times out
385
- timeout = userBlockingPriorityTimeout;
386
- break;
387
-
388
- case IdlePriority:
389
- // Never times out
390
- timeout = maxSigned31BitInt;
391
- break;
392
-
393
- case LowPriority:
394
- // Eventually times out
395
- timeout = lowPriorityTimeout;
396
- break;
397
-
398
- case NormalPriority:
399
- default:
400
- // Eventually times out
401
- timeout = normalPriorityTimeout;
402
- break;
403
- }
404
-
405
- var expirationTime = startTime + timeout;
406
- var newTask = {
407
- id: taskIdCounter++,
408
- callback: callback,
409
- priorityLevel: priorityLevel,
410
- startTime: startTime,
411
- expirationTime: expirationTime,
412
- sortIndex: -1
413
- };
414
-
415
- if (startTime > currentTime) {
416
- // This is a delayed task.
417
- newTask.sortIndex = startTime;
418
- push(timerQueue, newTask);
419
-
420
- if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
421
- // All tasks are delayed, and this is the task with the earliest delay.
422
- if (isHostTimeoutScheduled) {
423
- // Cancel an existing timeout.
424
- cancelHostTimeout();
425
- } else {
426
- isHostTimeoutScheduled = true;
427
- } // Schedule a timeout.
428
-
429
-
430
- requestHostTimeout(handleTimeout, startTime - currentTime);
166
+ function shouldYieldToHost() {
167
+ return needsPaint
168
+ ? !0
169
+ : exports.unstable_now() - startTime < frameInterval
170
+ ? !1
171
+ : !0;
431
172
  }
432
- } else {
433
- newTask.sortIndex = expirationTime;
434
- push(taskQueue, newTask);
435
- // wait until the next time we yield.
436
-
437
-
438
- if (!isHostCallbackScheduled && !isPerformingWork) {
439
- isHostCallbackScheduled = true;
440
- requestHostCallback();
173
+ function requestHostTimeout(callback, ms) {
174
+ taskTimeoutID = localSetTimeout(function () {
175
+ callback(exports.unstable_now());
176
+ }, ms);
441
177
  }
442
- }
443
-
444
- return newTask;
445
- }
446
-
447
- function unstable_pauseExecution() {
448
- }
449
-
450
- function unstable_continueExecution() {
451
-
452
- if (!isHostCallbackScheduled && !isPerformingWork) {
453
- isHostCallbackScheduled = true;
454
- requestHostCallback();
455
- }
456
- }
457
-
458
- function unstable_getFirstCallbackNode() {
459
- return peek(taskQueue);
460
- }
461
-
462
- function unstable_cancelCallback(task) {
463
- // remove from the queue because you can't remove arbitrary nodes from an
464
- // array based heap, only the first one.)
465
-
466
-
467
- task.callback = null;
468
- }
469
-
470
- function unstable_getCurrentPriorityLevel() {
471
- return currentPriorityLevel;
472
- }
473
-
474
- var isMessageLoopRunning = false;
475
- var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main
476
- // thread, like user events. By default, it yields multiple times per frame.
477
- // It does not attempt to align with frame boundaries, since most tasks don't
478
- // need to be frame aligned; for those that do, use requestAnimationFrame.
479
-
480
- var frameInterval = frameYieldMs;
481
- var startTime = -1;
482
-
483
- function shouldYieldToHost() {
484
- var timeElapsed = exports.unstable_now() - startTime;
485
-
486
- if (timeElapsed < frameInterval) {
487
- // The main thread has only been blocked for a really short amount of time;
488
- // smaller than a single frame. Don't yield yet.
489
- return false;
490
- } // Yield now.
491
-
492
-
493
- return true;
494
- }
495
-
496
- function requestPaint() {}
497
-
498
- function forceFrameRate(fps) {
499
- if (fps < 0 || fps > 125) {
500
- // Using console['error'] to evade Babel and ESLint
501
- console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing frame rates higher than 125 fps is not supported');
502
- return;
503
- }
504
-
505
- if (fps > 0) {
506
- frameInterval = Math.floor(1000 / fps);
507
- } else {
508
- // reset the framerate
509
- frameInterval = frameYieldMs;
510
- }
511
- }
512
-
513
- var performWorkUntilDeadline = function () {
514
- if (isMessageLoopRunning) {
515
- var currentTime = exports.unstable_now(); // Keep track of the start time so we can measure how long the main thread
516
- // has been blocked.
517
-
518
- startTime = currentTime; // If a scheduler task throws, exit the current browser task so the
519
- // error can be observed.
520
- //
521
- // Intentionally not using a try-catch, since that makes some debugging
522
- // techniques harder. Instead, if `flushWork` errors, then `hasMoreWork` will
523
- // remain true, and we'll continue the work loop.
524
-
525
- var hasMoreWork = true;
526
-
527
- try {
528
- hasMoreWork = flushWork(currentTime);
529
- } finally {
530
- if (hasMoreWork) {
531
- // If there's more work, schedule the next message event at the end
532
- // of the preceding one.
533
- schedulePerformWorkUntilDeadline();
534
- } else {
535
- isMessageLoopRunning = false;
536
- }
178
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
179
+ "function" ===
180
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
181
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
182
+ exports.unstable_now = void 0;
183
+ if (
184
+ "object" === typeof performance &&
185
+ "function" === typeof performance.now
186
+ ) {
187
+ var localPerformance = performance;
188
+ exports.unstable_now = function () {
189
+ return localPerformance.now();
190
+ };
191
+ } else {
192
+ var localDate = Date,
193
+ initialTime = localDate.now();
194
+ exports.unstable_now = function () {
195
+ return localDate.now() - initialTime;
196
+ };
537
197
  }
538
- }
539
- };
540
-
541
- var schedulePerformWorkUntilDeadline;
542
-
543
- if (typeof localSetImmediate === 'function') {
544
- // Node.js and old IE.
545
- // There's a few reasons for why we prefer setImmediate.
546
- //
547
- // Unlike MessageChannel, it doesn't prevent a Node.js process from exiting.
548
- // (Even though this is a DOM fork of the Scheduler, you could get here
549
- // with a mix of Node.js 15+, which has a MessageChannel, and jsdom.)
550
- // https://github.com/facebook/react/issues/20756
551
- //
552
- // But also, it runs earlier which is the semantic we want.
553
- // If other browsers ever implement it, it's better to use it.
554
- // Although both of these would be inferior to native scheduling.
555
- schedulePerformWorkUntilDeadline = function () {
556
- localSetImmediate(performWorkUntilDeadline);
557
- };
558
- } else if (typeof MessageChannel !== 'undefined') {
559
- // DOM and Worker environments.
560
- // We prefer MessageChannel because of the 4ms setTimeout clamping.
561
- var channel = new MessageChannel();
562
- var port = channel.port2;
563
- channel.port1.onmessage = performWorkUntilDeadline;
564
-
565
- schedulePerformWorkUntilDeadline = function () {
566
- port.postMessage(null);
567
- };
568
- } else {
569
- // We should only fallback here in non-browser environments.
570
- schedulePerformWorkUntilDeadline = function () {
571
- // $FlowFixMe[not-a-function] nullable value
572
- localSetTimeout(performWorkUntilDeadline, 0);
573
- };
574
- }
575
-
576
- function requestHostCallback() {
577
- if (!isMessageLoopRunning) {
578
- isMessageLoopRunning = true;
579
- schedulePerformWorkUntilDeadline();
580
- }
581
- }
582
-
583
- function requestHostTimeout(callback, ms) {
584
- // $FlowFixMe[not-a-function] nullable value
585
- taskTimeoutID = localSetTimeout(function () {
586
- callback(exports.unstable_now());
587
- }, ms);
588
- }
589
-
590
- function cancelHostTimeout() {
591
- // $FlowFixMe[not-a-function] nullable value
592
- localClearTimeout(taskTimeoutID);
593
- taskTimeoutID = -1;
594
- }
595
- var unstable_Profiling = null;
596
-
597
- exports.unstable_IdlePriority = IdlePriority;
598
- exports.unstable_ImmediatePriority = ImmediatePriority;
599
- exports.unstable_LowPriority = LowPriority;
600
- exports.unstable_NormalPriority = NormalPriority;
601
- exports.unstable_Profiling = unstable_Profiling;
602
- exports.unstable_UserBlockingPriority = UserBlockingPriority;
603
- exports.unstable_cancelCallback = unstable_cancelCallback;
604
- exports.unstable_continueExecution = unstable_continueExecution;
605
- exports.unstable_forceFrameRate = forceFrameRate;
606
- exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
607
- exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
608
- exports.unstable_next = unstable_next;
609
- exports.unstable_pauseExecution = unstable_pauseExecution;
610
- exports.unstable_requestPaint = requestPaint;
611
- exports.unstable_runWithPriority = unstable_runWithPriority;
612
- exports.unstable_scheduleCallback = unstable_scheduleCallback;
613
- exports.unstable_shouldYield = shouldYieldToHost;
614
- exports.unstable_wrapCallback = unstable_wrapCallback;
615
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
616
- if (
617
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
618
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
619
- 'function'
620
- ) {
621
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
622
- }
623
-
198
+ var taskQueue = [],
199
+ timerQueue = [],
200
+ taskIdCounter = 1,
201
+ currentTask = null,
202
+ currentPriorityLevel = 3,
203
+ isPerformingWork = !1,
204
+ isHostCallbackScheduled = !1,
205
+ isHostTimeoutScheduled = !1,
206
+ needsPaint = !1,
207
+ localSetTimeout = "function" === typeof setTimeout ? setTimeout : null,
208
+ localClearTimeout =
209
+ "function" === typeof clearTimeout ? clearTimeout : null,
210
+ localSetImmediate =
211
+ "undefined" !== typeof setImmediate ? setImmediate : null,
212
+ isMessageLoopRunning = !1,
213
+ taskTimeoutID = -1,
214
+ frameInterval = 5,
215
+ startTime = -1;
216
+ if ("function" === typeof localSetImmediate)
217
+ var schedulePerformWorkUntilDeadline = function () {
218
+ localSetImmediate(performWorkUntilDeadline);
219
+ };
220
+ else if ("undefined" !== typeof MessageChannel) {
221
+ var channel = new MessageChannel(),
222
+ port = channel.port2;
223
+ channel.port1.onmessage = performWorkUntilDeadline;
224
+ schedulePerformWorkUntilDeadline = function () {
225
+ port.postMessage(null);
226
+ };
227
+ } else
228
+ schedulePerformWorkUntilDeadline = function () {
229
+ localSetTimeout(performWorkUntilDeadline, 0);
230
+ };
231
+ exports.unstable_IdlePriority = 5;
232
+ exports.unstable_ImmediatePriority = 1;
233
+ exports.unstable_LowPriority = 4;
234
+ exports.unstable_NormalPriority = 3;
235
+ exports.unstable_Profiling = null;
236
+ exports.unstable_UserBlockingPriority = 2;
237
+ exports.unstable_cancelCallback = function (task) {
238
+ task.callback = null;
239
+ };
240
+ exports.unstable_forceFrameRate = function (fps) {
241
+ 0 > fps || 125 < fps
242
+ ? console.error(
243
+ "forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"
244
+ )
245
+ : (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5);
246
+ };
247
+ exports.unstable_getCurrentPriorityLevel = function () {
248
+ return currentPriorityLevel;
249
+ };
250
+ exports.unstable_next = function (eventHandler) {
251
+ switch (currentPriorityLevel) {
252
+ case 1:
253
+ case 2:
254
+ case 3:
255
+ var priorityLevel = 3;
256
+ break;
257
+ default:
258
+ priorityLevel = currentPriorityLevel;
259
+ }
260
+ var previousPriorityLevel = currentPriorityLevel;
261
+ currentPriorityLevel = priorityLevel;
262
+ try {
263
+ return eventHandler();
264
+ } finally {
265
+ currentPriorityLevel = previousPriorityLevel;
266
+ }
267
+ };
268
+ exports.unstable_requestPaint = function () {
269
+ needsPaint = !0;
270
+ };
271
+ exports.unstable_runWithPriority = function (priorityLevel, eventHandler) {
272
+ switch (priorityLevel) {
273
+ case 1:
274
+ case 2:
275
+ case 3:
276
+ case 4:
277
+ case 5:
278
+ break;
279
+ default:
280
+ priorityLevel = 3;
281
+ }
282
+ var previousPriorityLevel = currentPriorityLevel;
283
+ currentPriorityLevel = priorityLevel;
284
+ try {
285
+ return eventHandler();
286
+ } finally {
287
+ currentPriorityLevel = previousPriorityLevel;
288
+ }
289
+ };
290
+ exports.unstable_scheduleCallback = function (
291
+ priorityLevel,
292
+ callback,
293
+ options
294
+ ) {
295
+ var currentTime = exports.unstable_now();
296
+ "object" === typeof options && null !== options
297
+ ? ((options = options.delay),
298
+ (options =
299
+ "number" === typeof options && 0 < options
300
+ ? currentTime + options
301
+ : currentTime))
302
+ : (options = currentTime);
303
+ switch (priorityLevel) {
304
+ case 1:
305
+ var timeout = -1;
306
+ break;
307
+ case 2:
308
+ timeout = 250;
309
+ break;
310
+ case 5:
311
+ timeout = 1073741823;
312
+ break;
313
+ case 4:
314
+ timeout = 1e4;
315
+ break;
316
+ default:
317
+ timeout = 5e3;
318
+ }
319
+ timeout = options + timeout;
320
+ priorityLevel = {
321
+ id: taskIdCounter++,
322
+ callback: callback,
323
+ priorityLevel: priorityLevel,
324
+ startTime: options,
325
+ expirationTime: timeout,
326
+ sortIndex: -1
327
+ };
328
+ options > currentTime
329
+ ? ((priorityLevel.sortIndex = options),
330
+ push(timerQueue, priorityLevel),
331
+ null === peek(taskQueue) &&
332
+ priorityLevel === peek(timerQueue) &&
333
+ (isHostTimeoutScheduled
334
+ ? (localClearTimeout(taskTimeoutID), (taskTimeoutID = -1))
335
+ : (isHostTimeoutScheduled = !0),
336
+ requestHostTimeout(handleTimeout, options - currentTime)))
337
+ : ((priorityLevel.sortIndex = timeout),
338
+ push(taskQueue, priorityLevel),
339
+ isHostCallbackScheduled ||
340
+ isPerformingWork ||
341
+ ((isHostCallbackScheduled = !0),
342
+ isMessageLoopRunning ||
343
+ ((isMessageLoopRunning = !0),
344
+ schedulePerformWorkUntilDeadline())));
345
+ return priorityLevel;
346
+ };
347
+ exports.unstable_shouldYield = shouldYieldToHost;
348
+ exports.unstable_wrapCallback = function (callback) {
349
+ var parentPriorityLevel = currentPriorityLevel;
350
+ return function () {
351
+ var previousPriorityLevel = currentPriorityLevel;
352
+ currentPriorityLevel = parentPriorityLevel;
353
+ try {
354
+ return callback.apply(this, arguments);
355
+ } finally {
356
+ currentPriorityLevel = previousPriorityLevel;
357
+ }
358
+ };
359
+ };
360
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
361
+ "function" ===
362
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
363
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
624
364
  })();
625
- }