Practical Guide to Tasks, Promises and Scheduling
summary
Explains JavaScript’s asynchronous model and event loop, detailing how browsers schedule microtasks vs. macrotasks and how to break up long tasks to avoid freezing the UI. Covers practical APIs like requestIdleCallback and introduces the upcoming Scheduler API, using plain JavaScript (no frameworks or libraries).
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:11Async vs concurrent in JS
- 3:38Promises and background execution
- 4:00JS tasks and event loop
- 7:53Microtasks vs macrotasks
- 10:40Microtask queue order
- 13:30Long tasks and UI blocking
- 18:50Splitting long tasks
- 23:50Yielding with deadlines
- 26:38Message channel scheduling
- 29:05Scheduler API priorities
- 33:19RequestAnimationFrame usage
- 35:46RequestIdleCallback for background
- 39:43Summary
