Reference
60-second design-review scan. Companion to lesson 4.
JSON.stringify, and design for loss.
reactive / Pinia / MobX) → unwrap first, or clone a
plain DTO. Proxies throw.
structuredClone and then
postMessage / IDB put / pushState with no
other reason → the API already clones.
| Risk | What to check |
|---|---|
| Orphan list | Every transfer-list entry is reachable from the cloned / posted value |
| Typed-array list | List is .buffer, not the view |
| Detach surprise | Sender is done with those bytes; no later clone of them |
| Proxy / class | Payload is plain data, not a live reactive object or class instance |
| Cost | Graph size / frequency; patches or transfer before blaming the API |
| Loud vs silent | Functions/DOM throw on clone; JSON drops them. Know which algorithm you are on |