mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Minify DEV bundles with closure (#29809)
The goal is to improve speed of the development by inlining and DCE unused branches. We have the ability to preserve some variable names and pretty print in the production version so might as well do the same with DEV. DiffTrain build for commit https://github.com/facebook/react/commit/c2ae9e28bc02fdd29c46b247d908e6b467ef06af.
This commit is contained in:
@@ -1 +1 @@
|
||||
19.0.0-native-fb-20b6f4c0e8-20240607
|
||||
19.0.0-native-fb-c2ae9e28bc-20240608
|
||||
Vendored
+119
-187
@@ -7,197 +7,129 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<a12e42d980c252cd9449b3f2a99f483a>>
|
||||
* @generated SignedSource<<ff1f9a3938ee5baa52e815facaa7d1d1>>
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
if (__DEV__) {
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
// Re-export dynamic flags from the internal module.
|
||||
var enableDebugTracing = false;
|
||||
var enableRenderableContext = true;
|
||||
var enableScopeAPI = false;
|
||||
var enableLegacyHidden = false;
|
||||
var enableTransitionTracing = false;
|
||||
|
||||
// When adding new symbols to this file,
|
||||
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
||||
// The Symbol used to tag the ReactElement-like types.
|
||||
|
||||
var REACT_LEGACY_ELEMENT_TYPE = Symbol.for('react.element');
|
||||
var REACT_ELEMENT_TYPE = REACT_LEGACY_ELEMENT_TYPE;
|
||||
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
||||
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
||||
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
||||
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
||||
var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); // TODO: Delete with enableRenderableContext
|
||||
|
||||
var REACT_CONSUMER_TYPE = Symbol.for('react.consumer');
|
||||
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
||||
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
||||
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
||||
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
||||
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
||||
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
||||
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
||||
|
||||
var REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference'); // This function is deprecated. Don't use. Only the renderer knows what a valid type is.
|
||||
// TODO: Delete this when enableOwnerStacks ships.
|
||||
|
||||
function isValidElementType(type) {
|
||||
if (typeof type === 'string' || typeof type === 'function') {
|
||||
return true;
|
||||
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
||||
|
||||
|
||||
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableTransitionTracing ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (typeof type === 'object' && type !== null) {
|
||||
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || !enableRenderableContext || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
||||
// types supported by any Flight configuration anywhere since
|
||||
// we don't know which Flight build this will end up being used
|
||||
// with.
|
||||
type.$$typeof === REACT_CLIENT_REFERENCE || type.getModuleId !== undefined) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function typeOf(object) {
|
||||
if (typeof object === 'object' && object !== null) {
|
||||
var $$typeof = object.$$typeof;
|
||||
|
||||
switch ($$typeof) {
|
||||
case REACT_ELEMENT_TYPE:
|
||||
var type = object.type;
|
||||
|
||||
switch (type) {
|
||||
case REACT_FRAGMENT_TYPE:
|
||||
case REACT_PROFILER_TYPE:
|
||||
case REACT_STRICT_MODE_TYPE:
|
||||
case REACT_SUSPENSE_TYPE:
|
||||
case REACT_SUSPENSE_LIST_TYPE:
|
||||
return type;
|
||||
|
||||
default:
|
||||
var $$typeofType = type && type.$$typeof;
|
||||
|
||||
switch ($$typeofType) {
|
||||
case REACT_CONTEXT_TYPE:
|
||||
case REACT_FORWARD_REF_TYPE:
|
||||
case REACT_LAZY_TYPE:
|
||||
case REACT_MEMO_TYPE:
|
||||
return $$typeofType;
|
||||
|
||||
case REACT_CONSUMER_TYPE:
|
||||
{
|
||||
return $$typeofType;
|
||||
}
|
||||
|
||||
// Fall through
|
||||
|
||||
case REACT_PROVIDER_TYPE:
|
||||
|
||||
// Fall through
|
||||
|
||||
"use strict";
|
||||
__DEV__ &&
|
||||
(function () {
|
||||
function typeOf(object) {
|
||||
if ("object" === typeof object && null !== object) {
|
||||
var $$typeof = object.$$typeof;
|
||||
switch ($$typeof) {
|
||||
case REACT_ELEMENT_TYPE:
|
||||
switch (((object = object.type), object)) {
|
||||
case REACT_FRAGMENT_TYPE:
|
||||
case REACT_PROFILER_TYPE:
|
||||
case REACT_STRICT_MODE_TYPE:
|
||||
case REACT_SUSPENSE_TYPE:
|
||||
case REACT_SUSPENSE_LIST_TYPE:
|
||||
return object;
|
||||
default:
|
||||
return $$typeof;
|
||||
switch (((object = object && object.$$typeof), object)) {
|
||||
case REACT_CONTEXT_TYPE:
|
||||
case REACT_FORWARD_REF_TYPE:
|
||||
case REACT_LAZY_TYPE:
|
||||
case REACT_MEMO_TYPE:
|
||||
return object;
|
||||
case REACT_CONSUMER_TYPE:
|
||||
return object;
|
||||
default:
|
||||
return $$typeof;
|
||||
}
|
||||
}
|
||||
|
||||
case REACT_PORTAL_TYPE:
|
||||
return $$typeof;
|
||||
}
|
||||
|
||||
case REACT_PORTAL_TYPE:
|
||||
return $$typeof;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
var ContextConsumer = REACT_CONSUMER_TYPE ;
|
||||
var ContextProvider = REACT_CONTEXT_TYPE ;
|
||||
var Element = REACT_ELEMENT_TYPE;
|
||||
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
||||
var Fragment = REACT_FRAGMENT_TYPE;
|
||||
var Lazy = REACT_LAZY_TYPE;
|
||||
var Memo = REACT_MEMO_TYPE;
|
||||
var Portal = REACT_PORTAL_TYPE;
|
||||
var Profiler = REACT_PROFILER_TYPE;
|
||||
var StrictMode = REACT_STRICT_MODE_TYPE;
|
||||
var Suspense = REACT_SUSPENSE_TYPE;
|
||||
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
||||
function isContextConsumer(object) {
|
||||
{
|
||||
return typeOf(object) === REACT_CONSUMER_TYPE;
|
||||
}
|
||||
}
|
||||
function isContextProvider(object) {
|
||||
{
|
||||
return typeOf(object) === REACT_CONTEXT_TYPE;
|
||||
}
|
||||
}
|
||||
function isElement(object) {
|
||||
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
||||
}
|
||||
function isForwardRef(object) {
|
||||
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
||||
}
|
||||
function isFragment(object) {
|
||||
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
||||
}
|
||||
function isLazy(object) {
|
||||
return typeOf(object) === REACT_LAZY_TYPE;
|
||||
}
|
||||
function isMemo(object) {
|
||||
return typeOf(object) === REACT_MEMO_TYPE;
|
||||
}
|
||||
function isPortal(object) {
|
||||
return typeOf(object) === REACT_PORTAL_TYPE;
|
||||
}
|
||||
function isProfiler(object) {
|
||||
return typeOf(object) === REACT_PROFILER_TYPE;
|
||||
}
|
||||
function isStrictMode(object) {
|
||||
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
||||
}
|
||||
function isSuspense(object) {
|
||||
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
||||
}
|
||||
function isSuspenseList(object) {
|
||||
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
||||
}
|
||||
|
||||
exports.ContextConsumer = ContextConsumer;
|
||||
exports.ContextProvider = ContextProvider;
|
||||
exports.Element = Element;
|
||||
exports.ForwardRef = ForwardRef;
|
||||
exports.Fragment = Fragment;
|
||||
exports.Lazy = Lazy;
|
||||
exports.Memo = Memo;
|
||||
exports.Portal = Portal;
|
||||
exports.Profiler = Profiler;
|
||||
exports.StrictMode = StrictMode;
|
||||
exports.Suspense = Suspense;
|
||||
exports.SuspenseList = SuspenseList;
|
||||
exports.isContextConsumer = isContextConsumer;
|
||||
exports.isContextProvider = isContextProvider;
|
||||
exports.isElement = isElement;
|
||||
exports.isForwardRef = isForwardRef;
|
||||
exports.isFragment = isFragment;
|
||||
exports.isLazy = isLazy;
|
||||
exports.isMemo = isMemo;
|
||||
exports.isPortal = isPortal;
|
||||
exports.isProfiler = isProfiler;
|
||||
exports.isStrictMode = isStrictMode;
|
||||
exports.isSuspense = isSuspense;
|
||||
exports.isSuspenseList = isSuspenseList;
|
||||
exports.isValidElementType = isValidElementType;
|
||||
exports.typeOf = typeOf;
|
||||
var REACT_ELEMENT_TYPE = Symbol.for("react.element"),
|
||||
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
||||
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
||||
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
||||
REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
||||
Symbol.for("react.provider");
|
||||
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
||||
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
||||
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
||||
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
||||
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
||||
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
||||
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
||||
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
|
||||
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
|
||||
exports.ContextConsumer = REACT_CONSUMER_TYPE;
|
||||
exports.ContextProvider = REACT_CONTEXT_TYPE;
|
||||
exports.Element = REACT_ELEMENT_TYPE;
|
||||
exports.ForwardRef = REACT_FORWARD_REF_TYPE;
|
||||
exports.Fragment = REACT_FRAGMENT_TYPE;
|
||||
exports.Lazy = REACT_LAZY_TYPE;
|
||||
exports.Memo = REACT_MEMO_TYPE;
|
||||
exports.Portal = REACT_PORTAL_TYPE;
|
||||
exports.Profiler = REACT_PROFILER_TYPE;
|
||||
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
||||
exports.Suspense = REACT_SUSPENSE_TYPE;
|
||||
exports.SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
||||
exports.isContextConsumer = function (object) {
|
||||
return typeOf(object) === REACT_CONSUMER_TYPE;
|
||||
};
|
||||
exports.isContextProvider = function (object) {
|
||||
return typeOf(object) === REACT_CONTEXT_TYPE;
|
||||
};
|
||||
exports.isElement = function (object) {
|
||||
return (
|
||||
"object" === typeof object &&
|
||||
null !== object &&
|
||||
object.$$typeof === REACT_ELEMENT_TYPE
|
||||
);
|
||||
};
|
||||
exports.isForwardRef = function (object) {
|
||||
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
||||
};
|
||||
exports.isFragment = function (object) {
|
||||
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
||||
};
|
||||
exports.isLazy = function (object) {
|
||||
return typeOf(object) === REACT_LAZY_TYPE;
|
||||
};
|
||||
exports.isMemo = function (object) {
|
||||
return typeOf(object) === REACT_MEMO_TYPE;
|
||||
};
|
||||
exports.isPortal = function (object) {
|
||||
return typeOf(object) === REACT_PORTAL_TYPE;
|
||||
};
|
||||
exports.isProfiler = function (object) {
|
||||
return typeOf(object) === REACT_PROFILER_TYPE;
|
||||
};
|
||||
exports.isStrictMode = function (object) {
|
||||
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
||||
};
|
||||
exports.isSuspense = function (object) {
|
||||
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
||||
};
|
||||
exports.isSuspenseList = function (object) {
|
||||
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
||||
};
|
||||
exports.isValidElementType = function (type) {
|
||||
return "string" === typeof type ||
|
||||
"function" === typeof type ||
|
||||
type === REACT_FRAGMENT_TYPE ||
|
||||
type === REACT_PROFILER_TYPE ||
|
||||
type === REACT_STRICT_MODE_TYPE ||
|
||||
type === REACT_SUSPENSE_TYPE ||
|
||||
type === REACT_SUSPENSE_LIST_TYPE ||
|
||||
type === REACT_OFFSCREEN_TYPE ||
|
||||
("object" === typeof type &&
|
||||
null !== type &&
|
||||
(type.$$typeof === REACT_LAZY_TYPE ||
|
||||
type.$$typeof === REACT_MEMO_TYPE ||
|
||||
type.$$typeof === REACT_CONTEXT_TYPE ||
|
||||
type.$$typeof === REACT_CONSUMER_TYPE ||
|
||||
type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
||||
type.$$typeof === REACT_CLIENT_REFERENCE ||
|
||||
void 0 !== type.getModuleId))
|
||||
? !0
|
||||
: !1;
|
||||
};
|
||||
exports.typeOf = typeOf;
|
||||
})();
|
||||
}
|
||||
|
||||
+14821
-24264
File diff suppressed because it is too large
Load Diff
+3
-3
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<f437fde2b5cc5cf271a2b134492f83ff>>
|
||||
* @generated SignedSource<<94e566d67888420f42ff0bda89d3730d>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -9336,7 +9336,7 @@ var devToolsConfig$jscomp$inline_1048 = {
|
||||
throw Error("TestRenderer does not support findFiberByHostInstance()");
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "19.0.0-native-fb-20b6f4c0e8-20240607",
|
||||
version: "19.0.0-native-fb-c2ae9e28bc-20240608",
|
||||
rendererPackageName: "react-test-renderer"
|
||||
};
|
||||
var internals$jscomp$inline_1235 = {
|
||||
@@ -9367,7 +9367,7 @@ var internals$jscomp$inline_1235 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "19.0.0-native-fb-20b6f4c0e8-20240607"
|
||||
reconcilerVersion: "19.0.0-native-fb-c2ae9e28bc-20240608"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1236 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<760cde75b26f1ffde19c02e46adb578b>>
|
||||
* @generated SignedSource<<678dfa2f47293463eb753874b2d99f29>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -9958,7 +9958,7 @@ var devToolsConfig$jscomp$inline_1131 = {
|
||||
throw Error("TestRenderer does not support findFiberByHostInstance()");
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "19.0.0-native-fb-20b6f4c0e8-20240607",
|
||||
version: "19.0.0-native-fb-c2ae9e28bc-20240608",
|
||||
rendererPackageName: "react-test-renderer"
|
||||
};
|
||||
(function (internals) {
|
||||
@@ -10002,7 +10002,7 @@ var devToolsConfig$jscomp$inline_1131 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "19.0.0-native-fb-20b6f4c0e8-20240607"
|
||||
reconcilerVersion: "19.0.0-native-fb-c2ae9e28bc-20240608"
|
||||
});
|
||||
exports._Scheduler = Scheduler;
|
||||
exports.act = act;
|
||||
|
||||
Vendored
+658
-1243
File diff suppressed because it is too large
Load Diff
Vendored
+654
-1261
File diff suppressed because it is too large
Load Diff
+1714
-3054
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<c219dcd8f45478b8be32095daf648132>>
|
||||
* @generated SignedSource<<687486be88a2288bf837e968da348411>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -604,4 +604,4 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactSharedInternals.H.useTransition();
|
||||
};
|
||||
exports.version = "19.0.0-native-fb-20b6f4c0e8-20240607";
|
||||
exports.version = "19.0.0-native-fb-c2ae9e28bc-20240608";
|
||||
|
||||
Vendored
+2
-2
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<6a83e2f57b46ce727606dc77968167b1>>
|
||||
* @generated SignedSource<<c319fe457f80a05776ed11a1b5d8a03d>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -608,7 +608,7 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactSharedInternals.H.useTransition();
|
||||
};
|
||||
exports.version = "19.0.0-native-fb-20b6f4c0e8-20240607";
|
||||
exports.version = "19.0.0-native-fb-c2ae9e28bc-20240608";
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
||||
"function" ===
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
||||
|
||||
Vendored
+349
-606
@@ -7,617 +7,360 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<e367cc047b9d2098d9835d7bb141eaa2>>
|
||||
* @generated SignedSource<<97cdefff67f20a0daa47827b979817a9>>
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
"use strict";
|
||||
__DEV__ &&
|
||||
(function () {
|
||||
function performWorkUntilDeadline() {
|
||||
if (isMessageLoopRunning) {
|
||||
var currentTime = exports.unstable_now();
|
||||
startTime = currentTime;
|
||||
var hasMoreWork = !0;
|
||||
try {
|
||||
a: {
|
||||
isHostCallbackScheduled = !1;
|
||||
isHostTimeoutScheduled &&
|
||||
((isHostTimeoutScheduled = !1),
|
||||
localClearTimeout(taskTimeoutID),
|
||||
(taskTimeoutID = -1));
|
||||
isPerformingWork = !0;
|
||||
var previousPriorityLevel = currentPriorityLevel;
|
||||
try {
|
||||
b: {
|
||||
advanceTimers(currentTime);
|
||||
for (
|
||||
currentTask = peek(taskQueue);
|
||||
null !== currentTask &&
|
||||
!(
|
||||
currentTask.expirationTime > currentTime &&
|
||||
shouldYieldToHost()
|
||||
);
|
||||
|
||||
if (__DEV__) {
|
||||
(function() {
|
||||
'use strict';
|
||||
if (
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
|
||||
'function'
|
||||
) {
|
||||
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
||||
}
|
||||
var enableSchedulerDebugging = false;
|
||||
var enableProfiling = false;
|
||||
var frameYieldMs = 5;
|
||||
var userBlockingPriorityTimeout = 250;
|
||||
var normalPriorityTimeout = 5000;
|
||||
var lowPriorityTimeout = 10000;
|
||||
|
||||
function push(heap, node) {
|
||||
var index = heap.length;
|
||||
heap.push(node);
|
||||
siftUp(heap, node, index);
|
||||
}
|
||||
function peek(heap) {
|
||||
return heap.length === 0 ? null : heap[0];
|
||||
}
|
||||
function pop(heap) {
|
||||
if (heap.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var first = heap[0];
|
||||
var last = heap.pop();
|
||||
|
||||
if (last !== first) {
|
||||
heap[0] = last;
|
||||
siftDown(heap, last, 0);
|
||||
}
|
||||
|
||||
return first;
|
||||
}
|
||||
|
||||
function siftUp(heap, node, i) {
|
||||
var index = i;
|
||||
|
||||
while (index > 0) {
|
||||
var parentIndex = index - 1 >>> 1;
|
||||
var parent = heap[parentIndex];
|
||||
|
||||
if (compare(parent, node) > 0) {
|
||||
// The parent is larger. Swap positions.
|
||||
heap[parentIndex] = node;
|
||||
heap[index] = parent;
|
||||
index = parentIndex;
|
||||
} else {
|
||||
// The parent is smaller. Exit.
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function siftDown(heap, node, i) {
|
||||
var index = i;
|
||||
var length = heap.length;
|
||||
var halfLength = length >>> 1;
|
||||
|
||||
while (index < halfLength) {
|
||||
var leftIndex = (index + 1) * 2 - 1;
|
||||
var left = heap[leftIndex];
|
||||
var rightIndex = leftIndex + 1;
|
||||
var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.
|
||||
|
||||
if (compare(left, node) < 0) {
|
||||
if (rightIndex < length && compare(right, left) < 0) {
|
||||
heap[index] = right;
|
||||
heap[rightIndex] = node;
|
||||
index = rightIndex;
|
||||
} else {
|
||||
heap[index] = left;
|
||||
heap[leftIndex] = node;
|
||||
index = leftIndex;
|
||||
}
|
||||
} else if (rightIndex < length && compare(right, node) < 0) {
|
||||
heap[index] = right;
|
||||
heap[rightIndex] = node;
|
||||
index = rightIndex;
|
||||
} else {
|
||||
// Neither child is smaller. Exit.
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function compare(a, b) {
|
||||
// Compare sort index first, then task id.
|
||||
var diff = a.sortIndex - b.sortIndex;
|
||||
return diff !== 0 ? diff : a.id - b.id;
|
||||
}
|
||||
|
||||
// TODO: Use symbols?
|
||||
var ImmediatePriority = 1;
|
||||
var UserBlockingPriority = 2;
|
||||
var NormalPriority = 3;
|
||||
var LowPriority = 4;
|
||||
var IdlePriority = 5;
|
||||
|
||||
function markTaskErrored(task, ms) {
|
||||
}
|
||||
|
||||
/* eslint-disable no-var */
|
||||
exports.unstable_now = void 0;
|
||||
var hasPerformanceNow = // $FlowFixMe[method-unbinding]
|
||||
typeof performance === 'object' && typeof performance.now === 'function';
|
||||
|
||||
if (hasPerformanceNow) {
|
||||
var localPerformance = performance;
|
||||
|
||||
exports.unstable_now = function () {
|
||||
return localPerformance.now();
|
||||
};
|
||||
} else {
|
||||
var localDate = Date;
|
||||
var initialTime = localDate.now();
|
||||
|
||||
exports.unstable_now = function () {
|
||||
return localDate.now() - initialTime;
|
||||
};
|
||||
} // Max 31 bit integer. The max integer size in V8 for 32-bit systems.
|
||||
// Math.pow(2, 30) - 1
|
||||
// 0b111111111111111111111111111111
|
||||
|
||||
|
||||
var maxSigned31BitInt = 1073741823; // Tasks are stored on a min heap
|
||||
|
||||
var taskQueue = [];
|
||||
var timerQueue = []; // Incrementing id counter. Used to maintain insertion order.
|
||||
|
||||
var taskIdCounter = 1; // Pausing the scheduler is useful for debugging.
|
||||
var currentTask = null;
|
||||
var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrance.
|
||||
|
||||
var isPerformingWork = false;
|
||||
var isHostCallbackScheduled = false;
|
||||
var isHostTimeoutScheduled = false; // Capture local references to native APIs, in case a polyfill overrides them.
|
||||
|
||||
var localSetTimeout = typeof setTimeout === 'function' ? setTimeout : null;
|
||||
var localClearTimeout = typeof clearTimeout === 'function' ? clearTimeout : null;
|
||||
var localSetImmediate = typeof setImmediate !== 'undefined' ? setImmediate : null; // IE and Node.js + jsdom
|
||||
|
||||
function advanceTimers(currentTime) {
|
||||
// Check for tasks that are no longer delayed and add them to the queue.
|
||||
var timer = peek(timerQueue);
|
||||
|
||||
while (timer !== null) {
|
||||
if (timer.callback === null) {
|
||||
// Timer was cancelled.
|
||||
pop(timerQueue);
|
||||
} else if (timer.startTime <= currentTime) {
|
||||
// Timer fired. Transfer to the task queue.
|
||||
pop(timerQueue);
|
||||
timer.sortIndex = timer.expirationTime;
|
||||
push(taskQueue, timer);
|
||||
} else {
|
||||
// Remaining timers are pending.
|
||||
return;
|
||||
}
|
||||
|
||||
timer = peek(timerQueue);
|
||||
}
|
||||
}
|
||||
|
||||
function handleTimeout(currentTime) {
|
||||
isHostTimeoutScheduled = false;
|
||||
advanceTimers(currentTime);
|
||||
|
||||
if (!isHostCallbackScheduled) {
|
||||
if (peek(taskQueue) !== null) {
|
||||
isHostCallbackScheduled = true;
|
||||
requestHostCallback();
|
||||
} else {
|
||||
var firstTimer = peek(timerQueue);
|
||||
|
||||
if (firstTimer !== null) {
|
||||
requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function flushWork(initialTime) {
|
||||
|
||||
|
||||
isHostCallbackScheduled = false;
|
||||
|
||||
if (isHostTimeoutScheduled) {
|
||||
// We scheduled a timeout but it's no longer needed. Cancel it.
|
||||
isHostTimeoutScheduled = false;
|
||||
cancelHostTimeout();
|
||||
}
|
||||
|
||||
isPerformingWork = true;
|
||||
var previousPriorityLevel = currentPriorityLevel;
|
||||
|
||||
try {
|
||||
var currentTime; if (enableProfiling) ; else {
|
||||
// No catch in prod code path.
|
||||
return workLoop(initialTime);
|
||||
}
|
||||
} finally {
|
||||
currentTask = null;
|
||||
currentPriorityLevel = previousPriorityLevel;
|
||||
isPerformingWork = false;
|
||||
}
|
||||
}
|
||||
|
||||
function workLoop(initialTime) {
|
||||
var currentTime = initialTime;
|
||||
advanceTimers(currentTime);
|
||||
currentTask = peek(taskQueue);
|
||||
|
||||
while (currentTask !== null && !(enableSchedulerDebugging )) {
|
||||
if (currentTask.expirationTime > currentTime && shouldYieldToHost()) {
|
||||
// This currentTask hasn't expired, and we've reached the deadline.
|
||||
break;
|
||||
} // $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
|
||||
|
||||
var callback = currentTask.callback;
|
||||
|
||||
if (typeof callback === 'function') {
|
||||
// $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
currentTask.callback = null; // $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
|
||||
currentPriorityLevel = currentTask.priorityLevel; // $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
|
||||
var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
|
||||
|
||||
var continuationCallback = callback(didUserCallbackTimeout);
|
||||
currentTime = exports.unstable_now();
|
||||
|
||||
if (typeof continuationCallback === 'function') {
|
||||
// If a continuation is returned, immediately yield to the main thread
|
||||
// regardless of how much time is left in the current time slice.
|
||||
// $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
currentTask.callback = continuationCallback;
|
||||
|
||||
advanceTimers(currentTime);
|
||||
return true;
|
||||
} else {
|
||||
|
||||
if (currentTask === peek(taskQueue)) {
|
||||
pop(taskQueue);
|
||||
) {
|
||||
var callback = currentTask.callback;
|
||||
if ("function" === typeof callback) {
|
||||
currentTask.callback = null;
|
||||
currentPriorityLevel = currentTask.priorityLevel;
|
||||
var continuationCallback = callback(
|
||||
currentTask.expirationTime <= currentTime
|
||||
);
|
||||
currentTime = exports.unstable_now();
|
||||
if ("function" === typeof continuationCallback) {
|
||||
currentTask.callback = continuationCallback;
|
||||
advanceTimers(currentTime);
|
||||
hasMoreWork = !0;
|
||||
break b;
|
||||
}
|
||||
currentTask === peek(taskQueue) && pop(taskQueue);
|
||||
advanceTimers(currentTime);
|
||||
} else pop(taskQueue);
|
||||
currentTask = peek(taskQueue);
|
||||
}
|
||||
if (null !== currentTask) hasMoreWork = !0;
|
||||
else {
|
||||
var firstTimer = peek(timerQueue);
|
||||
null !== firstTimer &&
|
||||
requestHostTimeout(
|
||||
handleTimeout,
|
||||
firstTimer.startTime - currentTime
|
||||
);
|
||||
hasMoreWork = !1;
|
||||
}
|
||||
}
|
||||
break a;
|
||||
} finally {
|
||||
(currentTask = null),
|
||||
(currentPriorityLevel = previousPriorityLevel),
|
||||
(isPerformingWork = !1);
|
||||
}
|
||||
hasMoreWork = void 0;
|
||||
}
|
||||
} finally {
|
||||
hasMoreWork
|
||||
? schedulePerformWorkUntilDeadline()
|
||||
: (isMessageLoopRunning = !1);
|
||||
}
|
||||
|
||||
advanceTimers(currentTime);
|
||||
}
|
||||
} else {
|
||||
pop(taskQueue);
|
||||
}
|
||||
|
||||
currentTask = peek(taskQueue);
|
||||
} // Return whether there's additional work
|
||||
|
||||
|
||||
if (currentTask !== null) {
|
||||
return true;
|
||||
} else {
|
||||
var firstTimer = peek(timerQueue);
|
||||
|
||||
if (firstTimer !== null) {
|
||||
requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function unstable_runWithPriority(priorityLevel, eventHandler) {
|
||||
switch (priorityLevel) {
|
||||
case ImmediatePriority:
|
||||
case UserBlockingPriority:
|
||||
case NormalPriority:
|
||||
case LowPriority:
|
||||
case IdlePriority:
|
||||
break;
|
||||
|
||||
default:
|
||||
priorityLevel = NormalPriority;
|
||||
}
|
||||
|
||||
var previousPriorityLevel = currentPriorityLevel;
|
||||
currentPriorityLevel = priorityLevel;
|
||||
|
||||
try {
|
||||
return eventHandler();
|
||||
} finally {
|
||||
currentPriorityLevel = previousPriorityLevel;
|
||||
}
|
||||
}
|
||||
|
||||
function unstable_next(eventHandler) {
|
||||
var priorityLevel;
|
||||
|
||||
switch (currentPriorityLevel) {
|
||||
case ImmediatePriority:
|
||||
case UserBlockingPriority:
|
||||
case NormalPriority:
|
||||
// Shift down to normal priority
|
||||
priorityLevel = NormalPriority;
|
||||
break;
|
||||
|
||||
default:
|
||||
// Anything lower than normal priority should remain at the current level.
|
||||
priorityLevel = currentPriorityLevel;
|
||||
break;
|
||||
}
|
||||
|
||||
var previousPriorityLevel = currentPriorityLevel;
|
||||
currentPriorityLevel = priorityLevel;
|
||||
|
||||
try {
|
||||
return eventHandler();
|
||||
} finally {
|
||||
currentPriorityLevel = previousPriorityLevel;
|
||||
}
|
||||
}
|
||||
|
||||
function unstable_wrapCallback(callback) {
|
||||
var parentPriorityLevel = currentPriorityLevel; // $FlowFixMe[incompatible-return]
|
||||
// $FlowFixMe[missing-this-annot]
|
||||
|
||||
return function () {
|
||||
// This is a fork of runWithPriority, inlined for performance.
|
||||
var previousPriorityLevel = currentPriorityLevel;
|
||||
currentPriorityLevel = parentPriorityLevel;
|
||||
|
||||
try {
|
||||
return callback.apply(this, arguments);
|
||||
} finally {
|
||||
currentPriorityLevel = previousPriorityLevel;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function unstable_scheduleCallback(priorityLevel, callback, options) {
|
||||
var currentTime = exports.unstable_now();
|
||||
var startTime;
|
||||
|
||||
if (typeof options === 'object' && options !== null) {
|
||||
var delay = options.delay;
|
||||
|
||||
if (typeof delay === 'number' && delay > 0) {
|
||||
startTime = currentTime + delay;
|
||||
} else {
|
||||
startTime = currentTime;
|
||||
}
|
||||
} else {
|
||||
startTime = currentTime;
|
||||
}
|
||||
|
||||
var timeout;
|
||||
|
||||
switch (priorityLevel) {
|
||||
case ImmediatePriority:
|
||||
// Times out immediately
|
||||
timeout = -1;
|
||||
break;
|
||||
|
||||
case UserBlockingPriority:
|
||||
// Eventually times out
|
||||
timeout = userBlockingPriorityTimeout;
|
||||
break;
|
||||
|
||||
case IdlePriority:
|
||||
// Never times out
|
||||
timeout = maxSigned31BitInt;
|
||||
break;
|
||||
|
||||
case LowPriority:
|
||||
// Eventually times out
|
||||
timeout = lowPriorityTimeout;
|
||||
break;
|
||||
|
||||
case NormalPriority:
|
||||
default:
|
||||
// Eventually times out
|
||||
timeout = normalPriorityTimeout;
|
||||
break;
|
||||
}
|
||||
|
||||
var expirationTime = startTime + timeout;
|
||||
var newTask = {
|
||||
id: taskIdCounter++,
|
||||
callback: callback,
|
||||
priorityLevel: priorityLevel,
|
||||
startTime: startTime,
|
||||
expirationTime: expirationTime,
|
||||
sortIndex: -1
|
||||
};
|
||||
|
||||
if (startTime > currentTime) {
|
||||
// This is a delayed task.
|
||||
newTask.sortIndex = startTime;
|
||||
push(timerQueue, newTask);
|
||||
|
||||
if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
|
||||
// All tasks are delayed, and this is the task with the earliest delay.
|
||||
if (isHostTimeoutScheduled) {
|
||||
// Cancel an existing timeout.
|
||||
cancelHostTimeout();
|
||||
} else {
|
||||
isHostTimeoutScheduled = true;
|
||||
} // Schedule a timeout.
|
||||
|
||||
|
||||
requestHostTimeout(handleTimeout, startTime - currentTime);
|
||||
}
|
||||
} else {
|
||||
newTask.sortIndex = expirationTime;
|
||||
push(taskQueue, newTask);
|
||||
// wait until the next time we yield.
|
||||
|
||||
|
||||
if (!isHostCallbackScheduled && !isPerformingWork) {
|
||||
isHostCallbackScheduled = true;
|
||||
requestHostCallback();
|
||||
}
|
||||
}
|
||||
|
||||
return newTask;
|
||||
}
|
||||
|
||||
function unstable_pauseExecution() {
|
||||
}
|
||||
|
||||
function unstable_continueExecution() {
|
||||
|
||||
if (!isHostCallbackScheduled && !isPerformingWork) {
|
||||
isHostCallbackScheduled = true;
|
||||
requestHostCallback();
|
||||
}
|
||||
}
|
||||
|
||||
function unstable_getFirstCallbackNode() {
|
||||
return peek(taskQueue);
|
||||
}
|
||||
|
||||
function unstable_cancelCallback(task) {
|
||||
// remove from the queue because you can't remove arbitrary nodes from an
|
||||
// array based heap, only the first one.)
|
||||
|
||||
|
||||
task.callback = null;
|
||||
}
|
||||
|
||||
function unstable_getCurrentPriorityLevel() {
|
||||
return currentPriorityLevel;
|
||||
}
|
||||
|
||||
var isMessageLoopRunning = false;
|
||||
var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main
|
||||
// thread, like user events. By default, it yields multiple times per frame.
|
||||
// It does not attempt to align with frame boundaries, since most tasks don't
|
||||
// need to be frame aligned; for those that do, use requestAnimationFrame.
|
||||
|
||||
var frameInterval = frameYieldMs;
|
||||
var startTime = -1;
|
||||
|
||||
function shouldYieldToHost() {
|
||||
var timeElapsed = exports.unstable_now() - startTime;
|
||||
|
||||
if (timeElapsed < frameInterval) {
|
||||
// The main thread has only been blocked for a really short amount of time;
|
||||
// smaller than a single frame. Don't yield yet.
|
||||
return false;
|
||||
} // Yield now.
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function requestPaint() {}
|
||||
|
||||
function forceFrameRate(fps) {
|
||||
if (fps < 0 || fps > 125) {
|
||||
// Using console['error'] to evade Babel and ESLint
|
||||
console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing frame rates higher than 125 fps is not supported');
|
||||
return;
|
||||
}
|
||||
|
||||
if (fps > 0) {
|
||||
frameInterval = Math.floor(1000 / fps);
|
||||
} else {
|
||||
// reset the framerate
|
||||
frameInterval = frameYieldMs;
|
||||
}
|
||||
}
|
||||
|
||||
var performWorkUntilDeadline = function () {
|
||||
if (isMessageLoopRunning) {
|
||||
var currentTime = exports.unstable_now(); // Keep track of the start time so we can measure how long the main thread
|
||||
// has been blocked.
|
||||
|
||||
startTime = currentTime; // If a scheduler task throws, exit the current browser task so the
|
||||
// error can be observed.
|
||||
//
|
||||
// Intentionally not using a try-catch, since that makes some debugging
|
||||
// techniques harder. Instead, if `flushWork` errors, then `hasMoreWork` will
|
||||
// remain true, and we'll continue the work loop.
|
||||
|
||||
var hasMoreWork = true;
|
||||
|
||||
try {
|
||||
hasMoreWork = flushWork(currentTime);
|
||||
} finally {
|
||||
if (hasMoreWork) {
|
||||
// If there's more work, schedule the next message event at the end
|
||||
// of the preceding one.
|
||||
schedulePerformWorkUntilDeadline();
|
||||
} else {
|
||||
isMessageLoopRunning = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var schedulePerformWorkUntilDeadline;
|
||||
|
||||
if (typeof localSetImmediate === 'function') {
|
||||
// Node.js and old IE.
|
||||
// There's a few reasons for why we prefer setImmediate.
|
||||
//
|
||||
// Unlike MessageChannel, it doesn't prevent a Node.js process from exiting.
|
||||
// (Even though this is a DOM fork of the Scheduler, you could get here
|
||||
// with a mix of Node.js 15+, which has a MessageChannel, and jsdom.)
|
||||
// https://github.com/facebook/react/issues/20756
|
||||
//
|
||||
// But also, it runs earlier which is the semantic we want.
|
||||
// If other browsers ever implement it, it's better to use it.
|
||||
// Although both of these would be inferior to native scheduling.
|
||||
schedulePerformWorkUntilDeadline = function () {
|
||||
localSetImmediate(performWorkUntilDeadline);
|
||||
};
|
||||
} else if (typeof MessageChannel !== 'undefined') {
|
||||
// DOM and Worker environments.
|
||||
// We prefer MessageChannel because of the 4ms setTimeout clamping.
|
||||
var channel = new MessageChannel();
|
||||
var port = channel.port2;
|
||||
channel.port1.onmessage = performWorkUntilDeadline;
|
||||
|
||||
schedulePerformWorkUntilDeadline = function () {
|
||||
port.postMessage(null);
|
||||
};
|
||||
} else {
|
||||
// We should only fallback here in non-browser environments.
|
||||
schedulePerformWorkUntilDeadline = function () {
|
||||
// $FlowFixMe[not-a-function] nullable value
|
||||
localSetTimeout(performWorkUntilDeadline, 0);
|
||||
};
|
||||
}
|
||||
|
||||
function requestHostCallback() {
|
||||
if (!isMessageLoopRunning) {
|
||||
isMessageLoopRunning = true;
|
||||
schedulePerformWorkUntilDeadline();
|
||||
}
|
||||
}
|
||||
|
||||
function requestHostTimeout(callback, ms) {
|
||||
// $FlowFixMe[not-a-function] nullable value
|
||||
taskTimeoutID = localSetTimeout(function () {
|
||||
callback(exports.unstable_now());
|
||||
}, ms);
|
||||
}
|
||||
|
||||
function cancelHostTimeout() {
|
||||
// $FlowFixMe[not-a-function] nullable value
|
||||
localClearTimeout(taskTimeoutID);
|
||||
taskTimeoutID = -1;
|
||||
}
|
||||
var unstable_Profiling = null;
|
||||
|
||||
exports.unstable_IdlePriority = IdlePriority;
|
||||
exports.unstable_ImmediatePriority = ImmediatePriority;
|
||||
exports.unstable_LowPriority = LowPriority;
|
||||
exports.unstable_NormalPriority = NormalPriority;
|
||||
exports.unstable_Profiling = unstable_Profiling;
|
||||
exports.unstable_UserBlockingPriority = UserBlockingPriority;
|
||||
exports.unstable_cancelCallback = unstable_cancelCallback;
|
||||
exports.unstable_continueExecution = unstable_continueExecution;
|
||||
exports.unstable_forceFrameRate = forceFrameRate;
|
||||
exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
|
||||
exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
|
||||
exports.unstable_next = unstable_next;
|
||||
exports.unstable_pauseExecution = unstable_pauseExecution;
|
||||
exports.unstable_requestPaint = requestPaint;
|
||||
exports.unstable_runWithPriority = unstable_runWithPriority;
|
||||
exports.unstable_scheduleCallback = unstable_scheduleCallback;
|
||||
exports.unstable_shouldYield = shouldYieldToHost;
|
||||
exports.unstable_wrapCallback = unstable_wrapCallback;
|
||||
if (
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
|
||||
'function'
|
||||
) {
|
||||
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
||||
}
|
||||
function push(heap, node) {
|
||||
var index = heap.length;
|
||||
heap.push(node);
|
||||
a: for (; 0 < index; ) {
|
||||
var parentIndex = (index - 1) >>> 1,
|
||||
parent = heap[parentIndex];
|
||||
if (0 < compare(parent, node))
|
||||
(heap[parentIndex] = node),
|
||||
(heap[index] = parent),
|
||||
(index = parentIndex);
|
||||
else break a;
|
||||
}
|
||||
}
|
||||
function peek(heap) {
|
||||
return 0 === heap.length ? null : heap[0];
|
||||
}
|
||||
function pop(heap) {
|
||||
if (0 === heap.length) return null;
|
||||
var first = heap[0],
|
||||
last = heap.pop();
|
||||
if (last !== first) {
|
||||
heap[0] = last;
|
||||
a: for (
|
||||
var index = 0, length = heap.length, halfLength = length >>> 1;
|
||||
index < halfLength;
|
||||
|
||||
) {
|
||||
var leftIndex = 2 * (index + 1) - 1,
|
||||
left = heap[leftIndex],
|
||||
rightIndex = leftIndex + 1,
|
||||
right = heap[rightIndex];
|
||||
if (0 > compare(left, last))
|
||||
rightIndex < length && 0 > compare(right, left)
|
||||
? ((heap[index] = right),
|
||||
(heap[rightIndex] = last),
|
||||
(index = rightIndex))
|
||||
: ((heap[index] = left),
|
||||
(heap[leftIndex] = last),
|
||||
(index = leftIndex));
|
||||
else if (rightIndex < length && 0 > compare(right, last))
|
||||
(heap[index] = right),
|
||||
(heap[rightIndex] = last),
|
||||
(index = rightIndex);
|
||||
else break a;
|
||||
}
|
||||
}
|
||||
return first;
|
||||
}
|
||||
function compare(a, b) {
|
||||
var diff = a.sortIndex - b.sortIndex;
|
||||
return 0 !== diff ? diff : a.id - b.id;
|
||||
}
|
||||
function advanceTimers(currentTime) {
|
||||
for (var timer = peek(timerQueue); null !== timer; ) {
|
||||
if (null === timer.callback) pop(timerQueue);
|
||||
else if (timer.startTime <= currentTime)
|
||||
pop(timerQueue),
|
||||
(timer.sortIndex = timer.expirationTime),
|
||||
push(taskQueue, timer);
|
||||
else break;
|
||||
timer = peek(timerQueue);
|
||||
}
|
||||
}
|
||||
function handleTimeout(currentTime) {
|
||||
isHostTimeoutScheduled = !1;
|
||||
advanceTimers(currentTime);
|
||||
if (!isHostCallbackScheduled)
|
||||
if (null !== peek(taskQueue))
|
||||
(isHostCallbackScheduled = !0), requestHostCallback();
|
||||
else {
|
||||
var firstTimer = peek(timerQueue);
|
||||
null !== firstTimer &&
|
||||
requestHostTimeout(
|
||||
handleTimeout,
|
||||
firstTimer.startTime - currentTime
|
||||
);
|
||||
}
|
||||
}
|
||||
function shouldYieldToHost() {
|
||||
return exports.unstable_now() - startTime < frameInterval ? !1 : !0;
|
||||
}
|
||||
function requestHostCallback() {
|
||||
isMessageLoopRunning ||
|
||||
((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline());
|
||||
}
|
||||
function requestHostTimeout(callback, ms) {
|
||||
taskTimeoutID = localSetTimeout(function () {
|
||||
callback(exports.unstable_now());
|
||||
}, ms);
|
||||
}
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
||||
"function" ===
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
|
||||
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
||||
exports.unstable_now = void 0;
|
||||
if (
|
||||
"object" === typeof performance &&
|
||||
"function" === typeof performance.now
|
||||
) {
|
||||
var localPerformance = performance;
|
||||
exports.unstable_now = function () {
|
||||
return localPerformance.now();
|
||||
};
|
||||
} else {
|
||||
var localDate = Date,
|
||||
initialTime = localDate.now();
|
||||
exports.unstable_now = function () {
|
||||
return localDate.now() - initialTime;
|
||||
};
|
||||
}
|
||||
var taskQueue = [],
|
||||
timerQueue = [],
|
||||
taskIdCounter = 1,
|
||||
currentTask = null,
|
||||
currentPriorityLevel = 3,
|
||||
isPerformingWork = !1,
|
||||
isHostCallbackScheduled = !1,
|
||||
isHostTimeoutScheduled = !1,
|
||||
localSetTimeout = "function" === typeof setTimeout ? setTimeout : null,
|
||||
localClearTimeout =
|
||||
"function" === typeof clearTimeout ? clearTimeout : null,
|
||||
localSetImmediate =
|
||||
"undefined" !== typeof setImmediate ? setImmediate : null,
|
||||
isMessageLoopRunning = !1,
|
||||
taskTimeoutID = -1,
|
||||
frameInterval = 5,
|
||||
startTime = -1;
|
||||
if ("function" === typeof localSetImmediate)
|
||||
var schedulePerformWorkUntilDeadline = function () {
|
||||
localSetImmediate(performWorkUntilDeadline);
|
||||
};
|
||||
else if ("undefined" !== typeof MessageChannel) {
|
||||
var channel = new MessageChannel(),
|
||||
port = channel.port2;
|
||||
channel.port1.onmessage = performWorkUntilDeadline;
|
||||
schedulePerformWorkUntilDeadline = function () {
|
||||
port.postMessage(null);
|
||||
};
|
||||
} else
|
||||
schedulePerformWorkUntilDeadline = function () {
|
||||
localSetTimeout(performWorkUntilDeadline, 0);
|
||||
};
|
||||
exports.unstable_IdlePriority = 5;
|
||||
exports.unstable_ImmediatePriority = 1;
|
||||
exports.unstable_LowPriority = 4;
|
||||
exports.unstable_NormalPriority = 3;
|
||||
exports.unstable_Profiling = null;
|
||||
exports.unstable_UserBlockingPriority = 2;
|
||||
exports.unstable_cancelCallback = function (task) {
|
||||
task.callback = null;
|
||||
};
|
||||
exports.unstable_continueExecution = function () {
|
||||
isHostCallbackScheduled ||
|
||||
isPerformingWork ||
|
||||
((isHostCallbackScheduled = !0), requestHostCallback());
|
||||
};
|
||||
exports.unstable_forceFrameRate = function (fps) {
|
||||
0 > fps || 125 < fps
|
||||
? console.error(
|
||||
"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"
|
||||
)
|
||||
: (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5);
|
||||
};
|
||||
exports.unstable_getCurrentPriorityLevel = function () {
|
||||
return currentPriorityLevel;
|
||||
};
|
||||
exports.unstable_getFirstCallbackNode = function () {
|
||||
return peek(taskQueue);
|
||||
};
|
||||
exports.unstable_next = function (eventHandler) {
|
||||
switch (currentPriorityLevel) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
var priorityLevel = 3;
|
||||
break;
|
||||
default:
|
||||
priorityLevel = currentPriorityLevel;
|
||||
}
|
||||
var previousPriorityLevel = currentPriorityLevel;
|
||||
currentPriorityLevel = priorityLevel;
|
||||
try {
|
||||
return eventHandler();
|
||||
} finally {
|
||||
currentPriorityLevel = previousPriorityLevel;
|
||||
}
|
||||
};
|
||||
exports.unstable_pauseExecution = function () {};
|
||||
exports.unstable_requestPaint = function () {};
|
||||
exports.unstable_runWithPriority = function (priorityLevel, eventHandler) {
|
||||
switch (priorityLevel) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
break;
|
||||
default:
|
||||
priorityLevel = 3;
|
||||
}
|
||||
var previousPriorityLevel = currentPriorityLevel;
|
||||
currentPriorityLevel = priorityLevel;
|
||||
try {
|
||||
return eventHandler();
|
||||
} finally {
|
||||
currentPriorityLevel = previousPriorityLevel;
|
||||
}
|
||||
};
|
||||
exports.unstable_scheduleCallback = function (
|
||||
priorityLevel,
|
||||
callback,
|
||||
options
|
||||
) {
|
||||
var currentTime = exports.unstable_now();
|
||||
"object" === typeof options && null !== options
|
||||
? ((options = options.delay),
|
||||
(options =
|
||||
"number" === typeof options && 0 < options
|
||||
? currentTime + options
|
||||
: currentTime))
|
||||
: (options = currentTime);
|
||||
switch (priorityLevel) {
|
||||
case 1:
|
||||
var timeout = -1;
|
||||
break;
|
||||
case 2:
|
||||
timeout = 250;
|
||||
break;
|
||||
case 5:
|
||||
timeout = 1073741823;
|
||||
break;
|
||||
case 4:
|
||||
timeout = 1e4;
|
||||
break;
|
||||
default:
|
||||
timeout = 5e3;
|
||||
}
|
||||
timeout = options + timeout;
|
||||
priorityLevel = {
|
||||
id: taskIdCounter++,
|
||||
callback: callback,
|
||||
priorityLevel: priorityLevel,
|
||||
startTime: options,
|
||||
expirationTime: timeout,
|
||||
sortIndex: -1
|
||||
};
|
||||
options > currentTime
|
||||
? ((priorityLevel.sortIndex = options),
|
||||
push(timerQueue, priorityLevel),
|
||||
null === peek(taskQueue) &&
|
||||
priorityLevel === peek(timerQueue) &&
|
||||
(isHostTimeoutScheduled
|
||||
? (localClearTimeout(taskTimeoutID), (taskTimeoutID = -1))
|
||||
: (isHostTimeoutScheduled = !0),
|
||||
requestHostTimeout(handleTimeout, options - currentTime)))
|
||||
: ((priorityLevel.sortIndex = timeout),
|
||||
push(taskQueue, priorityLevel),
|
||||
isHostCallbackScheduled ||
|
||||
isPerformingWork ||
|
||||
((isHostCallbackScheduled = !0), requestHostCallback()));
|
||||
return priorityLevel;
|
||||
};
|
||||
exports.unstable_shouldYield = shouldYieldToHost;
|
||||
exports.unstable_wrapCallback = function (callback) {
|
||||
var parentPriorityLevel = currentPriorityLevel;
|
||||
return function () {
|
||||
var previousPriorityLevel = currentPriorityLevel;
|
||||
currentPriorityLevel = parentPriorityLevel;
|
||||
try {
|
||||
return callback.apply(this, arguments);
|
||||
} finally {
|
||||
currentPriorityLevel = previousPriorityLevel;
|
||||
}
|
||||
};
|
||||
};
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
||||
"function" ===
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
||||
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
||||
})();
|
||||
}
|
||||
|
||||
Vendored
+398
-686
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1 +1 @@
|
||||
20b6f4c0e8a1f40ee61735201645e0395ff08f94
|
||||
c2ae9e28bc02fdd29c46b247d908e6b467ef06af
|
||||
|
||||
+16586
-26988
File diff suppressed because it is too large
Load Diff
+3
-3
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<7a96adf78698dcde93c8ad299e54be2b>>
|
||||
* @generated SignedSource<<ea6890c87efa5d14885328ddaee860c2>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -10591,7 +10591,7 @@ var roots = new Map(),
|
||||
devToolsConfig$jscomp$inline_1125 = {
|
||||
findFiberByHostInstance: getInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "19.0.0-native-fb-20b6f4c0e8-20240607",
|
||||
version: "19.0.0-native-fb-c2ae9e28bc-20240608",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
rendererConfig: {
|
||||
getInspectorDataForInstance: getInspectorDataForInstance,
|
||||
@@ -10634,7 +10634,7 @@ var internals$jscomp$inline_1351 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "19.0.0-native-fb-20b6f4c0e8-20240607"
|
||||
reconcilerVersion: "19.0.0-native-fb-c2ae9e28bc-20240608"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1352 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<7ac37d27a4198431b2b746eb7d1d5ab8>>
|
||||
* @generated SignedSource<<7fd5ac66b459be2afab17b96cc3b9c3f>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -11297,7 +11297,7 @@ var roots = new Map(),
|
||||
devToolsConfig$jscomp$inline_1206 = {
|
||||
findFiberByHostInstance: getInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "19.0.0-native-fb-20b6f4c0e8-20240607",
|
||||
version: "19.0.0-native-fb-c2ae9e28bc-20240608",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
rendererConfig: {
|
||||
getInspectorDataForInstance: getInspectorDataForInstance,
|
||||
@@ -11353,7 +11353,7 @@ var roots = new Map(),
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "19.0.0-native-fb-20b6f4c0e8-20240607"
|
||||
reconcilerVersion: "19.0.0-native-fb-c2ae9e28bc-20240608"
|
||||
});
|
||||
exports.createPortal = function (children, containerTag) {
|
||||
return createPortal$1(
|
||||
|
||||
+16820
-27371
File diff suppressed because it is too large
Load Diff
+5
-5
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<884b6db437cfb8f0d1cce5e8240b4b72>>
|
||||
* @generated SignedSource<<6ff26ef1a8a3cfba4eb6fc6d57c15efa>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -10734,11 +10734,11 @@ function traverseOwnerTreeUp(hierarchy, instance) {
|
||||
traverseOwnerTreeUp(hierarchy, instance);
|
||||
}
|
||||
var isomorphicReactPackageVersion = React.version;
|
||||
if ("19.0.0-native-fb-20b6f4c0e8-20240607" !== isomorphicReactPackageVersion)
|
||||
if ("19.0.0-native-fb-c2ae9e28bc-20240608" !== isomorphicReactPackageVersion)
|
||||
throw Error(
|
||||
'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
|
||||
(isomorphicReactPackageVersion +
|
||||
"\n - react-native-renderer: 19.0.0-native-fb-20b6f4c0e8-20240607\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
"\n - react-native-renderer: 19.0.0-native-fb-c2ae9e28bc-20240608\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
);
|
||||
if (
|
||||
"function" !==
|
||||
@@ -10788,7 +10788,7 @@ var roots = new Map(),
|
||||
devToolsConfig$jscomp$inline_1193 = {
|
||||
findFiberByHostInstance: getInstanceFromTag,
|
||||
bundleType: 0,
|
||||
version: "19.0.0-native-fb-20b6f4c0e8-20240607",
|
||||
version: "19.0.0-native-fb-c2ae9e28bc-20240608",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
rendererConfig: {
|
||||
getInspectorDataForInstance: getInspectorDataForInstance,
|
||||
@@ -10831,7 +10831,7 @@ var internals$jscomp$inline_1440 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "19.0.0-native-fb-20b6f4c0e8-20240607"
|
||||
reconcilerVersion: "19.0.0-native-fb-c2ae9e28bc-20240608"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1441 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
|
||||
+5
-5
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<c0b5a3fafeea8705ed777b3e03855efe>>
|
||||
* @generated SignedSource<<1710d1e9b64d9f929fc8950c733c6777>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -11441,11 +11441,11 @@ function traverseOwnerTreeUp(hierarchy, instance) {
|
||||
traverseOwnerTreeUp(hierarchy, instance);
|
||||
}
|
||||
var isomorphicReactPackageVersion = React.version;
|
||||
if ("19.0.0-native-fb-20b6f4c0e8-20240607" !== isomorphicReactPackageVersion)
|
||||
if ("19.0.0-native-fb-c2ae9e28bc-20240608" !== isomorphicReactPackageVersion)
|
||||
throw Error(
|
||||
'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
|
||||
(isomorphicReactPackageVersion +
|
||||
"\n - react-native-renderer: 19.0.0-native-fb-20b6f4c0e8-20240607\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
"\n - react-native-renderer: 19.0.0-native-fb-c2ae9e28bc-20240608\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
);
|
||||
if (
|
||||
"function" !==
|
||||
@@ -11495,7 +11495,7 @@ var roots = new Map(),
|
||||
devToolsConfig$jscomp$inline_1274 = {
|
||||
findFiberByHostInstance: getInstanceFromTag,
|
||||
bundleType: 0,
|
||||
version: "19.0.0-native-fb-20b6f4c0e8-20240607",
|
||||
version: "19.0.0-native-fb-c2ae9e28bc-20240608",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
rendererConfig: {
|
||||
getInspectorDataForInstance: getInspectorDataForInstance,
|
||||
@@ -11551,7 +11551,7 @@ var roots = new Map(),
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "19.0.0-native-fb-20b6f4c0e8-20240607"
|
||||
reconcilerVersion: "19.0.0-native-fb-c2ae9e28bc-20240608"
|
||||
});
|
||||
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
|
||||
computeComponentStackForErrorReporting: function (reactTag) {
|
||||
|
||||
Reference in New Issue
Block a user