Lesson 0005 · ~12 minutes · synthesis
One skill: given a brief, pick the copy tool, the shape, the move, and one risk you own — then say it in a design review.
This is the durable skill from MISSION.md: defend shallow | JSON | structuredClone | implicit clone | transfer | custom serializer without treating JSON as a deep clone or hoping class methods survive.
Run in order. Earlier gates reject more options than later ones.
Document → JSON. Shared nested refs →
shallow. Independent deep data →
structuredClone. Already on
postMessage / BC / IDB / History → implicit.
Large binary, sender done → transfer. Revival /
versioned wire → custom serializer. (Lessons
1,
4)
Keep / flatten / throw. Plain DTO. No functions,
no DOM, no Proxy. Class instances become
{ fields }. (Lesson
2)
Copy vs list .buffer on the payload. Orphan list
still detaches. No transfer on BC / IDB / History. Detached is
terminal. (Lesson
3)
Cost (patches / chunk / transfer), no double-clone, loud vs silent JSON. (Lesson 4)
“We use shallow | JSON | structuredClone | implicit | transfer | custom serializer because job; shape is plain data; move is copy | .buffer on the payload | no list; we own cost · detach · no Proxy.”
Keep the print playbook open after this course.
Pick the best default package. Equal-length options.
A React modal must edit a nested draft from
useState (arrays + a Date). The store
object must stay untouched until Save.
POST settings to your REST API. The server only accepts
application/json.
A dedicated worker should own a 16MB
ArrayBuffer of pixels. Main thread will not read
those bytes again.
Persist a domain Invoice (methods, private fields,
schema version) to a file other services must read for years.
You will worker.postMessage({ type, draft }). The
React tree will keep rendering from draft after the
send.
The print decision playbook is the artifact to reopen in reviews. Behind it: MDN algorithm, structuredClone(), transferables.