@rspack/dev-server 0.1.2 → 0.1.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 (86) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/server.d.ts.map +1 -1
  3. package/dist/server.js +3 -6
  4. package/dist/server.js.map +1 -1
  5. package/package.json +5 -5
  6. package/src/server.ts +3 -7
  7. package/tsconfig.tsbuildinfo +1 -1
  8. package/tests/e2e/hot-reaload.test.ts +0 -115
  9. package/tests/e2e-fixtures/react/app.jsx +0 -14
  10. package/tests/e2e-fixtures/react/index.css +0 -3
  11. package/tests/e2e-fixtures/react/index.html +0 -12
  12. package/tests/e2e-fixtures/react/index.jsx +0 -6
  13. package/tests/e2e-fixtures/react/node_modules/react/LICENSE +0 -21
  14. package/tests/e2e-fixtures/react/node_modules/react/README.md +0 -37
  15. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-dev-runtime.development.js +0 -1296
  16. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-dev-runtime.production.min.js +0 -10
  17. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js +0 -10
  18. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-runtime.development.js +0 -1314
  19. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -11
  20. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-runtime.profiling.min.js +0 -11
  21. package/tests/e2e-fixtures/react/node_modules/react/cjs/react.development.js +0 -2739
  22. package/tests/e2e-fixtures/react/node_modules/react/cjs/react.production.min.js +0 -26
  23. package/tests/e2e-fixtures/react/node_modules/react/cjs/react.shared-subset.development.js +0 -20
  24. package/tests/e2e-fixtures/react/node_modules/react/cjs/react.shared-subset.production.min.js +0 -10
  25. package/tests/e2e-fixtures/react/node_modules/react/index.js +0 -7
  26. package/tests/e2e-fixtures/react/node_modules/react/jsx-dev-runtime.js +0 -7
  27. package/tests/e2e-fixtures/react/node_modules/react/jsx-runtime.js +0 -7
  28. package/tests/e2e-fixtures/react/node_modules/react/package.json +0 -47
  29. package/tests/e2e-fixtures/react/node_modules/react/react.shared-subset.js +0 -7
  30. package/tests/e2e-fixtures/react/node_modules/react/umd/react.development.js +0 -3342
  31. package/tests/e2e-fixtures/react/node_modules/react/umd/react.production.min.js +0 -31
  32. package/tests/e2e-fixtures/react/node_modules/react/umd/react.profiling.min.js +0 -31
  33. package/tests/e2e-fixtures/react/node_modules/react-dom/LICENSE +0 -21
  34. package/tests/e2e-fixtures/react/node_modules/react-dom/README.md +0 -60
  35. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +0 -7018
  36. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +0 -93
  37. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js +0 -7078
  38. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.min.js +0 -101
  39. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.browser.development.js +0 -7003
  40. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js +0 -96
  41. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.node.development.js +0 -7059
  42. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.node.production.min.js +0 -102
  43. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-test-utils.development.js +0 -1741
  44. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-test-utils.production.min.js +0 -40
  45. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom.development.js +0 -29868
  46. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom.production.min.js +0 -323
  47. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom.profiling.min.js +0 -367
  48. package/tests/e2e-fixtures/react/node_modules/react-dom/client.js +0 -25
  49. package/tests/e2e-fixtures/react/node_modules/react-dom/index.js +0 -38
  50. package/tests/e2e-fixtures/react/node_modules/react-dom/package.json +0 -62
  51. package/tests/e2e-fixtures/react/node_modules/react-dom/profiling.js +0 -38
  52. package/tests/e2e-fixtures/react/node_modules/react-dom/server.browser.js +0 -17
  53. package/tests/e2e-fixtures/react/node_modules/react-dom/server.js +0 -3
  54. package/tests/e2e-fixtures/react/node_modules/react-dom/server.node.js +0 -17
  55. package/tests/e2e-fixtures/react/node_modules/react-dom/test-utils.js +0 -7
  56. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server-legacy.browser.development.js +0 -7015
  57. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server-legacy.browser.production.min.js +0 -75
  58. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server.browser.development.js +0 -7000
  59. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server.browser.production.min.js +0 -76
  60. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-test-utils.development.js +0 -1737
  61. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-test-utils.production.min.js +0 -33
  62. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom.development.js +0 -29869
  63. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom.production.min.js +0 -267
  64. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom.profiling.min.js +0 -285
  65. package/tests/e2e-fixtures/react/node_modules/scheduler/LICENSE +0 -21
  66. package/tests/e2e-fixtures/react/node_modules/scheduler/README.md +0 -9
  67. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_mock.development.js +0 -700
  68. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_mock.production.min.js +0 -20
  69. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_post_task.development.js +0 -207
  70. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_post_task.production.min.js +0 -14
  71. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler.development.js +0 -634
  72. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler.production.min.js +0 -19
  73. package/tests/e2e-fixtures/react/node_modules/scheduler/index.js +0 -7
  74. package/tests/e2e-fixtures/react/node_modules/scheduler/package.json +0 -36
  75. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler-unstable_mock.development.js +0 -699
  76. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler-unstable_mock.production.min.js +0 -19
  77. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler.development.js +0 -152
  78. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler.production.min.js +0 -146
  79. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler.profiling.min.js +0 -146
  80. package/tests/e2e-fixtures/react/node_modules/scheduler/unstable_mock.js +0 -7
  81. package/tests/e2e-fixtures/react/node_modules/scheduler/unstable_post_task.js +0 -7
  82. package/tests/e2e-fixtures/react/package.json +0 -8
  83. package/tests/e2e-fixtures/react/webpack.config.js +0 -26
  84. package/tests/helpers/emitFile.ts +0 -69
  85. package/tests/helpers/runBrowser.ts +0 -85
  86. package/tests/helpers/tempDir.ts +0 -58
@@ -1,700 +0,0 @@
1
- /**
2
- * @license React
3
- * scheduler-unstable_mock.development.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */
10
-
11
- 'use strict';
12
-
13
- if (process.env.NODE_ENV !== "production") {
14
- (function() {
15
- 'use strict';
16
-
17
- var enableSchedulerDebugging = false;
18
- var enableProfiling = false;
19
-
20
- function push(heap, node) {
21
- var index = heap.length;
22
- heap.push(node);
23
- siftUp(heap, node, index);
24
- }
25
- function peek(heap) {
26
- return heap.length === 0 ? null : heap[0];
27
- }
28
- function pop(heap) {
29
- if (heap.length === 0) {
30
- return null;
31
- }
32
-
33
- var first = heap[0];
34
- var last = heap.pop();
35
-
36
- if (last !== first) {
37
- heap[0] = last;
38
- siftDown(heap, last, 0);
39
- }
40
-
41
- return first;
42
- }
43
-
44
- function siftUp(heap, node, i) {
45
- var index = i;
46
-
47
- while (index > 0) {
48
- var parentIndex = index - 1 >>> 1;
49
- var parent = heap[parentIndex];
50
-
51
- if (compare(parent, node) > 0) {
52
- // The parent is larger. Swap positions.
53
- heap[parentIndex] = node;
54
- heap[index] = parent;
55
- index = parentIndex;
56
- } else {
57
- // The parent is smaller. Exit.
58
- return;
59
- }
60
- }
61
- }
62
-
63
- function siftDown(heap, node, i) {
64
- var index = i;
65
- var length = heap.length;
66
- var halfLength = length >>> 1;
67
-
68
- while (index < halfLength) {
69
- var leftIndex = (index + 1) * 2 - 1;
70
- var left = heap[leftIndex];
71
- var rightIndex = leftIndex + 1;
72
- var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.
73
-
74
- if (compare(left, node) < 0) {
75
- if (rightIndex < length && compare(right, left) < 0) {
76
- heap[index] = right;
77
- heap[rightIndex] = node;
78
- index = rightIndex;
79
- } else {
80
- heap[index] = left;
81
- heap[leftIndex] = node;
82
- index = leftIndex;
83
- }
84
- } else if (rightIndex < length && compare(right, node) < 0) {
85
- heap[index] = right;
86
- heap[rightIndex] = node;
87
- index = rightIndex;
88
- } else {
89
- // Neither child is smaller. Exit.
90
- return;
91
- }
92
- }
93
- }
94
-
95
- function compare(a, b) {
96
- // Compare sort index first, then task id.
97
- var diff = a.sortIndex - b.sortIndex;
98
- return diff !== 0 ? diff : a.id - b.id;
99
- }
100
-
101
- // TODO: Use symbols?
102
- var ImmediatePriority = 1;
103
- var UserBlockingPriority = 2;
104
- var NormalPriority = 3;
105
- var LowPriority = 4;
106
- var IdlePriority = 5;
107
-
108
- function markTaskErrored(task, ms) {
109
- }
110
-
111
- /* eslint-disable no-var */
112
- // Math.pow(2, 30) - 1
113
- // 0b111111111111111111111111111111
114
-
115
- var maxSigned31BitInt = 1073741823; // Times out immediately
116
-
117
- var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out
118
-
119
- var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
120
- var NORMAL_PRIORITY_TIMEOUT = 5000;
121
- var LOW_PRIORITY_TIMEOUT = 10000; // Never times out
122
-
123
- var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap
124
-
125
- var taskQueue = [];
126
- var timerQueue = []; // Incrementing id counter. Used to maintain insertion order.
127
-
128
- var taskIdCounter = 1; // Pausing the scheduler is useful for debugging.
129
- var currentTask = null;
130
- var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrance.
131
-
132
- var isPerformingWork = false;
133
- var isHostCallbackScheduled = false;
134
- var isHostTimeoutScheduled = false;
135
- var currentMockTime = 0;
136
- var scheduledCallback = null;
137
- var scheduledTimeout = null;
138
- var timeoutTime = -1;
139
- var yieldedValues = null;
140
- var expectedNumberOfYields = -1;
141
- var didStop = false;
142
- var isFlushing = false;
143
- var needsPaint = false;
144
- var shouldYieldForPaint = false;
145
- var disableYieldValue = false;
146
-
147
- function setDisableYieldValue(newValue) {
148
- disableYieldValue = newValue;
149
- }
150
-
151
- function advanceTimers(currentTime) {
152
- // Check for tasks that are no longer delayed and add them to the queue.
153
- var timer = peek(timerQueue);
154
-
155
- while (timer !== null) {
156
- if (timer.callback === null) {
157
- // Timer was cancelled.
158
- pop(timerQueue);
159
- } else if (timer.startTime <= currentTime) {
160
- // Timer fired. Transfer to the task queue.
161
- pop(timerQueue);
162
- timer.sortIndex = timer.expirationTime;
163
- push(taskQueue, timer);
164
- } else {
165
- // Remaining timers are pending.
166
- return;
167
- }
168
-
169
- timer = peek(timerQueue);
170
- }
171
- }
172
-
173
- function handleTimeout(currentTime) {
174
- isHostTimeoutScheduled = false;
175
- advanceTimers(currentTime);
176
-
177
- if (!isHostCallbackScheduled) {
178
- if (peek(taskQueue) !== null) {
179
- isHostCallbackScheduled = true;
180
- requestHostCallback(flushWork);
181
- } else {
182
- var firstTimer = peek(timerQueue);
183
-
184
- if (firstTimer !== null) {
185
- requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
186
- }
187
- }
188
- }
189
- }
190
-
191
- function flushWork(hasTimeRemaining, initialTime) {
192
-
193
-
194
- isHostCallbackScheduled = false;
195
-
196
- if (isHostTimeoutScheduled) {
197
- // We scheduled a timeout but it's no longer needed. Cancel it.
198
- isHostTimeoutScheduled = false;
199
- cancelHostTimeout();
200
- }
201
-
202
- isPerformingWork = true;
203
- var previousPriorityLevel = currentPriorityLevel;
204
-
205
- try {
206
- if (enableProfiling) {
207
- try {
208
- return workLoop(hasTimeRemaining, initialTime);
209
- } catch (error) {
210
- if (currentTask !== null) {
211
- var currentTime = getCurrentTime();
212
- markTaskErrored(currentTask, currentTime);
213
- currentTask.isQueued = false;
214
- }
215
-
216
- throw error;
217
- }
218
- } else {
219
- // No catch in prod code path.
220
- return workLoop(hasTimeRemaining, initialTime);
221
- }
222
- } finally {
223
- currentTask = null;
224
- currentPriorityLevel = previousPriorityLevel;
225
- isPerformingWork = false;
226
- }
227
- }
228
-
229
- function workLoop(hasTimeRemaining, initialTime) {
230
- var currentTime = initialTime;
231
- advanceTimers(currentTime);
232
- currentTask = peek(taskQueue);
233
-
234
- while (currentTask !== null && !(enableSchedulerDebugging )) {
235
- if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {
236
- // This currentTask hasn't expired, and we've reached the deadline.
237
- break;
238
- }
239
-
240
- var callback = currentTask.callback;
241
-
242
- if (typeof callback === 'function') {
243
- currentTask.callback = null;
244
- currentPriorityLevel = currentTask.priorityLevel;
245
- var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
246
-
247
- var continuationCallback = callback(didUserCallbackTimeout);
248
- currentTime = getCurrentTime();
249
-
250
- if (typeof continuationCallback === 'function') {
251
- currentTask.callback = continuationCallback;
252
- } else {
253
-
254
- if (currentTask === peek(taskQueue)) {
255
- pop(taskQueue);
256
- }
257
- }
258
-
259
- advanceTimers(currentTime);
260
- } else {
261
- pop(taskQueue);
262
- }
263
-
264
- currentTask = peek(taskQueue);
265
- } // Return whether there's additional work
266
-
267
-
268
- if (currentTask !== null) {
269
- return true;
270
- } else {
271
- var firstTimer = peek(timerQueue);
272
-
273
- if (firstTimer !== null) {
274
- requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
275
- }
276
-
277
- return false;
278
- }
279
- }
280
-
281
- function unstable_runWithPriority(priorityLevel, eventHandler) {
282
- switch (priorityLevel) {
283
- case ImmediatePriority:
284
- case UserBlockingPriority:
285
- case NormalPriority:
286
- case LowPriority:
287
- case IdlePriority:
288
- break;
289
-
290
- default:
291
- priorityLevel = NormalPriority;
292
- }
293
-
294
- var previousPriorityLevel = currentPriorityLevel;
295
- currentPriorityLevel = priorityLevel;
296
-
297
- try {
298
- return eventHandler();
299
- } finally {
300
- currentPriorityLevel = previousPriorityLevel;
301
- }
302
- }
303
-
304
- function unstable_next(eventHandler) {
305
- var priorityLevel;
306
-
307
- switch (currentPriorityLevel) {
308
- case ImmediatePriority:
309
- case UserBlockingPriority:
310
- case NormalPriority:
311
- // Shift down to normal priority
312
- priorityLevel = NormalPriority;
313
- break;
314
-
315
- default:
316
- // Anything lower than normal priority should remain at the current level.
317
- priorityLevel = currentPriorityLevel;
318
- break;
319
- }
320
-
321
- var previousPriorityLevel = currentPriorityLevel;
322
- currentPriorityLevel = priorityLevel;
323
-
324
- try {
325
- return eventHandler();
326
- } finally {
327
- currentPriorityLevel = previousPriorityLevel;
328
- }
329
- }
330
-
331
- function unstable_wrapCallback(callback) {
332
- var parentPriorityLevel = currentPriorityLevel;
333
- return function () {
334
- // This is a fork of runWithPriority, inlined for performance.
335
- var previousPriorityLevel = currentPriorityLevel;
336
- currentPriorityLevel = parentPriorityLevel;
337
-
338
- try {
339
- return callback.apply(this, arguments);
340
- } finally {
341
- currentPriorityLevel = previousPriorityLevel;
342
- }
343
- };
344
- }
345
-
346
- function unstable_scheduleCallback(priorityLevel, callback, options) {
347
- var currentTime = getCurrentTime();
348
- var startTime;
349
-
350
- if (typeof options === 'object' && options !== null) {
351
- var delay = options.delay;
352
-
353
- if (typeof delay === 'number' && delay > 0) {
354
- startTime = currentTime + delay;
355
- } else {
356
- startTime = currentTime;
357
- }
358
- } else {
359
- startTime = currentTime;
360
- }
361
-
362
- var timeout;
363
-
364
- switch (priorityLevel) {
365
- case ImmediatePriority:
366
- timeout = IMMEDIATE_PRIORITY_TIMEOUT;
367
- break;
368
-
369
- case UserBlockingPriority:
370
- timeout = USER_BLOCKING_PRIORITY_TIMEOUT;
371
- break;
372
-
373
- case IdlePriority:
374
- timeout = IDLE_PRIORITY_TIMEOUT;
375
- break;
376
-
377
- case LowPriority:
378
- timeout = LOW_PRIORITY_TIMEOUT;
379
- break;
380
-
381
- case NormalPriority:
382
- default:
383
- timeout = NORMAL_PRIORITY_TIMEOUT;
384
- break;
385
- }
386
-
387
- var expirationTime = startTime + timeout;
388
- var newTask = {
389
- id: taskIdCounter++,
390
- callback: callback,
391
- priorityLevel: priorityLevel,
392
- startTime: startTime,
393
- expirationTime: expirationTime,
394
- sortIndex: -1
395
- };
396
-
397
- if (startTime > currentTime) {
398
- // This is a delayed task.
399
- newTask.sortIndex = startTime;
400
- push(timerQueue, newTask);
401
-
402
- if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
403
- // All tasks are delayed, and this is the task with the earliest delay.
404
- if (isHostTimeoutScheduled) {
405
- // Cancel an existing timeout.
406
- cancelHostTimeout();
407
- } else {
408
- isHostTimeoutScheduled = true;
409
- } // Schedule a timeout.
410
-
411
-
412
- requestHostTimeout(handleTimeout, startTime - currentTime);
413
- }
414
- } else {
415
- newTask.sortIndex = expirationTime;
416
- push(taskQueue, newTask);
417
- // wait until the next time we yield.
418
-
419
-
420
- if (!isHostCallbackScheduled && !isPerformingWork) {
421
- isHostCallbackScheduled = true;
422
- requestHostCallback(flushWork);
423
- }
424
- }
425
-
426
- return newTask;
427
- }
428
-
429
- function unstable_pauseExecution() {
430
- }
431
-
432
- function unstable_continueExecution() {
433
-
434
- if (!isHostCallbackScheduled && !isPerformingWork) {
435
- isHostCallbackScheduled = true;
436
- requestHostCallback(flushWork);
437
- }
438
- }
439
-
440
- function unstable_getFirstCallbackNode() {
441
- return peek(taskQueue);
442
- }
443
-
444
- function unstable_cancelCallback(task) {
445
- // remove from the queue because you can't remove arbitrary nodes from an
446
- // array based heap, only the first one.)
447
-
448
-
449
- task.callback = null;
450
- }
451
-
452
- function unstable_getCurrentPriorityLevel() {
453
- return currentPriorityLevel;
454
- }
455
-
456
- function requestHostCallback(callback) {
457
- scheduledCallback = callback;
458
- }
459
-
460
- function requestHostTimeout(callback, ms) {
461
- scheduledTimeout = callback;
462
- timeoutTime = currentMockTime + ms;
463
- }
464
-
465
- function cancelHostTimeout() {
466
- scheduledTimeout = null;
467
- timeoutTime = -1;
468
- }
469
-
470
- function shouldYieldToHost() {
471
- if (expectedNumberOfYields === 0 && yieldedValues === null || expectedNumberOfYields !== -1 && yieldedValues !== null && yieldedValues.length >= expectedNumberOfYields || shouldYieldForPaint && needsPaint) {
472
- // We yielded at least as many values as expected. Stop flushing.
473
- didStop = true;
474
- return true;
475
- }
476
-
477
- return false;
478
- }
479
-
480
- function getCurrentTime() {
481
- return currentMockTime;
482
- }
483
-
484
- function forceFrameRate() {// No-op
485
- }
486
-
487
- function reset() {
488
- if (isFlushing) {
489
- throw new Error('Cannot reset while already flushing work.');
490
- }
491
-
492
- currentMockTime = 0;
493
- scheduledCallback = null;
494
- scheduledTimeout = null;
495
- timeoutTime = -1;
496
- yieldedValues = null;
497
- expectedNumberOfYields = -1;
498
- didStop = false;
499
- isFlushing = false;
500
- needsPaint = false;
501
- } // Should only be used via an assertion helper that inspects the yielded values.
502
-
503
-
504
- function unstable_flushNumberOfYields(count) {
505
- if (isFlushing) {
506
- throw new Error('Already flushing work.');
507
- }
508
-
509
- if (scheduledCallback !== null) {
510
- var cb = scheduledCallback;
511
- expectedNumberOfYields = count;
512
- isFlushing = true;
513
-
514
- try {
515
- var hasMoreWork = true;
516
-
517
- do {
518
- hasMoreWork = cb(true, currentMockTime);
519
- } while (hasMoreWork && !didStop);
520
-
521
- if (!hasMoreWork) {
522
- scheduledCallback = null;
523
- }
524
- } finally {
525
- expectedNumberOfYields = -1;
526
- didStop = false;
527
- isFlushing = false;
528
- }
529
- }
530
- }
531
-
532
- function unstable_flushUntilNextPaint() {
533
- if (isFlushing) {
534
- throw new Error('Already flushing work.');
535
- }
536
-
537
- if (scheduledCallback !== null) {
538
- var cb = scheduledCallback;
539
- shouldYieldForPaint = true;
540
- needsPaint = false;
541
- isFlushing = true;
542
-
543
- try {
544
- var hasMoreWork = true;
545
-
546
- do {
547
- hasMoreWork = cb(true, currentMockTime);
548
- } while (hasMoreWork && !didStop);
549
-
550
- if (!hasMoreWork) {
551
- scheduledCallback = null;
552
- }
553
- } finally {
554
- shouldYieldForPaint = false;
555
- didStop = false;
556
- isFlushing = false;
557
- }
558
- }
559
- }
560
-
561
- function unstable_flushExpired() {
562
- if (isFlushing) {
563
- throw new Error('Already flushing work.');
564
- }
565
-
566
- if (scheduledCallback !== null) {
567
- isFlushing = true;
568
-
569
- try {
570
- var hasMoreWork = scheduledCallback(false, currentMockTime);
571
-
572
- if (!hasMoreWork) {
573
- scheduledCallback = null;
574
- }
575
- } finally {
576
- isFlushing = false;
577
- }
578
- }
579
- }
580
-
581
- function unstable_flushAllWithoutAsserting() {
582
- // Returns false if no work was flushed.
583
- if (isFlushing) {
584
- throw new Error('Already flushing work.');
585
- }
586
-
587
- if (scheduledCallback !== null) {
588
- var cb = scheduledCallback;
589
- isFlushing = true;
590
-
591
- try {
592
- var hasMoreWork = true;
593
-
594
- do {
595
- hasMoreWork = cb(true, currentMockTime);
596
- } while (hasMoreWork);
597
-
598
- if (!hasMoreWork) {
599
- scheduledCallback = null;
600
- }
601
-
602
- return true;
603
- } finally {
604
- isFlushing = false;
605
- }
606
- } else {
607
- return false;
608
- }
609
- }
610
-
611
- function unstable_clearYields() {
612
- if (yieldedValues === null) {
613
- return [];
614
- }
615
-
616
- var values = yieldedValues;
617
- yieldedValues = null;
618
- return values;
619
- }
620
-
621
- function unstable_flushAll() {
622
- if (yieldedValues !== null) {
623
- throw new Error('Log is not empty. Assert on the log of yielded values before ' + 'flushing additional work.');
624
- }
625
-
626
- unstable_flushAllWithoutAsserting();
627
-
628
- if (yieldedValues !== null) {
629
- throw new Error('While flushing work, something yielded a value. Use an ' + 'assertion helper to assert on the log of yielded values, e.g. ' + 'expect(Scheduler).toFlushAndYield([...])');
630
- }
631
- }
632
-
633
- function unstable_yieldValue(value) {
634
- // eslint-disable-next-line react-internal/no-production-logging
635
- if (console.log.name === 'disabledLog' || disableYieldValue) {
636
- // If console.log has been patched, we assume we're in render
637
- // replaying and we ignore any values yielding in the second pass.
638
- return;
639
- }
640
-
641
- if (yieldedValues === null) {
642
- yieldedValues = [value];
643
- } else {
644
- yieldedValues.push(value);
645
- }
646
- }
647
-
648
- function unstable_advanceTime(ms) {
649
- // eslint-disable-next-line react-internal/no-production-logging
650
- if (console.log.name === 'disabledLog' || disableYieldValue) {
651
- // If console.log has been patched, we assume we're in render
652
- // replaying and we ignore any time advancing in the second pass.
653
- return;
654
- }
655
-
656
- currentMockTime += ms;
657
-
658
- if (scheduledTimeout !== null && timeoutTime <= currentMockTime) {
659
- scheduledTimeout(currentMockTime);
660
- timeoutTime = -1;
661
- scheduledTimeout = null;
662
- }
663
- }
664
-
665
- function requestPaint() {
666
- needsPaint = true;
667
- }
668
- var unstable_Profiling = null;
669
-
670
- exports.reset = reset;
671
- exports.unstable_IdlePriority = IdlePriority;
672
- exports.unstable_ImmediatePriority = ImmediatePriority;
673
- exports.unstable_LowPriority = LowPriority;
674
- exports.unstable_NormalPriority = NormalPriority;
675
- exports.unstable_Profiling = unstable_Profiling;
676
- exports.unstable_UserBlockingPriority = UserBlockingPriority;
677
- exports.unstable_advanceTime = unstable_advanceTime;
678
- exports.unstable_cancelCallback = unstable_cancelCallback;
679
- exports.unstable_clearYields = unstable_clearYields;
680
- exports.unstable_continueExecution = unstable_continueExecution;
681
- exports.unstable_flushAll = unstable_flushAll;
682
- exports.unstable_flushAllWithoutAsserting = unstable_flushAllWithoutAsserting;
683
- exports.unstable_flushExpired = unstable_flushExpired;
684
- exports.unstable_flushNumberOfYields = unstable_flushNumberOfYields;
685
- exports.unstable_flushUntilNextPaint = unstable_flushUntilNextPaint;
686
- exports.unstable_forceFrameRate = forceFrameRate;
687
- exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
688
- exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
689
- exports.unstable_next = unstable_next;
690
- exports.unstable_now = getCurrentTime;
691
- exports.unstable_pauseExecution = unstable_pauseExecution;
692
- exports.unstable_requestPaint = requestPaint;
693
- exports.unstable_runWithPriority = unstable_runWithPriority;
694
- exports.unstable_scheduleCallback = unstable_scheduleCallback;
695
- exports.unstable_setDisableYieldValue = setDisableYieldValue;
696
- exports.unstable_shouldYield = shouldYieldToHost;
697
- exports.unstable_wrapCallback = unstable_wrapCallback;
698
- exports.unstable_yieldValue = unstable_yieldValue;
699
- })();
700
- }
@@ -1,20 +0,0 @@
1
- /**
2
- * @license React
3
- * scheduler-unstable_mock.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */
10
- 'use strict';function f(a,b){var c=a.length;a.push(b);a:for(;0<c;){var d=c-1>>>1,e=a[d];if(0<g(e,b))a[d]=b,a[c]=e,c=d;else break a}}function h(a){return 0===a.length?null:a[0]}function k(a){if(0===a.length)return null;var b=a[0],c=a.pop();if(c!==b){a[0]=c;a:for(var d=0,e=a.length,D=e>>>1;d<D;){var u=2*(d+1)-1,z=a[u],v=u+1,E=a[v];if(0>g(z,c))v<e&&0>g(E,z)?(a[d]=E,a[v]=c,d=v):(a[d]=z,a[u]=c,d=u);else if(v<e&&0>g(E,c))a[d]=E,a[v]=c,d=v;else break a}}return b}
11
- function g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var l=[],m=[],n=1,p=null,q=3,r=!1,t=!1,w=!1,x=0,y=null,A=null,B=-1,C=null,F=-1,G=!1,H=!1,I=!1,J=!1,K=!1;function L(a){for(var b=h(m);null!==b;){if(null===b.callback)k(m);else if(b.startTime<=a)k(m),b.sortIndex=b.expirationTime,f(l,b);else break;b=h(m)}}function M(a){w=!1;L(a);if(!t)if(null!==h(l))t=!0,y=N;else{var b=h(m);null!==b&&(a=b.startTime-a,A=M,B=x+a)}}
12
- function N(a,b){t=!1;w&&(w=!1,A=null,B=-1);r=!0;var c=q;try{L(b);for(p=h(l);null!==p&&(!(p.expirationTime>b)||a&&!O());){var d=p.callback;if("function"===typeof d){p.callback=null;q=p.priorityLevel;var e=d(p.expirationTime<=b);b=x;"function"===typeof e?p.callback=e:p===h(l)&&k(l);L(b)}else k(l);p=h(l)}if(null!==p)var D=!0;else{var u=h(m);if(null!==u){var z=u.startTime-b;A=M;B=x+z}D=!1}return D}finally{p=null,q=c,r=!1}}
13
- function O(){return 0===F&&null===C||-1!==F&&null!==C&&C.length>=F||J&&I?G=!0:!1}function P(){if(H)throw Error("Already flushing work.");if(null!==y){var a=y;H=!0;try{var b=!0;do b=a(!0,x);while(b);b||(y=null);return!0}finally{H=!1}}else return!1}exports.reset=function(){if(H)throw Error("Cannot reset while already flushing work.");x=0;A=y=null;B=-1;C=null;F=-1;I=H=G=!1};exports.unstable_IdlePriority=5;exports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;
14
- exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_advanceTime=function(a){"disabledLog"===console.log.name||K||(x+=a,null!==A&&B<=x&&(A(x),B=-1,A=null))};exports.unstable_cancelCallback=function(a){a.callback=null};exports.unstable_clearYields=function(){if(null===C)return[];var a=C;C=null;return a};exports.unstable_continueExecution=function(){t||r||(t=!0,y=N)};
15
- exports.unstable_flushAll=function(){if(null!==C)throw Error("Log is not empty. Assert on the log of yielded values before flushing additional work.");P();if(null!==C)throw Error("While flushing work, something yielded a value. Use an assertion helper to assert on the log of yielded values, e.g. expect(Scheduler).toFlushAndYield([...])");};exports.unstable_flushAllWithoutAsserting=P;
16
- exports.unstable_flushExpired=function(){if(H)throw Error("Already flushing work.");if(null!==y){H=!0;try{y(!1,x)||(y=null)}finally{H=!1}}};exports.unstable_flushNumberOfYields=function(a){if(H)throw Error("Already flushing work.");if(null!==y){var b=y;F=a;H=!0;try{a=!0;do a=b(!0,x);while(a&&!G);a||(y=null)}finally{F=-1,H=G=!1}}};
17
- exports.unstable_flushUntilNextPaint=function(){if(H)throw Error("Already flushing work.");if(null!==y){var a=y;J=!0;I=!1;H=!0;try{var b=!0;do b=a(!0,x);while(b&&!G);b||(y=null)}finally{H=G=J=!1}}};exports.unstable_forceFrameRate=function(){};exports.unstable_getCurrentPriorityLevel=function(){return q};exports.unstable_getFirstCallbackNode=function(){return h(l)};exports.unstable_next=function(a){switch(q){case 1:case 2:case 3:var b=3;break;default:b=q}var c=q;q=b;try{return a()}finally{q=c}};
18
- exports.unstable_now=function(){return x};exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=function(){I=!0};exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=q;q=a;try{return b()}finally{q=c}};
19
- exports.unstable_scheduleCallback=function(a,b,c){var d=x;"object"===typeof c&&null!==c?(c=c.delay,c="number"===typeof c&&0<c?d+c:d):c=d;switch(a){case 1:var e=-1;break;case 2:e=250;break;case 5:e=1073741823;break;case 4:e=1E4;break;default:e=5E3}e=c+e;a={id:n++,callback:b,priorityLevel:a,startTime:c,expirationTime:e,sortIndex:-1};c>d?(a.sortIndex=c,f(m,a),null===h(l)&&a===h(m)&&(w?(A=null,B=-1):w=!0,A=M,B=x+(c-d))):(a.sortIndex=e,f(l,a),t||r||(t=!0,y=N));return a};
20
- exports.unstable_setDisableYieldValue=function(a){K=a};exports.unstable_shouldYield=O;exports.unstable_wrapCallback=function(a){var b=q;return function(){var c=q;q=b;try{return a.apply(this,arguments)}finally{q=c}}};exports.unstable_yieldValue=function(a){"disabledLog"===console.log.name||K||(null===C?C=[a]:C.push(a))};