scheduler
Advanced tools
Comparing version 0.0.0-4a1072194 to 0.0.0-50b50c26f
{ | ||
"branch": "master", | ||
"buildNumber": "12928", | ||
"checksum": "7d45248", | ||
"commit": "4a1072194", | ||
"buildNumber": "14970", | ||
"checksum": "32f1c37", | ||
"commit": "50b50c26f", | ||
"environment": "ci", | ||
"reactVersion": "16.6.1-canary-4a1072194" | ||
"reactVersion": "16.8.6-canary-50b50c26f" | ||
} |
@@ -1,2 +0,2 @@ | ||
/** @license React v0.0.0-4a1072194 | ||
/** @license React v0.0.0-50b50c26f | ||
* scheduler-tracing.development.js | ||
@@ -51,2 +51,8 @@ * | ||
// Disable javascript: URL strings in href for XSS protection. | ||
// Disables yielding during render in Concurrent Mode. Used for debugging only. | ||
// React Fire: prevent the value and checked attributes from syncing | ||
@@ -59,2 +65,20 @@ // with their related DOM properties | ||
// See https://github.com/react-native-community/discussions-and-proposals/issues/72 for more information | ||
// This is a flag so we can fix warnings in RN core before turning it on | ||
// Experimental React Events support. Only used in www builds for now. | ||
// New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107 | ||
// We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?) | ||
// Till then, we warn about the missing mock, but still fallback to a sync mode compatible version | ||
// Temporary flag to revert the fix in #15650 | ||
var DEFAULT_THREAD_ID = 0; | ||
@@ -61,0 +85,0 @@ |
@@ -1,2 +0,2 @@ | ||
/** @license React v0.0.0-4a1072194 | ||
/** @license React v0.0.0-50b50c26f | ||
* scheduler-tracing.production.min.js | ||
@@ -3,0 +3,0 @@ * |
@@ -1,2 +0,2 @@ | ||
/** @license React v0.0.0-4a1072194 | ||
/** @license React v0.0.0-50b50c26f | ||
* scheduler-tracing.profiling.min.js | ||
@@ -3,0 +3,0 @@ * |
@@ -1,2 +0,2 @@ | ||
/** @license React v0.0.0-4a1072194 | ||
/** @license React v0.0.0-50b50c26f | ||
* scheduler.development.js | ||
@@ -20,40 +20,260 @@ * | ||
// Helps identify side effects in begin-phase lifecycle hooks and setState reducers: | ||
var enableSchedulerDebugging = false; | ||
// The DOM Scheduler implementation is similar to requestIdleCallback. It | ||
// works by scheduling a requestAnimationFrame, storing the time for the start | ||
// of the frame, then scheduling a postMessage which gets scheduled after paint. | ||
// Within the postMessage handler do as much work as possible until time + frame | ||
// rate. By separating the idle call into a separate event tick we ensure that | ||
// layout, paint and other browser work is counted against the available time. | ||
// The frame rate is dynamically adjusted. | ||
// In some cases, StrictMode should also double-render lifecycles. | ||
// This can be confusing for tests though, | ||
// And it can be bad for performance in production. | ||
// This feature flag can be used to control the behavior: | ||
var requestHostCallback = void 0; | ||
var cancelHostCallback = void 0; | ||
var shouldYieldToHost = void 0; | ||
exports.unstable_now = void 0; | ||
exports.unstable_forceFrameRate = void 0; | ||
var hasNativePerformanceNow = typeof performance === 'object' && typeof performance.now === 'function'; | ||
// To preserve the "Pause on caught exceptions" behavior of the debugger, we | ||
// replay the begin phase of a failed component inside invokeGuardedCallback. | ||
// We capture a local reference to any global, in case it gets polyfilled after | ||
// this module is initially evaluated. We want to be using a | ||
// consistent implementation. | ||
var localDate = Date; | ||
// This initialization code may run even on server environments if a component | ||
// just imports ReactDOM (e.g. for findDOMNode). Some environments might not | ||
// have setTimeout or clearTimeout. However, we always expect them to be defined | ||
// on the client. https://github.com/facebook/react/pull/13088 | ||
var localSetTimeout = typeof setTimeout === 'function' ? setTimeout : undefined; | ||
var localClearTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined; | ||
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6: | ||
// We don't expect either of these to necessarily be defined, but we will error | ||
// later if they are missing on the client. | ||
var localRequestAnimationFrame = typeof requestAnimationFrame === 'function' ? requestAnimationFrame : undefined; | ||
var localCancelAnimationFrame = typeof cancelAnimationFrame === 'function' ? cancelAnimationFrame : undefined; | ||
// requestAnimationFrame does not run when the tab is in the background. If | ||
// we're backgrounded we prefer for that work to happen so that the page | ||
// continues to load in the background. So we also schedule a 'setTimeout' as | ||
// a fallback. | ||
// TODO: Need a better heuristic for backgrounded work. | ||
var ANIMATION_FRAME_TIMEOUT = 100; | ||
var rAFID = void 0; | ||
var rAFTimeoutID = void 0; | ||
var requestAnimationFrameWithTimeout = function (callback) { | ||
// schedule rAF and also a setTimeout | ||
rAFID = localRequestAnimationFrame(function (timestamp) { | ||
// cancel the setTimeout | ||
localClearTimeout(rAFTimeoutID); | ||
callback(timestamp); | ||
}); | ||
rAFTimeoutID = localSetTimeout(function () { | ||
// cancel the requestAnimationFrame | ||
localCancelAnimationFrame(rAFID); | ||
callback(exports.unstable_now()); | ||
}, ANIMATION_FRAME_TIMEOUT); | ||
}; | ||
// Gather advanced timing metrics for Profiler subtrees. | ||
if (hasNativePerformanceNow) { | ||
var Performance = performance; | ||
exports.unstable_now = function () { | ||
return Performance.now(); | ||
}; | ||
} else { | ||
exports.unstable_now = function () { | ||
return localDate.now(); | ||
}; | ||
} | ||
if ( | ||
// If Scheduler runs in a non-DOM environment, it falls back to a naive | ||
// implementation using setTimeout. | ||
typeof window === 'undefined' || | ||
// Check if MessageChannel is supported, too. | ||
typeof MessageChannel !== 'function') { | ||
// If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore, | ||
// fallback to a naive implementation. | ||
var _callback = null; | ||
var _flushCallback = function (didTimeout) { | ||
if (_callback !== null) { | ||
try { | ||
_callback(didTimeout); | ||
} finally { | ||
_callback = null; | ||
} | ||
} | ||
}; | ||
requestHostCallback = function (cb, ms) { | ||
if (_callback !== null) { | ||
// Protect against re-entrancy. | ||
setTimeout(requestHostCallback, 0, cb); | ||
} else { | ||
_callback = cb; | ||
setTimeout(_flushCallback, 0, false); | ||
} | ||
}; | ||
cancelHostCallback = function () { | ||
_callback = null; | ||
}; | ||
shouldYieldToHost = function () { | ||
return false; | ||
}; | ||
exports.unstable_forceFrameRate = function () {}; | ||
} else { | ||
if (typeof console !== 'undefined') { | ||
// TODO: Remove fb.me link | ||
if (typeof localRequestAnimationFrame !== 'function') { | ||
console.error("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills'); | ||
} | ||
if (typeof localCancelAnimationFrame !== 'function') { | ||
console.error("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills'); | ||
} | ||
} | ||
// Trace which interactions trigger each commit. | ||
var scheduledHostCallback = null; | ||
var isMessageEventScheduled = false; | ||
var timeoutTime = -1; | ||
var isAnimationFrameScheduled = false; | ||
// Only used in www builds. | ||
// TODO: true? Here it might just be false. | ||
var isFlushingHostCallback = false; | ||
// Only used in www builds. | ||
var enableSchedulerDebugging = true; | ||
var frameDeadline = 0; | ||
// We start out assuming that we run at 30fps but then the heuristic tracking | ||
// will adjust this value to a faster fps if we get more frequent animation | ||
// frames. | ||
var previousFrameTime = 33; | ||
var activeFrameTime = 33; | ||
var fpsLocked = false; | ||
// Only used in www builds. | ||
shouldYieldToHost = function () { | ||
return frameDeadline <= exports.unstable_now(); | ||
}; | ||
exports.unstable_forceFrameRate = function (fps) { | ||
if (fps < 0 || fps > 125) { | ||
console.error('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing framerates higher than 125 fps is not unsupported'); | ||
return; | ||
} | ||
if (fps > 0) { | ||
activeFrameTime = Math.floor(1000 / fps); | ||
fpsLocked = true; | ||
} else { | ||
// reset the framerate | ||
activeFrameTime = 33; | ||
fpsLocked = false; | ||
} | ||
}; | ||
// React Fire: prevent the value and checked attributes from syncing | ||
// with their related DOM properties | ||
// We use the postMessage trick to defer idle work until after the repaint. | ||
var channel = new MessageChannel(); | ||
var port = channel.port2; | ||
channel.port1.onmessage = function (event) { | ||
isMessageEventScheduled = false; | ||
var prevScheduledCallback = scheduledHostCallback; | ||
var prevTimeoutTime = timeoutTime; | ||
scheduledHostCallback = null; | ||
timeoutTime = -1; | ||
// These APIs will no longer be "unstable" in the upcoming 16.7 release, | ||
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile. | ||
var currentTime = exports.unstable_now(); | ||
var didTimeout = false; | ||
if (frameDeadline - currentTime <= 0) { | ||
// There's no time left in this idle period. Check if the callback has | ||
// a timeout and whether it's been exceeded. | ||
if (prevTimeoutTime !== -1 && prevTimeoutTime <= currentTime) { | ||
// Exceeded the timeout. Invoke the callback even though there's no | ||
// time left. | ||
didTimeout = true; | ||
} else { | ||
// No timeout. | ||
if (!isAnimationFrameScheduled) { | ||
// Schedule another animation callback so we retry later. | ||
isAnimationFrameScheduled = true; | ||
requestAnimationFrameWithTimeout(animationTick); | ||
} | ||
// Exit without invoking the callback. | ||
scheduledHostCallback = prevScheduledCallback; | ||
timeoutTime = prevTimeoutTime; | ||
return; | ||
} | ||
} | ||
if (prevScheduledCallback !== null) { | ||
isFlushingHostCallback = true; | ||
try { | ||
prevScheduledCallback(didTimeout); | ||
} finally { | ||
isFlushingHostCallback = false; | ||
} | ||
} | ||
}; | ||
var animationTick = function (rafTime) { | ||
if (scheduledHostCallback !== null) { | ||
// Eagerly schedule the next animation callback at the beginning of the | ||
// frame. If the scheduler queue is not empty at the end of the frame, it | ||
// will continue flushing inside that callback. If the queue *is* empty, | ||
// then it will exit immediately. Posting the callback at the start of the | ||
// frame ensures it's fired within the earliest possible frame. If we | ||
// waited until the end of the frame to post the callback, we risk the | ||
// browser skipping a frame and not firing the callback until the frame | ||
// after that. | ||
requestAnimationFrameWithTimeout(animationTick); | ||
} else { | ||
// No pending work. Exit. | ||
isAnimationFrameScheduled = false; | ||
return; | ||
} | ||
var nextFrameTime = rafTime - frameDeadline + activeFrameTime; | ||
if (nextFrameTime < activeFrameTime && previousFrameTime < activeFrameTime && !fpsLocked) { | ||
if (nextFrameTime < 8) { | ||
// Defensive coding. We don't support higher frame rates than 120hz. | ||
// If the calculated frame time gets lower than 8, it is probably a bug. | ||
nextFrameTime = 8; | ||
} | ||
// If one frame goes long, then the next one can be short to catch up. | ||
// If two frames are short in a row, then that's an indication that we | ||
// actually have a higher frame rate than what we're currently optimizing. | ||
// We adjust our heuristic dynamically accordingly. For example, if we're | ||
// running on 120hz display or 90hz VR display. | ||
// Take the max of the two in case one of them was an anomaly due to | ||
// missed frame deadlines. | ||
activeFrameTime = nextFrameTime < previousFrameTime ? previousFrameTime : nextFrameTime; | ||
} else { | ||
previousFrameTime = nextFrameTime; | ||
} | ||
frameDeadline = rafTime + activeFrameTime; | ||
if (!isMessageEventScheduled) { | ||
isMessageEventScheduled = true; | ||
port.postMessage(undefined); | ||
} | ||
}; | ||
requestHostCallback = function (callback, absoluteTimeout) { | ||
scheduledHostCallback = callback; | ||
timeoutTime = absoluteTimeout; | ||
if (isFlushingHostCallback || absoluteTimeout < 0) { | ||
// Don't wait for the next frame. Continue working ASAP, in a new event. | ||
port.postMessage(undefined); | ||
} else if (!isAnimationFrameScheduled) { | ||
// If rAF didn't already schedule one, we need to schedule a frame. | ||
// TODO: If this rAF doesn't materialize because the browser throttles, we | ||
// might want to still have setTimeout trigger rIC as a backup to ensure | ||
// that we keep performing work. | ||
isAnimationFrameScheduled = true; | ||
requestAnimationFrameWithTimeout(animationTick); | ||
} | ||
}; | ||
cancelHostCallback = function () { | ||
scheduledHostCallback = null; | ||
isMessageEventScheduled = false; | ||
timeoutTime = -1; | ||
}; | ||
} | ||
/* eslint-disable no-var */ | ||
@@ -85,3 +305,3 @@ | ||
var currentDidTimeout = false; | ||
var currentHostCallbackDidTimeout = false; | ||
// Pausing the scheduler is useful for debugging. | ||
@@ -94,27 +314,27 @@ var isSchedulerPaused = false; | ||
// This is set when a callback is being executed, to prevent re-entrancy. | ||
var isExecutingCallback = false; | ||
// This is set while performing work, to prevent re-entrancy. | ||
var isPerformingWork = false; | ||
var isHostCallbackScheduled = false; | ||
var hasNativePerformanceNow = typeof performance === 'object' && typeof performance.now === 'function'; | ||
function ensureHostCallbackIsScheduled() { | ||
if (isExecutingCallback) { | ||
function scheduleHostCallbackIfNeeded() { | ||
if (isPerformingWork) { | ||
// Don't schedule work yet; wait until the next time we yield. | ||
return; | ||
} | ||
// Schedule the host callback using the earliest expiration in the list. | ||
var expirationTime = firstCallbackNode.expirationTime; | ||
if (!isHostCallbackScheduled) { | ||
isHostCallbackScheduled = true; | ||
} else { | ||
// Cancel the existing host callback. | ||
cancelHostCallback(); | ||
if (firstCallbackNode !== null) { | ||
// Schedule the host callback using the earliest expiration in the list. | ||
var expirationTime = firstCallbackNode.expirationTime; | ||
if (isHostCallbackScheduled) { | ||
// Cancel the existing host callback. | ||
cancelHostCallback(); | ||
} else { | ||
isHostCallbackScheduled = true; | ||
} | ||
requestHostCallback(flushWork, expirationTime); | ||
} | ||
requestHostCallback(flushWork, expirationTime); | ||
} | ||
function flushFirstCallback() { | ||
var flushedNode = firstCallbackNode; | ||
var currentlyFlushingCallback = firstCallbackNode; | ||
@@ -134,8 +354,8 @@ // Remove the node from the list before calling the callback. That way the | ||
flushedNode.next = flushedNode.previous = null; | ||
currentlyFlushingCallback.next = currentlyFlushingCallback.previous = null; | ||
// Now it's safe to call the callback. | ||
var callback = flushedNode.callback; | ||
var expirationTime = flushedNode.expirationTime; | ||
var priorityLevel = flushedNode.priorityLevel; | ||
var callback = currentlyFlushingCallback.callback; | ||
var expirationTime = currentlyFlushingCallback.expirationTime; | ||
var priorityLevel = currentlyFlushingCallback.priorityLevel; | ||
var previousPriorityLevel = currentPriorityLevel; | ||
@@ -147,3 +367,8 @@ var previousExpirationTime = currentExpirationTime; | ||
try { | ||
continuationCallback = callback(); | ||
var didUserCallbackTimeout = currentHostCallbackDidTimeout || | ||
// Immediate priority callbacks are always called as if they timed out | ||
priorityLevel === ImmediatePriority; | ||
continuationCallback = callback(didUserCallbackTimeout); | ||
} catch (error) { | ||
throw error; | ||
} finally { | ||
@@ -192,3 +417,3 @@ currentPriorityLevel = previousPriorityLevel; | ||
firstCallbackNode = continuationNode; | ||
ensureHostCallbackIsScheduled(); | ||
scheduleHostCallbackIfNeeded(); | ||
} | ||
@@ -204,28 +429,4 @@ | ||
function flushImmediateWork() { | ||
if ( | ||
// Confirm we've exited the outer most event handler | ||
currentEventStartTime === -1 && firstCallbackNode !== null && firstCallbackNode.priorityLevel === ImmediatePriority) { | ||
isExecutingCallback = true; | ||
try { | ||
do { | ||
flushFirstCallback(); | ||
} while ( | ||
// Keep flushing until there are no more immediate callbacks | ||
firstCallbackNode !== null && firstCallbackNode.priorityLevel === ImmediatePriority); | ||
} finally { | ||
isExecutingCallback = false; | ||
if (firstCallbackNode !== null) { | ||
// There's still work remaining. Request another callback. | ||
ensureHostCallbackIsScheduled(); | ||
} else { | ||
isHostCallbackScheduled = false; | ||
} | ||
} | ||
} | ||
} | ||
function flushWork(didTimeout) { | ||
function flushWork(didUserCallbackTimeout) { | ||
// Exit right away if we're currently paused | ||
if (enableSchedulerDebugging && isSchedulerPaused) { | ||
@@ -235,10 +436,13 @@ return; | ||
isExecutingCallback = true; | ||
var previousDidTimeout = currentDidTimeout; | ||
currentDidTimeout = didTimeout; | ||
// We'll need a new host callback the next time work is scheduled. | ||
isHostCallbackScheduled = false; | ||
isPerformingWork = true; | ||
var previousDidTimeout = currentHostCallbackDidTimeout; | ||
currentHostCallbackDidTimeout = didUserCallbackTimeout; | ||
try { | ||
if (didTimeout) { | ||
if (didUserCallbackTimeout) { | ||
// Flush all the expired callbacks without yielding. | ||
while (firstCallbackNode !== null && !(enableSchedulerDebugging && isSchedulerPaused)) { | ||
// TODO Wrap i nfeature flag | ||
// TODO Wrap in feature flag | ||
// Read the current time. Flush all the callbacks that expire at or | ||
@@ -268,12 +472,6 @@ // earlier than that time. Then read the current time again and repeat. | ||
} finally { | ||
isExecutingCallback = false; | ||
currentDidTimeout = previousDidTimeout; | ||
if (firstCallbackNode !== null) { | ||
// There's still work remaining. Request another callback. | ||
ensureHostCallbackIsScheduled(); | ||
} else { | ||
isHostCallbackScheduled = false; | ||
} | ||
// Before exiting, flush all the immediate work that was scheduled. | ||
flushImmediateWork(); | ||
isPerformingWork = false; | ||
currentHostCallbackDidTimeout = previousDidTimeout; | ||
// There's still work remaining. Request another callback. | ||
scheduleHostCallbackIfNeeded(); | ||
} | ||
@@ -301,9 +499,42 @@ } | ||
return eventHandler(); | ||
} catch (error) { | ||
// There's still work remaining. Request another callback. | ||
scheduleHostCallbackIfNeeded(); | ||
throw error; | ||
} finally { | ||
currentPriorityLevel = previousPriorityLevel; | ||
currentEventStartTime = previousEventStartTime; | ||
} | ||
} | ||
// Before exiting, flush all the immediate work that was scheduled. | ||
flushImmediateWork(); | ||
function unstable_next(eventHandler) { | ||
var priorityLevel = void 0; | ||
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; | ||
var previousEventStartTime = currentEventStartTime; | ||
currentPriorityLevel = priorityLevel; | ||
currentEventStartTime = exports.unstable_now(); | ||
try { | ||
return eventHandler(); | ||
} catch (error) { | ||
// There's still work remaining. Request another callback. | ||
scheduleHostCallbackIfNeeded(); | ||
throw error; | ||
} finally { | ||
currentPriorityLevel = previousPriorityLevel; | ||
currentEventStartTime = previousEventStartTime; | ||
} | ||
} | ||
@@ -322,6 +553,9 @@ | ||
return callback.apply(this, arguments); | ||
} catch (error) { | ||
// There's still work remaining. Request another callback. | ||
scheduleHostCallbackIfNeeded(); | ||
throw error; | ||
} finally { | ||
currentPriorityLevel = previousPriorityLevel; | ||
currentEventStartTime = previousEventStartTime; | ||
flushImmediateWork(); | ||
} | ||
@@ -331,3 +565,3 @@ }; | ||
function unstable_scheduleCallback(callback, deprecated_options) { | ||
function unstable_scheduleCallback(priorityLevel, callback, deprecated_options) { | ||
var startTime = currentEventStartTime !== -1 ? currentEventStartTime : exports.unstable_now(); | ||
@@ -340,3 +574,3 @@ | ||
} else { | ||
switch (currentPriorityLevel) { | ||
switch (priorityLevel) { | ||
case ImmediatePriority: | ||
@@ -362,3 +596,3 @@ expirationTime = startTime + IMMEDIATE_PRIORITY_TIMEOUT; | ||
callback: callback, | ||
priorityLevel: currentPriorityLevel, | ||
priorityLevel: priorityLevel, | ||
expirationTime: expirationTime, | ||
@@ -370,8 +604,8 @@ next: null, | ||
// Insert the new callback into the list, ordered first by expiration, then | ||
// by insertion. So the new callback is inserted any other callback with | ||
// equal expiration. | ||
// by insertion. So the new callback is inserted after any other callback | ||
// with equal expiration. | ||
if (firstCallbackNode === null) { | ||
// This is the first callback in the list. | ||
firstCallbackNode = newNode.next = newNode.previous = newNode; | ||
ensureHostCallbackIsScheduled(); | ||
scheduleHostCallbackIfNeeded(); | ||
} else { | ||
@@ -396,3 +630,3 @@ var next = null; | ||
firstCallbackNode = newNode; | ||
ensureHostCallbackIsScheduled(); | ||
scheduleHostCallbackIfNeeded(); | ||
} | ||
@@ -416,3 +650,3 @@ | ||
if (firstCallbackNode !== null) { | ||
ensureHostCallbackIsScheduled(); | ||
scheduleHostCallbackIfNeeded(); | ||
} | ||
@@ -453,254 +687,5 @@ } | ||
function unstable_shouldYield() { | ||
return !currentDidTimeout && (firstCallbackNode !== null && firstCallbackNode.expirationTime < currentExpirationTime || shouldYieldToHost()); | ||
return !currentHostCallbackDidTimeout && (firstCallbackNode !== null && firstCallbackNode.expirationTime < currentExpirationTime || shouldYieldToHost()); | ||
} | ||
// The remaining code is essentially a polyfill for requestIdleCallback. It | ||
// works by scheduling a requestAnimationFrame, storing the time for the start | ||
// of the frame, then scheduling a postMessage which gets scheduled after paint. | ||
// Within the postMessage handler do as much work as possible until time + frame | ||
// rate. By separating the idle call into a separate event tick we ensure that | ||
// layout, paint and other browser work is counted against the available time. | ||
// The frame rate is dynamically adjusted. | ||
// We capture a local reference to any global, in case it gets polyfilled after | ||
// this module is initially evaluated. We want to be using a | ||
// consistent implementation. | ||
var localDate = Date; | ||
// This initialization code may run even on server environments if a component | ||
// just imports ReactDOM (e.g. for findDOMNode). Some environments might not | ||
// have setTimeout or clearTimeout. However, we always expect them to be defined | ||
// on the client. https://github.com/facebook/react/pull/13088 | ||
var localSetTimeout = typeof setTimeout === 'function' ? setTimeout : undefined; | ||
var localClearTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined; | ||
// We don't expect either of these to necessarily be defined, but we will error | ||
// later if they are missing on the client. | ||
var localRequestAnimationFrame = typeof requestAnimationFrame === 'function' ? requestAnimationFrame : undefined; | ||
var localCancelAnimationFrame = typeof cancelAnimationFrame === 'function' ? cancelAnimationFrame : undefined; | ||
// requestAnimationFrame does not run when the tab is in the background. If | ||
// we're backgrounded we prefer for that work to happen so that the page | ||
// continues to load in the background. So we also schedule a 'setTimeout' as | ||
// a fallback. | ||
// TODO: Need a better heuristic for backgrounded work. | ||
var ANIMATION_FRAME_TIMEOUT = 100; | ||
var rAFID; | ||
var rAFTimeoutID; | ||
var requestAnimationFrameWithTimeout = function (callback) { | ||
// schedule rAF and also a setTimeout | ||
rAFID = localRequestAnimationFrame(function (timestamp) { | ||
// cancel the setTimeout | ||
localClearTimeout(rAFTimeoutID); | ||
callback(timestamp); | ||
}); | ||
rAFTimeoutID = localSetTimeout(function () { | ||
// cancel the requestAnimationFrame | ||
localCancelAnimationFrame(rAFID); | ||
callback(exports.unstable_now()); | ||
}, ANIMATION_FRAME_TIMEOUT); | ||
}; | ||
if (hasNativePerformanceNow) { | ||
var Performance = performance; | ||
exports.unstable_now = function () { | ||
return Performance.now(); | ||
}; | ||
} else { | ||
exports.unstable_now = function () { | ||
return localDate.now(); | ||
}; | ||
} | ||
var requestHostCallback; | ||
var cancelHostCallback; | ||
var shouldYieldToHost; | ||
var globalValue = null; | ||
if (typeof window !== 'undefined') { | ||
globalValue = window; | ||
} else if (typeof global !== 'undefined') { | ||
globalValue = global; | ||
} | ||
if (globalValue && globalValue._schedMock) { | ||
// Dynamic injection, only for testing purposes. | ||
var globalImpl = globalValue._schedMock; | ||
requestHostCallback = globalImpl[0]; | ||
cancelHostCallback = globalImpl[1]; | ||
shouldYieldToHost = globalImpl[2]; | ||
exports.unstable_now = globalImpl[3]; | ||
} else if ( | ||
// If Scheduler runs in a non-DOM environment, it falls back to a naive | ||
// implementation using setTimeout. | ||
typeof window === 'undefined' || | ||
// Check if MessageChannel is supported, too. | ||
typeof MessageChannel !== 'function') { | ||
// If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore, | ||
// fallback to a naive implementation. | ||
var _callback = null; | ||
var _flushCallback = function (didTimeout) { | ||
if (_callback !== null) { | ||
try { | ||
_callback(didTimeout); | ||
} finally { | ||
_callback = null; | ||
} | ||
} | ||
}; | ||
requestHostCallback = function (cb, ms) { | ||
if (_callback !== null) { | ||
// Protect against re-entrancy. | ||
setTimeout(requestHostCallback, 0, cb); | ||
} else { | ||
_callback = cb; | ||
setTimeout(_flushCallback, 0, false); | ||
} | ||
}; | ||
cancelHostCallback = function () { | ||
_callback = null; | ||
}; | ||
shouldYieldToHost = function () { | ||
return false; | ||
}; | ||
} else { | ||
if (typeof console !== 'undefined') { | ||
// TODO: Remove fb.me link | ||
if (typeof localRequestAnimationFrame !== 'function') { | ||
console.error("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills'); | ||
} | ||
if (typeof localCancelAnimationFrame !== 'function') { | ||
console.error("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills'); | ||
} | ||
} | ||
var scheduledHostCallback = null; | ||
var isMessageEventScheduled = false; | ||
var timeoutTime = -1; | ||
var isAnimationFrameScheduled = false; | ||
var isFlushingHostCallback = false; | ||
var frameDeadline = 0; | ||
// We start out assuming that we run at 30fps but then the heuristic tracking | ||
// will adjust this value to a faster fps if we get more frequent animation | ||
// frames. | ||
var previousFrameTime = 33; | ||
var activeFrameTime = 33; | ||
shouldYieldToHost = function () { | ||
return frameDeadline <= exports.unstable_now(); | ||
}; | ||
// We use the postMessage trick to defer idle work until after the repaint. | ||
var channel = new MessageChannel(); | ||
var port = channel.port2; | ||
channel.port1.onmessage = function (event) { | ||
isMessageEventScheduled = false; | ||
var prevScheduledCallback = scheduledHostCallback; | ||
var prevTimeoutTime = timeoutTime; | ||
scheduledHostCallback = null; | ||
timeoutTime = -1; | ||
var currentTime = exports.unstable_now(); | ||
var didTimeout = false; | ||
if (frameDeadline - currentTime <= 0) { | ||
// There's no time left in this idle period. Check if the callback has | ||
// a timeout and whether it's been exceeded. | ||
if (prevTimeoutTime !== -1 && prevTimeoutTime <= currentTime) { | ||
// Exceeded the timeout. Invoke the callback even though there's no | ||
// time left. | ||
didTimeout = true; | ||
} else { | ||
// No timeout. | ||
if (!isAnimationFrameScheduled) { | ||
// Schedule another animation callback so we retry later. | ||
isAnimationFrameScheduled = true; | ||
requestAnimationFrameWithTimeout(animationTick); | ||
} | ||
// Exit without invoking the callback. | ||
scheduledHostCallback = prevScheduledCallback; | ||
timeoutTime = prevTimeoutTime; | ||
return; | ||
} | ||
} | ||
if (prevScheduledCallback !== null) { | ||
isFlushingHostCallback = true; | ||
try { | ||
prevScheduledCallback(didTimeout); | ||
} finally { | ||
isFlushingHostCallback = false; | ||
} | ||
} | ||
}; | ||
var animationTick = function (rafTime) { | ||
if (scheduledHostCallback !== null) { | ||
// Eagerly schedule the next animation callback at the beginning of the | ||
// frame. If the scheduler queue is not empty at the end of the frame, it | ||
// will continue flushing inside that callback. If the queue *is* empty, | ||
// then it will exit immediately. Posting the callback at the start of the | ||
// frame ensures it's fired within the earliest possible frame. If we | ||
// waited until the end of the frame to post the callback, we risk the | ||
// browser skipping a frame and not firing the callback until the frame | ||
// after that. | ||
requestAnimationFrameWithTimeout(animationTick); | ||
} else { | ||
// No pending work. Exit. | ||
isAnimationFrameScheduled = false; | ||
return; | ||
} | ||
var nextFrameTime = rafTime - frameDeadline + activeFrameTime; | ||
if (nextFrameTime < activeFrameTime && previousFrameTime < activeFrameTime) { | ||
if (nextFrameTime < 8) { | ||
// Defensive coding. We don't support higher frame rates than 120hz. | ||
// If the calculated frame time gets lower than 8, it is probably a bug. | ||
nextFrameTime = 8; | ||
} | ||
// If one frame goes long, then the next one can be short to catch up. | ||
// If two frames are short in a row, then that's an indication that we | ||
// actually have a higher frame rate than what we're currently optimizing. | ||
// We adjust our heuristic dynamically accordingly. For example, if we're | ||
// running on 120hz display or 90hz VR display. | ||
// Take the max of the two in case one of them was an anomaly due to | ||
// missed frame deadlines. | ||
activeFrameTime = nextFrameTime < previousFrameTime ? previousFrameTime : nextFrameTime; | ||
} else { | ||
previousFrameTime = nextFrameTime; | ||
} | ||
frameDeadline = rafTime + activeFrameTime; | ||
if (!isMessageEventScheduled) { | ||
isMessageEventScheduled = true; | ||
port.postMessage(undefined); | ||
} | ||
}; | ||
requestHostCallback = function (callback, absoluteTimeout) { | ||
scheduledHostCallback = callback; | ||
timeoutTime = absoluteTimeout; | ||
if (isFlushingHostCallback || absoluteTimeout < 0) { | ||
// Don't wait for the next frame. Continue working ASAP, in a new event. | ||
port.postMessage(undefined); | ||
} else if (!isAnimationFrameScheduled) { | ||
// If rAF didn't already schedule one, we need to schedule a frame. | ||
// TODO: If this rAF doesn't materialize because the browser throttles, we | ||
// might want to still have setTimeout trigger rIC as a backup to ensure | ||
// that we keep performing work. | ||
isAnimationFrameScheduled = true; | ||
requestAnimationFrameWithTimeout(animationTick); | ||
} | ||
}; | ||
cancelHostCallback = function () { | ||
scheduledHostCallback = null; | ||
isMessageEventScheduled = false; | ||
timeoutTime = -1; | ||
}; | ||
} | ||
exports.unstable_ImmediatePriority = ImmediatePriority; | ||
@@ -712,2 +697,3 @@ exports.unstable_UserBlockingPriority = UserBlockingPriority; | ||
exports.unstable_runWithPriority = unstable_runWithPriority; | ||
exports.unstable_next = unstable_next; | ||
exports.unstable_scheduleCallback = unstable_scheduleCallback; | ||
@@ -714,0 +700,0 @@ exports.unstable_cancelCallback = unstable_cancelCallback; |
@@ -1,2 +0,2 @@ | ||
/** @license React v0.0.0-4a1072194 | ||
/** @license React v0.0.0-50b50c26f | ||
* scheduler.production.min.js | ||
@@ -10,13 +10,13 @@ * | ||
'use strict';Object.defineProperty(exports,"__esModule",{value:!0});var c=null,f=!1,h=3,k=-1,l=-1,m=!1,n=!1;function p(){if(!m){var a=c.expirationTime;n?q():n=!0;r(t,a)}} | ||
function u(){var a=c,b=c.next;if(c===b)c=null;else{var d=c.previous;c=d.next=b;b.previous=d}a.next=a.previous=null;d=a.callback;b=a.expirationTime;a=a.priorityLevel;var e=h,Q=l;h=a;l=b;try{var g=d()}finally{h=e,l=Q}if("function"===typeof g)if(g={callback:g,priorityLevel:a,expirationTime:b,next:null,previous:null},null===c)c=g.next=g.previous=g;else{d=null;a=c;do{if(a.expirationTime>=b){d=a;break}a=a.next}while(a!==c);null===d?d=c:d===c&&(c=g,p());b=d.previous;b.next=d.previous=g;g.next=d;g.previous= | ||
b}}function v(){if(-1===k&&null!==c&&1===c.priorityLevel){m=!0;try{do u();while(null!==c&&1===c.priorityLevel)}finally{m=!1,null!==c?p():n=!1}}}function t(a){m=!0;var b=f;f=a;try{if(a)for(;null!==c;){var d=exports.unstable_now();if(c.expirationTime<=d){do u();while(null!==c&&c.expirationTime<=d)}else break}else if(null!==c){do u();while(null!==c&&!w())}}finally{m=!1,f=b,null!==c?p():n=!1,v()}} | ||
var x=Date,y="function"===typeof setTimeout?setTimeout:void 0,z="function"===typeof clearTimeout?clearTimeout:void 0,A="function"===typeof requestAnimationFrame?requestAnimationFrame:void 0,B="function"===typeof cancelAnimationFrame?cancelAnimationFrame:void 0,C,D;function E(a){C=A(function(b){z(D);a(b)});D=y(function(){B(C);a(exports.unstable_now())},100)} | ||
if("object"===typeof performance&&"function"===typeof performance.now){var F=performance;exports.unstable_now=function(){return F.now()}}else exports.unstable_now=function(){return x.now()};var r,q,w,G=null;"undefined"!==typeof window?G=window:"undefined"!==typeof global&&(G=global); | ||
if(G&&G._schedMock){var H=G._schedMock;r=H[0];q=H[1];w=H[2];exports.unstable_now=H[3]}else if("undefined"===typeof window||"function"!==typeof MessageChannel){var I=null,J=function(a){if(null!==I)try{I(a)}finally{I=null}};r=function(a){null!==I?setTimeout(r,0,a):(I=a,setTimeout(J,0,!1))};q=function(){I=null};w=function(){return!1}}else{"undefined"!==typeof console&&("function"!==typeof A&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"), | ||
"function"!==typeof B&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"));var K=null,L=!1,M=-1,N=!1,O=!1,P=0,R=33,S=33;w=function(){return P<=exports.unstable_now()};var T=new MessageChannel,U=T.port2;T.port1.onmessage=function(){L=!1;var a=K,b=M;K=null;M=-1;var d=exports.unstable_now(),e=!1;if(0>=P-d)if(-1!==b&&b<=d)e=!0;else{N||(N=!0,E(V));K=a;M=b;return}if(null!==a){O=!0;try{a(e)}finally{O=!1}}}; | ||
var V=function(a){if(null!==K){E(V);var b=a-P+S;b<S&&R<S?(8>b&&(b=8),S=b<R?R:b):R=b;P=a+S;L||(L=!0,U.postMessage(void 0))}else N=!1};r=function(a,b){K=a;M=b;O||0>b?U.postMessage(void 0):N||(N=!0,E(V))};q=function(){K=null;L=!1;M=-1}}exports.unstable_ImmediatePriority=1;exports.unstable_UserBlockingPriority=2;exports.unstable_NormalPriority=3;exports.unstable_IdlePriority=5;exports.unstable_LowPriority=4; | ||
exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var d=h,e=k;h=a;k=exports.unstable_now();try{return b()}finally{h=d,k=e,v()}}; | ||
exports.unstable_scheduleCallback=function(a,b){var d=-1!==k?k:exports.unstable_now();if("object"===typeof b&&null!==b&&"number"===typeof b.timeout)b=d+b.timeout;else switch(h){case 1:b=d+-1;break;case 2:b=d+250;break;case 5:b=d+1073741823;break;case 4:b=d+1E4;break;default:b=d+5E3}a={callback:a,priorityLevel:h,expirationTime:b,next:null,previous:null};if(null===c)c=a.next=a.previous=a,p();else{d=null;var e=c;do{if(e.expirationTime>b){d=e;break}e=e.next}while(e!==c);null===d?d=c:d===c&&(c=a,p()); | ||
b=d.previous;b.next=d.previous=a;a.next=d;a.previous=b}return a};exports.unstable_cancelCallback=function(a){var b=a.next;if(null!==b){if(b===a)c=null;else{a===c&&(c=b);var d=a.previous;d.next=b;b.previous=d}a.next=a.previous=null}};exports.unstable_wrapCallback=function(a){var b=h;return function(){var d=h,e=k;h=b;k=exports.unstable_now();try{return a.apply(this,arguments)}finally{h=d,k=e,v()}}};exports.unstable_getCurrentPriorityLevel=function(){return h}; | ||
exports.unstable_shouldYield=function(){return!f&&(null!==c&&c.expirationTime<l||w())};exports.unstable_continueExecution=function(){null!==c&&p()};exports.unstable_pauseExecution=function(){};exports.unstable_getFirstCallbackNode=function(){return c}; | ||
'use strict';Object.defineProperty(exports,"__esModule",{value:!0});var d=void 0,f=void 0,g=void 0;exports.unstable_now=void 0;exports.unstable_forceFrameRate=void 0;var k=Date,l="function"===typeof setTimeout?setTimeout:void 0,n="function"===typeof clearTimeout?clearTimeout:void 0,p="function"===typeof requestAnimationFrame?requestAnimationFrame:void 0,q="function"===typeof cancelAnimationFrame?cancelAnimationFrame:void 0,r=void 0,t=void 0; | ||
function u(a){r=p(function(b){n(t);a(b)});t=l(function(){q(r);a(exports.unstable_now())},100)}if("object"===typeof performance&&"function"===typeof performance.now){var v=performance;exports.unstable_now=function(){return v.now()}}else exports.unstable_now=function(){return k.now()}; | ||
if("undefined"===typeof window||"function"!==typeof MessageChannel){var w=null,x=function(a){if(null!==w)try{w(a)}finally{w=null}};d=function(a){null!==w?setTimeout(d,0,a):(w=a,setTimeout(x,0,!1))};f=function(){w=null};g=function(){return!1};exports.unstable_forceFrameRate=function(){}}else{"undefined"!==typeof console&&("function"!==typeof p&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!== | ||
typeof q&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"));var y=null,z=!1,A=-1,B=!1,C=!1,D=0,E=33,F=33,G=!1;g=function(){return D<=exports.unstable_now()};exports.unstable_forceFrameRate=function(a){0>a||125<a?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):0<a?(F=Math.floor(1E3/a),G=!0):(F=33,G=!1)};var H=new MessageChannel, | ||
I=H.port2;H.port1.onmessage=function(){z=!1;var a=y,b=A;y=null;A=-1;var c=exports.unstable_now(),e=!1;if(0>=D-c)if(-1!==b&&b<=c)e=!0;else{B||(B=!0,u(J));y=a;A=b;return}if(null!==a){C=!0;try{a(e)}finally{C=!1}}};var J=function(a){if(null!==y){u(J);var b=a-D+F;b<F&&E<F&&!G?(8>b&&(b=8),F=b<E?E:b):E=b;D=a+F;z||(z=!0,I.postMessage(void 0))}else B=!1};d=function(a,b){y=a;A=b;C||0>b?I.postMessage(void 0):B||(B=!0,u(J))};f=function(){y=null;z=!1;A=-1}}var K=null,L=!1,M=3,N=-1,O=-1,P=!1,Q=!1; | ||
function R(){if(!P&&null!==K){var a=K.expirationTime;Q?f():Q=!0;d(S,a)}} | ||
function T(){var a=K,b=K.next;if(K===b)K=null;else{var c=K.previous;K=c.next=b;b.previous=c}a.next=a.previous=null;c=a.callback;b=a.expirationTime;a=a.priorityLevel;var e=M,m=O;M=a;O=b;try{var h=c(L||1===a)}catch(U){throw U;}finally{M=e,O=m}if("function"===typeof h)if(h={callback:h,priorityLevel:a,expirationTime:b,next:null,previous:null},null===K)K=h.next=h.previous=h;else{c=null;a=K;do{if(a.expirationTime>=b){c=a;break}a=a.next}while(a!==K);null===c?c=K:c===K&&(K=h,R());b=c.previous;b.next=c.previous= | ||
h;h.next=c;h.previous=b}}function S(a){Q=!1;P=!0;var b=L;L=a;try{if(a)for(;null!==K;){var c=exports.unstable_now();if(K.expirationTime<=c){do T();while(null!==K&&K.expirationTime<=c)}else break}else if(null!==K){do T();while(null!==K&&!g())}}finally{P=!1,L=b,R()}}exports.unstable_ImmediatePriority=1;exports.unstable_UserBlockingPriority=2;exports.unstable_NormalPriority=3;exports.unstable_IdlePriority=5;exports.unstable_LowPriority=4; | ||
exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=M,e=N;M=a;N=exports.unstable_now();try{return b()}catch(m){throw R(),m;}finally{M=c,N=e}};exports.unstable_next=function(a){switch(M){case 1:case 2:case 3:var b=3;break;default:b=M}var c=M,e=N;M=b;N=exports.unstable_now();try{return a()}catch(m){throw R(),m;}finally{M=c,N=e}}; | ||
exports.unstable_scheduleCallback=function(a,b,c){var e=-1!==N?N:exports.unstable_now();if("object"===typeof c&&null!==c&&"number"===typeof c.timeout)c=e+c.timeout;else switch(a){case 1:c=e+-1;break;case 2:c=e+250;break;case 5:c=e+1073741823;break;case 4:c=e+1E4;break;default:c=e+5E3}a={callback:b,priorityLevel:a,expirationTime:c,next:null,previous:null};if(null===K)K=a.next=a.previous=a,R();else{b=null;e=K;do{if(e.expirationTime>c){b=e;break}e=e.next}while(e!==K);null===b?b=K:b===K&&(K=a,R());c= | ||
b.previous;c.next=b.previous=a;a.next=b;a.previous=c}return a};exports.unstable_cancelCallback=function(a){var b=a.next;if(null!==b){if(b===a)K=null;else{a===K&&(K=b);var c=a.previous;c.next=b;b.previous=c}a.next=a.previous=null}};exports.unstable_wrapCallback=function(a){var b=M;return function(){var c=M,e=N;M=b;N=exports.unstable_now();try{return a.apply(this,arguments)}catch(m){throw R(),m;}finally{M=c,N=e}}};exports.unstable_getCurrentPriorityLevel=function(){return M}; | ||
exports.unstable_shouldYield=function(){return!L&&(null!==K&&K.expirationTime<O||g())};exports.unstable_continueExecution=function(){null!==K&&R()};exports.unstable_pauseExecution=function(){};exports.unstable_getFirstCallbackNode=function(){return K}; |
{ | ||
"name": "scheduler", | ||
"version": "0.0.0-4a1072194", | ||
"version": "0.0.0-50b50c26f", | ||
"description": "Cooperative scheduler for the browser environment.", | ||
"main": "index.js", | ||
"repository": "facebook/react", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/facebook/react.git", | ||
"directory": "packages/scheduler" | ||
}, | ||
"license": "MIT", | ||
@@ -26,2 +30,3 @@ "keywords": [ | ||
"tracing-profiling.js", | ||
"unstable_mock.js", | ||
"cjs/", | ||
@@ -28,0 +33,0 @@ "umd/" |
@@ -57,2 +57,9 @@ /** | ||
function unstable_next() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_next.apply( | ||
this, | ||
arguments | ||
); | ||
} | ||
function unstable_wrapCallback() { | ||
@@ -93,2 +100,9 @@ return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_wrapCallback.apply( | ||
function unstable_forceFrameRate() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_forceFrameRate.apply( | ||
this, | ||
arguments | ||
); | ||
} | ||
return Object.freeze({ | ||
@@ -100,2 +114,3 @@ unstable_now: unstable_now, | ||
unstable_runWithPriority: unstable_runWithPriority, | ||
unstable_next: unstable_next, | ||
unstable_wrapCallback: unstable_wrapCallback, | ||
@@ -106,3 +121,24 @@ unstable_getCurrentPriorityLevel: unstable_getCurrentPriorityLevel, | ||
unstable_getFirstCallbackNode: unstable_getFirstCallbackNode, | ||
unstable_forceFrameRate: unstable_forceFrameRate, | ||
get unstable_IdlePriority() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED | ||
.Scheduler.unstable_IdlePriority; | ||
}, | ||
get unstable_ImmediatePriority() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED | ||
.Scheduler.unstable_ImmediatePriority; | ||
}, | ||
get unstable_LowPriority() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED | ||
.Scheduler.unstable_LowPriority; | ||
}, | ||
get unstable_NormalPriority() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED | ||
.Scheduler.unstable_NormalPriority; | ||
}, | ||
get unstable_UserBlockingPriority() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED | ||
.Scheduler.unstable_UserBlockingPriority; | ||
}, | ||
}); | ||
}); |
@@ -57,2 +57,9 @@ /** | ||
function unstable_next() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_next.apply( | ||
this, | ||
arguments | ||
); | ||
} | ||
function unstable_wrapCallback() { | ||
@@ -87,2 +94,9 @@ return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_wrapCallback.apply( | ||
function unstable_forceFrameRate() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_forceFrameRate.apply( | ||
this, | ||
arguments | ||
); | ||
} | ||
return Object.freeze({ | ||
@@ -94,2 +108,3 @@ unstable_now: unstable_now, | ||
unstable_runWithPriority: unstable_runWithPriority, | ||
unstable_next: unstable_next, | ||
unstable_wrapCallback: unstable_wrapCallback, | ||
@@ -100,3 +115,24 @@ unstable_getCurrentPriorityLevel: unstable_getCurrentPriorityLevel, | ||
unstable_getFirstCallbackNode: unstable_getFirstCallbackNode, | ||
unstable_forceFrameRate: unstable_forceFrameRate, | ||
get unstable_IdlePriority() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED | ||
.Scheduler.unstable_IdlePriority; | ||
}, | ||
get unstable_ImmediatePriority() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED | ||
.Scheduler.unstable_ImmediatePriority; | ||
}, | ||
get unstable_LowPriority() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED | ||
.Scheduler.unstable_LowPriority; | ||
}, | ||
get unstable_NormalPriority() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED | ||
.Scheduler.unstable_NormalPriority; | ||
}, | ||
get unstable_UserBlockingPriority() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED | ||
.Scheduler.unstable_UserBlockingPriority; | ||
}, | ||
}); | ||
}); |
@@ -57,2 +57,9 @@ /** | ||
function unstable_next() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_next.apply( | ||
this, | ||
arguments | ||
); | ||
} | ||
function unstable_wrapCallback() { | ||
@@ -87,2 +94,9 @@ return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_wrapCallback.apply( | ||
function unstable_forceFrameRate() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_forceFrameRate.apply( | ||
this, | ||
arguments | ||
); | ||
} | ||
return Object.freeze({ | ||
@@ -94,2 +108,3 @@ unstable_now: unstable_now, | ||
unstable_runWithPriority: unstable_runWithPriority, | ||
unstable_next: unstable_next, | ||
unstable_wrapCallback: unstable_wrapCallback, | ||
@@ -100,3 +115,24 @@ unstable_getCurrentPriorityLevel: unstable_getCurrentPriorityLevel, | ||
unstable_getFirstCallbackNode: unstable_getFirstCallbackNode, | ||
unstable_forceFrameRate: unstable_forceFrameRate, | ||
get unstable_IdlePriority() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED | ||
.Scheduler.unstable_IdlePriority; | ||
}, | ||
get unstable_ImmediatePriority() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED | ||
.Scheduler.unstable_ImmediatePriority; | ||
}, | ||
get unstable_LowPriority() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED | ||
.Scheduler.unstable_LowPriority; | ||
}, | ||
get unstable_NormalPriority() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED | ||
.Scheduler.unstable_NormalPriority; | ||
}, | ||
get unstable_UserBlockingPriority() { | ||
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED | ||
.Scheduler.unstable_UserBlockingPriority; | ||
}, | ||
}); | ||
}); |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
112153
23
2700