Fast and consistently responsive apps using a single function call
requestIdleCallback
is not supported a499ff5https://github.com/astoilkov/main-thread-scheduling/compare/v14.1.0...v14.1.1
scheduleTask()
method that mimics scheduler.postTask()
API 5c1ed84https://github.com/astoilkov/main-thread-scheduling/compare/v14.0.0...v14.1.0
signal
option for canceling scheduled tasks, resolve #4 6c2a5aahttps://github.com/astoilkov/main-thread-scheduling/compare/v13.0.0...v14.0.0
🧬 A full rewrite of the library. It will be easier to add new features and maintain the library in the future.
https://github.com/astoilkov/main-thread-scheduling/compare/v12.0.1...v13.0.0
https://github.com/astoilkov/main-thread-scheduling/compare/v12.0.0...v12.0.1
BREAKING CHANGE: The browser user-blocking
, user-visible
, and background
didn't fit well in what main-thread-scheduling
was doing. Also, it was confusing for users to see the same values as scheduler.postTask()
but observe different behavior between the two. This is why the library renamed the concept of scheduling priority
to scheduling strategy
and the new values are interactive
, smooth
, and idle
. These values represent better what's happening when we yield to the main thread and what main-thread-scheduling
is actually doing. I feel the new values are more intuitive. You can think of them like you are completing this sentence: "Scheduling the task keeps the page interactive
/smooth
/idle
."
https://github.com/astoilkov/main-thread-scheduling/compare/v11.0.0...v12.0.0
BREAKING CHANGE: The priority user-visible
is now called user-blocking
. user-visible
has changed it runs for less time before yielding and you can use it even if an animation is running in the background.
isTimeToYield()
d9ab933SchedulingPriority
that includes user-blocking
, user-visible
, and background
priorities b20053dpostTask()
implementation example using main-thread-scheduling
in the readme 7017c2dhttps://github.com/astoilkov/main-thread-scheduling/compare/v10.0.0...v11.0.0
afterFrame()
→ requestAfterFrame()
.https://github.com/astoilkov/main-thread-scheduling/compare/v9.0.0...v10.0.0
This new major release brings 3 new utilities:
afterFrame(callback)
— like requestAnimationFrame()
but called after the frame has rendered (not before)queueTask(callback)
— like queueMicroTask()
but for Tasks
Deferred
— extends Promise
with resolve()
and reject()
methods and a state
propertyhttps://github.com/astoilkov/main-thread-scheduling/compare/v8.0.0...v9.0.0
https://github.com/astoilkov/main-thread-scheduling/compare/v7.1.0...v8.0.0