Offload canvas work to a Web Worker
Heavy work—large exports, simulations, or parsing—should not block input. Moving the canvas or compute stage to a Web Worker isolates long tasks from the UI thread, echoing SSR and testing themes in Lesson 11.
Watch frame time and input latency while toggling worker usage in your own builds.
transferControlToOffscreenfrom main thread to WebWorker.- Listen to events such as
pointerdown/resizeon main thread and transfer serialized version later.