Reference · print-friendly

Structured clone decision playbook

One page for design reviews. Walk top to bottom; stop when a row rejects the current candidate.

1. Gate A · Job (which copy tool?)

If… Prefer…
New outer object; nested refs may stay shared Shallow copy
A JSON document (HTTP, file, log) JSON.stringify — design for loss
Same-realm snapshot; nested identity must break structuredClone(plainData)
Value already crossing postMessage / BC / IDB / History Implicit clone — don’t double-copy
Large binary; sender is done with the bytes Transfer .buffer (in value and list)
Methods, class identity, versioned wire, revival Custom serializer

2. Gate B · Shape (will it survive?)

3. Gate C · Move (clone vs transfer)

4. Gate D · Cost & ship risks

Sentence you should be able to say

“We use shallow | JSON | structuredClone | implicit clone | transfer | custom serializer because job; shape is plain data / keep-flatten-throw; move is copy | list .buffer on the payload | no list here; we own cost · detach · no double-clone · no Proxy.”