scheduler
Advanced tools
Comparing version 0.0.0-experimental-68dbd84b-20240812 to 0.0.0-experimental-6907aa2a-20241220
@@ -235,7 +235,2 @@ /** | ||
}; | ||
exports.unstable_continueExecution = function () { | ||
isHostCallbackScheduled || | ||
isPerformingWork || | ||
((isHostCallbackScheduled = !0), (scheduledCallback = flushWork)); | ||
}; | ||
exports.unstable_flushAll = function () { | ||
@@ -303,5 +298,2 @@ if (null !== yieldedValues) | ||
}; | ||
exports.unstable_getFirstCallbackNode = function () { | ||
return peek(taskQueue); | ||
}; | ||
exports.unstable_hasPendingWork = function () { | ||
@@ -331,3 +323,2 @@ return null !== scheduledCallback; | ||
}; | ||
exports.unstable_pauseExecution = function () {}; | ||
exports.unstable_requestPaint = function () { | ||
@@ -334,0 +325,0 @@ needsPaint = !0; |
@@ -229,7 +229,2 @@ /** | ||
}; | ||
exports.unstable_continueExecution = function () { | ||
isHostCallbackScheduled || | ||
isPerformingWork || | ||
((isHostCallbackScheduled = !0), (scheduledCallback = flushWork)); | ||
}; | ||
exports.unstable_flushAll = function () { | ||
@@ -296,5 +291,2 @@ if (null !== yieldedValues) | ||
}; | ||
exports.unstable_getFirstCallbackNode = function () { | ||
return peek(taskQueue); | ||
}; | ||
exports.unstable_hasPendingWork = function () { | ||
@@ -324,3 +316,2 @@ return null !== scheduledCallback; | ||
}; | ||
exports.unstable_pauseExecution = function () {}; | ||
exports.unstable_requestPaint = function () { | ||
@@ -327,0 +318,0 @@ needsPaint = !0; |
@@ -61,3 +61,2 @@ /** | ||
}; | ||
exports.unstable_continueExecution = function () {}; | ||
exports.unstable_forceFrameRate = function () {}; | ||
@@ -67,5 +66,2 @@ exports.unstable_getCurrentPriorityLevel = function () { | ||
}; | ||
exports.unstable_getFirstCallbackNode = function () { | ||
return null; | ||
}; | ||
exports.unstable_next = function (callback) { | ||
@@ -90,3 +86,2 @@ switch (currentPriorityLevel_DEPRECATED) { | ||
exports.unstable_now = getCurrentTime; | ||
exports.unstable_pauseExecution = function () {}; | ||
exports.unstable_requestPaint = function () {}; | ||
@@ -93,0 +88,0 @@ exports.unstable_runWithPriority = function (priorityLevel, callback) { |
@@ -59,3 +59,2 @@ /** | ||
}; | ||
exports.unstable_continueExecution = function () {}; | ||
exports.unstable_forceFrameRate = function () {}; | ||
@@ -65,5 +64,2 @@ exports.unstable_getCurrentPriorityLevel = function () { | ||
}; | ||
exports.unstable_getFirstCallbackNode = function () { | ||
return null; | ||
}; | ||
exports.unstable_next = function (callback) { | ||
@@ -88,3 +84,2 @@ switch (currentPriorityLevel_DEPRECATED) { | ||
exports.unstable_now = getCurrentTime; | ||
exports.unstable_pauseExecution = function () {}; | ||
exports.unstable_requestPaint = function () {}; | ||
@@ -91,0 +86,0 @@ exports.unstable_runWithPriority = function (priorityLevel, callback) { |
@@ -31,11 +31,3 @@ /** | ||
advanceTimers(currentTime); | ||
for ( | ||
currentTask = peek(taskQueue); | ||
null !== currentTask && | ||
!( | ||
currentTask.expirationTime > currentTime && | ||
shouldYieldToHost() | ||
); | ||
) { | ||
for (currentTask = peek(taskQueue); null !== currentTask; ) { | ||
var callback = currentTask.callback; | ||
@@ -59,2 +51,7 @@ if ("function" === typeof callback) { | ||
currentTask = peek(taskQueue); | ||
if ( | ||
null === currentTask || | ||
currentTask.expirationTime > currentTime | ||
) | ||
break; | ||
} | ||
@@ -155,3 +152,5 @@ if (null !== currentTask) hasMoreWork = !0; | ||
if (null !== peek(taskQueue)) | ||
(isHostCallbackScheduled = !0), requestHostCallback(); | ||
(isHostCallbackScheduled = !0), | ||
isMessageLoopRunning || | ||
((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline()); | ||
else { | ||
@@ -166,9 +165,2 @@ var firstTimer = peek(timerQueue); | ||
} | ||
function shouldYieldToHost() { | ||
return exports.unstable_now() - startTime < frameInterval ? !1 : !0; | ||
} | ||
function requestHostCallback() { | ||
isMessageLoopRunning || | ||
((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline()); | ||
} | ||
function requestHostTimeout(callback, ms) { | ||
@@ -240,7 +232,2 @@ taskTimeoutID = localSetTimeout(function () { | ||
}; | ||
exports.unstable_continueExecution = function () { | ||
isHostCallbackScheduled || | ||
isPerformingWork || | ||
((isHostCallbackScheduled = !0), requestHostCallback()); | ||
}; | ||
exports.unstable_forceFrameRate = function (fps) { | ||
@@ -256,5 +243,2 @@ 0 > fps || 125 < fps | ||
}; | ||
exports.unstable_getFirstCallbackNode = function () { | ||
return peek(taskQueue); | ||
}; | ||
exports.unstable_next = function (eventHandler) { | ||
@@ -278,3 +262,2 @@ switch (currentPriorityLevel) { | ||
}; | ||
exports.unstable_pauseExecution = function () {}; | ||
exports.unstable_requestPaint = function () {}; | ||
@@ -351,6 +334,11 @@ exports.unstable_runWithPriority = function (priorityLevel, eventHandler) { | ||
isPerformingWork || | ||
((isHostCallbackScheduled = !0), requestHostCallback())); | ||
((isHostCallbackScheduled = !0), | ||
isMessageLoopRunning || | ||
((isMessageLoopRunning = !0), | ||
schedulePerformWorkUntilDeadline()))); | ||
return priorityLevel; | ||
}; | ||
exports.unstable_shouldYield = shouldYieldToHost; | ||
exports.unstable_shouldYield = function () { | ||
return exports.unstable_now() - startTime < frameInterval ? !1 : !0; | ||
}; | ||
exports.unstable_wrapCallback = function (callback) { | ||
@@ -357,0 +345,0 @@ var parentPriorityLevel = currentPriorityLevel; |
@@ -31,11 +31,3 @@ /** | ||
advanceTimers(currentTime); | ||
for ( | ||
currentTask = peek(taskQueue); | ||
null !== currentTask && | ||
!( | ||
currentTask.expirationTime > currentTime && | ||
shouldYieldToHost() | ||
); | ||
) { | ||
for (currentTask = peek(taskQueue); null !== currentTask; ) { | ||
var callback = currentTask.callback; | ||
@@ -59,2 +51,7 @@ if ("function" === typeof callback) { | ||
currentTask = peek(taskQueue); | ||
if ( | ||
null === currentTask || | ||
currentTask.expirationTime > currentTime | ||
) | ||
break; | ||
} | ||
@@ -227,3 +224,3 @@ if (null !== currentTask) hasMoreWork = !0; | ||
function shouldYieldToHost() { | ||
return getCurrentTime() - startTime < frameInterval ? !1 : !0; | ||
return 5 > getCurrentTime() - startTime ? !1 : !0; | ||
} | ||
@@ -269,3 +266,2 @@ function requestPaint() {} | ||
taskTimeoutID = -1, | ||
frameInterval = 5, | ||
startTime = -1; | ||
@@ -337,9 +333,6 @@ if ("function" === typeof localSetImmediate) | ||
exports.unstable_cancelCallback = unstable_cancelCallback; | ||
exports.unstable_continueExecution = throwNotImplemented; | ||
exports.unstable_forceFrameRate = throwNotImplemented; | ||
exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel; | ||
exports.unstable_getFirstCallbackNode = throwNotImplemented; | ||
exports.unstable_next = throwNotImplemented; | ||
exports.unstable_now = unstable_now; | ||
exports.unstable_pauseExecution = throwNotImplemented; | ||
exports.unstable_requestPaint = unstable_requestPaint; | ||
@@ -346,0 +339,0 @@ exports.unstable_runWithPriority = throwNotImplemented; |
@@ -191,10 +191,3 @@ /** | ||
advanceTimers(currentTime); | ||
for ( | ||
currentTask = peek(taskQueue); | ||
null !== currentTask && | ||
!( | ||
currentTask.expirationTime > currentTime && shouldYieldToHost() | ||
); | ||
) { | ||
for (currentTask = peek(taskQueue); null !== currentTask; ) { | ||
var callback = currentTask.callback; | ||
@@ -218,2 +211,7 @@ if ("function" === typeof callback) { | ||
currentTask = peek(taskQueue); | ||
if ( | ||
null === currentTask || | ||
currentTask.expirationTime > currentTime | ||
) | ||
break; | ||
} | ||
@@ -320,9 +318,6 @@ if (null !== currentTask) hasMoreWork = !0; | ||
exports.unstable_cancelCallback = unstable_cancelCallback; | ||
exports.unstable_continueExecution = throwNotImplemented; | ||
exports.unstable_forceFrameRate = throwNotImplemented; | ||
exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel; | ||
exports.unstable_getFirstCallbackNode = throwNotImplemented; | ||
exports.unstable_next = throwNotImplemented; | ||
exports.unstable_now = unstable_now; | ||
exports.unstable_pauseExecution = throwNotImplemented; | ||
exports.unstable_requestPaint = unstable_requestPaint; | ||
@@ -329,0 +324,0 @@ exports.unstable_runWithPriority = throwNotImplemented; |
@@ -100,3 +100,5 @@ /** | ||
if (null !== peek(taskQueue)) | ||
(isHostCallbackScheduled = !0), requestHostCallback(); | ||
(isHostCallbackScheduled = !0), | ||
isMessageLoopRunning || | ||
((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline()); | ||
else { | ||
@@ -112,5 +114,2 @@ var firstTimer = peek(timerQueue); | ||
startTime = -1; | ||
function shouldYieldToHost() { | ||
return exports.unstable_now() - startTime < frameInterval ? !1 : !0; | ||
} | ||
function performWorkUntilDeadline() { | ||
@@ -133,10 +132,3 @@ if (isMessageLoopRunning) { | ||
advanceTimers(currentTime); | ||
for ( | ||
currentTask = peek(taskQueue); | ||
null !== currentTask && | ||
!( | ||
currentTask.expirationTime > currentTime && shouldYieldToHost() | ||
); | ||
) { | ||
for (currentTask = peek(taskQueue); null !== currentTask; ) { | ||
var callback = currentTask.callback; | ||
@@ -160,2 +152,7 @@ if ("function" === typeof callback) { | ||
currentTask = peek(taskQueue); | ||
if ( | ||
null === currentTask || | ||
currentTask.expirationTime > currentTime | ||
) | ||
break; | ||
} | ||
@@ -204,6 +201,2 @@ if (null !== currentTask) hasMoreWork = !0; | ||
}; | ||
function requestHostCallback() { | ||
isMessageLoopRunning || | ||
((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline()); | ||
} | ||
function requestHostTimeout(callback, ms) { | ||
@@ -223,7 +216,2 @@ taskTimeoutID = localSetTimeout(function () { | ||
}; | ||
exports.unstable_continueExecution = function () { | ||
isHostCallbackScheduled || | ||
isPerformingWork || | ||
((isHostCallbackScheduled = !0), requestHostCallback()); | ||
}; | ||
exports.unstable_forceFrameRate = function (fps) { | ||
@@ -239,5 +227,2 @@ 0 > fps || 125 < fps | ||
}; | ||
exports.unstable_getFirstCallbackNode = function () { | ||
return peek(taskQueue); | ||
}; | ||
exports.unstable_next = function (eventHandler) { | ||
@@ -261,3 +246,2 @@ switch (currentPriorityLevel) { | ||
}; | ||
exports.unstable_pauseExecution = function () {}; | ||
exports.unstable_requestPaint = function () {}; | ||
@@ -334,6 +318,10 @@ exports.unstable_runWithPriority = function (priorityLevel, eventHandler) { | ||
isPerformingWork || | ||
((isHostCallbackScheduled = !0), requestHostCallback())); | ||
((isHostCallbackScheduled = !0), | ||
isMessageLoopRunning || | ||
((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline()))); | ||
return priorityLevel; | ||
}; | ||
exports.unstable_shouldYield = shouldYieldToHost; | ||
exports.unstable_shouldYield = function () { | ||
return exports.unstable_now() - startTime < frameInterval ? !1 : !0; | ||
}; | ||
exports.unstable_wrapCallback = function (callback) { | ||
@@ -340,0 +328,0 @@ var parentPriorityLevel = currentPriorityLevel; |
{ | ||
"name": "scheduler", | ||
"version": "0.0.0-experimental-68dbd84b-20240812", | ||
"version": "0.0.0-experimental-6907aa2a-20241220", | ||
"description": "Cooperative scheduler for the browser environment.", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
82096
2461