@expo/cli 1.0.0-canary-20250404-3c3b5fd → 1.0.0-canary-20250701-6a945c5

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