Polyfill for the Prioritized Task Scheduling API (window.scheduler), providing scheduler.postTask(), scheduler.yield(), TaskController, and TaskSignal. Version 1.3.0, actively maintained by Google Chrome Labs. Uses setTimeout, MessageChannel, and requestIdleCallback with fallbacks. Suitable for browsers that haven't implemented the native API (Chrome 94+, Firefox 101+, Safari 15.4+). Ships TypeScript types. Good for progressive enhancement in scheduling-intensive web apps.
npm install scheduler-polyfillNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to side-effect import the polyfill, create a TaskController, and schedule a postTask with priority and signal. Works in browsers that don't natively support scheduler.
None; this is a known limitation. Do not rely on inherited priorities for yield().
Use feature detection or ensure the polyfill runs only in modern environments where requestIdleCallback is available.
For strict priority ordering, rely on native scheduler rather than the polyfill.
Avoid loading the polyfill in modern browsers that already support scheduler to prevent unintended side effects. Use dynamic import with feature detection.
Ensure you have imported 'scheduler-polyfill' as a side-effect before using TaskController.
Add type="module" to your script tag or use a bundler that supports ES modules.
Check that the polyfill import executes correctly. For non-module scripts, use a <script> tag pointing to the standalone bundle instead.
No dependency data recorded yet.