Browser JavaScript shares a main thread with much of the work needed to respond to input and paint. An expensive parser or endless chain of microtasks can delay a visible update, even when the network is fast. A worker can move computation away from that thread, but messages, copies, cancellation, and cleanup become part of the contract. These lessons follow one case-review route through event ordering, background processing, cooperative work, and disposal when the route changes.
Topics in this track
- Event Loop Tasks, Microtasks, and Paint — Know which queued work runs before the browser can respond and paint a changed state.
- Workers, Messages, Transfer, and Cancellation — Move expensive computation off the main thread while keeping messages versioned and route-owned.
- Cooperative Main-Thread Scheduling — Split bounded work into tasks so input and rendering can proceed without losing result integrity.
- Browser Memory and Resource Lifecycles — Pair every route-owned listener, observer, URL, timer, and worker with a clear disposal path.
Prerequisite paths
DOM events: enhance a working control without losing its baseline; React Effects and Request Races; Page performance: budget the critical path and reserve layout space.
Neighbor track
CSS Layout and Interface Systems.
Practice path
Build Project: responsive import worker and check decisions in Web Development: layout and runtime contracts quiz.
Further connections
WebAssembly and Browser Compute; Wasm Worker Jobs, Cancellation, and Result Order.
