the JSON text field this binding is for (used in error messages)
reads the field's raw text from the entity
writes raw text to the entity through its normal Set path
ReadonlyFieldthe JSON text field this binding is for (used in error messages)
True once the object has been read or assigned at least once.
Safety net: pushes the tree's current serialization to the entity if it differs from the last sync point. A no-op for a binding that was never read/assigned, and for a tree whose raw text was replaced from outside (the next read re-parses; there is nothing of ours to push).
Returns the live view of the field: a Proxy over the parsed document for objects/arrays, the
bare value for a primitive JSON root, and null for a null/empty field.
Forgets the parsed tree: the next read re-parses from the entity's raw text and every proxy handed out so far is detached. Used when the record's data is replaced wholesale (Revert, reload, NewRecord) — including the case where the replacement text is identical to the text this tree started from, which the raw-text comparison alone cannot distinguish from "nothing happened" when the tree carries un-flushed edits.
Assigns a whole new value. null/undefined clears the field. A plain object/array is
adopted as the new tree, so later mutation through the caller's own reference is picked up by
Flush. Proxies from other records (or from a detached earlier tree) are deep-copied
rather than shared.
Binds one JSON text field of one entity instance to a live, typed object view.
Proxyover the parsed document. Nested plain objects/arrays are wrapped lazily on read (WeakMap-cached, soo.a === o.a), so every reference obtained from the root — however deep, or kept in a local variable — is tracked. Each mutation re-serializes the root and writes it through the entity's normalSet, so dirty tracking and change events work unchanged. Writes that do not change the canonical JSON do not callSet.Set, revert, …) the document is re-parsed; proxies handed out earlier are then detached (reads still work; WRITES through them throw, so a stale reference can never silently lose an edit or alter the entity behind its dirty tracking). A change that only re-formats identical JSON keeps the current tree so live references survive aSave()round trip.BaseEntitybefore validation and save) re-serializes the tree and writes any difference.Only plain objects and arrays are wrapped.
Date,Map, class instances etc. are left alone — wrapping them would break their internal slots.