Course
Canvas Mastery Path
Start with a forgetful sheet of pixels and build a production-grade infinite-canvas editor that is replayable, testable, accessible, migratable, collaborative, and safe for AI-assisted changes.
- modules
- 4 modules
- lessons
- 18 lessons
- estimated
- 72h estimated
- For
- For: Frontend engineers who know basic HTML, CSS, and TypeScript and want to master the architecture of production-grade Canvas editors.
See the Whole Road Before Memorizing APIs
- Choose the surface Decide who renders and who edits
- Keep records Objects live in the document
- Interact Input passes through geometry and state machines
- Break it Inject realistic failures on purpose
- Prove it Pass with tests and traces
A five-year-old can see a picture, but a production system must answer more questions. What are the things in the picture called? Who may move them? Can they be recovered after a crash? Can someone who cannot see the canvas still operate it? Why does it remain responsive with one hundred thousand objects? Who wins when three people and an AI edit at the same time?
This course begins with those questions. Every chapter first gives you a toy world you can hold in your head so you can predict what will happen. Only then does it translate the toy into formal terminology, TypeScript interfaces, browser behavior, and test evidence. An analogy is never allowed to impersonate a fact: every chapter identifies exactly where the analogy stops working.
What You Will Build
You will continuously extend one teaching project, Canvas Lab, until it becomes a Visual Operations Canvas with:
- custom business shapes, text, images, connectors, and snapping;
- keyboard and screen-reader alternatives;
- history, autosave, crash recovery, and version migrations;
- a secure asset lifecycle with PNG, SVG, JSON, and tiled high-resolution export;
- repeatable geometry, state-machine, browser, visual, and performance tests;
- worker or GPU rendering only when evidence justifies it;
- recoverable multiplayer sync, offline queues, and presence;
- AI that can issue only bounded actions that are previewable, undoable, and auditable.
Keep These Three Layers Separate
- Document Shared, durable facts
- Session Working state on your device
- Presence Ephemeral signals from who is online now
Rendering has boundaries too. The DOM keeps text editing, semantics, and accessibility. Canvas 2D powers the high-frequency teaching kernel. A GPU renderer joins only after benchmarks demonstrate a benefit. The document never depends on one renderer, so replacing the brush never requires tearing up the ledger.
The Learning Loop in Every Chapter
- Play with a toy: Build a predictable mental model from concrete objects, actions, and outcomes.
- Translate it: Map every toy element to an engineering concept and mark the analogy’s boundary.
- Kill a misconception: Use the smallest counterexample that exposes an intuition that only works in a demo.
- Build something: Add one runnable, testable capability to Canvas Lab.
- Break it on purpose: Record the symptom, log or trace, root cause, repair, and regression test.
- Pass with evidence: Automate what can be proved automatically; document the environment and criteria for what still requires human verification.
- Teach it back: Explain the rule without jargon and transfer it to a new scenario.
Before You Begin
All course examples use TypeScript in strict mode. You need a modern browser, Node.js 22, a package manager, browser DevTools, and a terminal that can run unit and browser tests. Chapters involving React, tldraw, WebGPU, or browser compatibility pin a concrete version or state a verification date. Time-sensitive claims must be rechecked against official documentation.
You do not need prior knowledge of matrices, spatial indexes, CRDTs, or shaders. You only need to do three things consistently: predict first, break the system yourself, and use evidence to explain why the repair works.
Course progress
Course outline
Part I: Choose the Surface Before You Draw—Product, Pixels, and Coordinates
Separate the infinite-canvas product model from its rendering technology, then build a crisp, replayable teaching kernel with consistent coordinates.
- 01 Chapter 1: Do Not Draw Yet—Canvas Is Not a Product Architecture Render the same business diagram with DOM, SVG, Canvas, and GPU approaches, then record the first renderer-selection ADR. available now
- 02 Chapter 2: A Sheet of Pixels That Forgets Understand bitmaps, CSS pixels, physical pixels, and DPR, then build a CanvasHost that neither duplicates subscriptions nor loses state. available now
- 03 Chapter 3: Turn Drawing into a Replayable Recipe Replace incremental painting with a deterministic, multi-pass renderer that can rebuild the complete view from the document. available now
- 04 Chapter 4: Four Maps and a Camera Unify local, parent, world, viewport, and screen coordinates while building an invertible camera, zoom, rotation, and minimap. available now
Part II: Give the Pixel World a Brain—Model, Scheduling, Input, and Tools
Make the document the source of truth, separate React from the high-frequency engine, and organize interaction around normalized input, geometry queries, and state machines.
- 05 Chapter 5: Give the Pixel World a Registry Define stable IDs, a scene graph, shape/asset/binding records, and a domain-adapter boundary that stays independent of the renderer. available now
- 06 Chapter 6: Redraw Only When the Light Turns On—Render Scheduling and the React Boundary Drive rendering through invalidation and keep exactly one active engine, observer, listener set, and rAF loop under React Strict Mode. available now
- 07 Chapter 7: Mouse, Touch, and Pen Speak One Language Translate pointer, wheel, keyboard, and gesture input into normalized world-coordinate events for the tool layer. available now
- 08 Chapter 8: Find the Big Box Before Inspecting the Edge Build a Canvas-independent GeometryKernel and combine broad-phase and narrow-phase queries for precise hit testing. available now
- 09 Chapter 9: Tools Are Traffic Lights, Not a Bag of Booleans Use explicit states, guards, cancel, commit, and commands to implement Select, Hand, Rectangle, Freehand, and Eraser tools. available now
Part III: From “It Drags” to “It Is Trustworthy”—Interaction, Text, Assets, and Recovery
Add professional interaction feel, native text editing, a secure asset pipeline, time travel, migrations, testing, accessibility, and observability.
- 10 Chapter 10: Make the Editor Feel Right Implement multi-select, resize, rotate, snapping, connectors, clipboard, duplicate-drag, and edge scrolling with stable thresholds at every zoom level. available now
- 11 Chapter 11: Drawn Text Is Not Editable Text Let Canvas render previews while the DOM edits text, with correct handling for fonts, wrapping, graphemes, bidi, IME, caret, and selection. available now
- 12 Chapter 12: Borrowed Images Cannot Be Packed Without Rules Design an asset protocol covering upload, decode, CORS, origin cleanliness, SVG sanitization, memory budgets, and multi-format export. available now
- 13 Chapter 13: Time Machines and Old Boxes Use transactions for undo/redo, validation and idempotent migrations for versioned data, and keep document, session, and presence separate. available now
- 14 Chapter 14: Looking Correct Is Not Being Correct Prove a Canvas editor across model, state-machine, browser, visual, accessibility, performance, and production-telemetry layers. available now
Part IV: Master-Level Decisions—Performance, Workers, GPU, SDKs, Collaboration, and AI
Find bottlenecks with traces before upgrading threads or renderers, then make explicit build/buy/hybrid and collaboration-protocol decisions.
- 15 Chapter 15: Do Not Search Ten Thousand Children One by One Build repeatable benchmarks and measure the gains from invalidation, culling, spatial indexes, caches, LOD, and memory limits. available now
- 16 Chapter 16: Keep the Front Desk Out of the Kitchen—Worker and GPU Upgrades Compare main-thread Canvas 2D, OffscreenCanvas workers, and a GPU prototype while handling reordering, backpressure, crashes, device loss, and fallback. available now
- 17 Chapter 17: Build the Car or Buy a Proven Chassis? Use a pinned tldraw 5.x version to write a Build/Buy/Hybrid ADR across Raw Canvas, SVG, Konva, GPU, Three.js, and tldraw. available now
- 18 Chapter 18: People and AI Edit the Same Ledger Compare server-authoritative sync with CRDTs, then constrain AI to validated, previewable, undoable, and auditable typed operations. available now