Lesson 0004 · ~12 minutes · synthesis
One skill: given a feature brief, write a complete multi-tab choice — tool, wire shape, source of truth, and one risk you own.
This is the durable skill from
MISSION.md: defend a
BroadcastChannel choice (or rejection) in a design review
without hand-waving SharedWorker or storage-event cargo cult.
You can complete this from lessons 1–3 alone. External MDN / HTML reads remain optional enrichment, not a gate.
Run in order. Earlier gates reject more options than later ones.
Notify peers only → BroadcastChannel. Shared
process / one socket → SharedWorker. Tab-private state →
sessionStorage. Network/offline → service worker. Cross-origin →
postMessage. (Lessons
1,
3)
Exact channel name; local apply then post (sender
excluded); small structured clone; no transfer list;
close() on teardown. (Lesson
2)
Live bus, not mailbox — no history. Late tabs read server/store first, then join. Messages are hints. (Lesson 3)
Same origin only; support floor (Safari 15.4+); no BC-only locks; payload size; closed-channel throws; name typos silent. (Lesson 3)
“We use BroadcastChannel | SharedWorker | sessionStorage | SW | … because job; wire is name + local-then-post + small clone; truth is store/server; we own origin · support · no lock myth · close hygiene.”
Keep the print playbook open after this course — compressed form of all four lessons.
Pick the best default package. Equal-length options.
User logs out in tab A; same-origin tabs B and C must clear session UI within a second. No shared compute engine.
Same-origin app; users open many tabs. Product wants one WebSocket to the market feed; every tab shows updates.
Toggle light/dark in one tab; other open tabs update immediately. Tabs opened later must still show the chosen theme after reload.
Four-step checkout must survive reload in this tab. A second parallel checkout tab must not overwrite the first flow’s step.
Proposal: tabs elect a cart “leader” only via BroadcastChannel posts; the leader alone mutates cart with no server version checks.
HTML §9.5 (job split + algorithm) and MDN BroadcastChannel (API surface). Design reviews live on the playbook.