Give query fields explicit read ownership and detachment
Separate shared optimistic values from query-owned and independent read lifetimes. Add opaque generated field handles, explicit readonly-safe detachment, owner status, query refresh routing, and atomic hydration validation. Preserve replay fencing and native/CRDT writes without automatic leaf fallback. Regenerate first-party bindings, update authoring guidance, and test browser replay, StrictMode, transport recovery and independent lifetimes. Local only: interface search/indexing and activated reflection remain planned; remaining browser acceptance is recorded in the A-C-B handoff.
This commit is contained in:
@@ -75,11 +75,16 @@ test("React bindings preserve read-only, writable and nested reference contracts
|
||||
);
|
||||
await fs.writeFile(
|
||||
path.join(root, "consumer.ts"),
|
||||
`import {useLiveField, tryConform, type ReadableField, type WritableField} from "@quixos/web-studio-react-runtime";
|
||||
`import {useLiveField, tryConform, detachField, type ReadableField, type WritableField} from "@quixos/web-studio-react-runtime";
|
||||
import {reactInterfaces} from "./react-props.gen.js";
|
||||
import type {ReactResults, QueryResults} from "./react-props.gen.js";
|
||||
declare const query: QueryResults["Editor"];
|
||||
useLiveField(query.root.title).set("new");
|
||||
useLiveField(detachField(query.root.title)).set("new");
|
||||
// @ts-expect-error detachment preserves readonly access
|
||||
useLiveField(detachField(query.root.summary)).set("no");
|
||||
// @ts-expect-error query handles do not expose transport metadata
|
||||
query.root.title.capability;
|
||||
// @ts-expect-error live query fields retain exact setter types
|
||||
useLiveField(query.root.title).set(123);
|
||||
// @ts-expect-error readonly query fields do not acquire a setter
|
||||
|
||||
Reference in New Issue
Block a user