Plate
Defined in: packages/xray/src/plate.ts:50
The shipped structural capture of a component’s rendered DOM — the TREE artifact a Skeleton
renders from (see the glossary: xray-js.dev/glossary). A Plate carries structure ONLY (ADR 0026):
its scoped CSS is an INDEPENDENT sibling artifact — the plugin serves it through Vite’s own CSS
pipeline (virtual:xray/plates/<name>.css, plus the shared virtual:xray/base.css, and an
export const css on the virtual JS module for dev/programmatic reads), and the
framework-neutral core.ts path hands it back separately (captureElement → { plate, css };
renderPlateHtml(plate, css) receives it explicitly). Consumers decide how to render either
part. Still self-contained in ADR 0003’s sense: both artifacts originate from the capture and
depend on nothing in the consumer’s build. Built from the RenderNode tree at plugin load (see
chunk.ts), so the adapter injects strings instead of walking a tree on the latency-critical first
paint — and no per-framework serializer ships to the client (ADR 0008).
Properties
Section titled “Properties”chunks
Section titled “chunks”chunks:
Chunk[] |null
Defined in: packages/xray/src/plate.ts:59
The root’s children, pre-serialized (ADR 0008): a stitch-free run is one HTML string; a
stitch is { r: name }; a stitch-bearing element is { c: className, k: chunk[] }. Null until
first capture.
name:
string
Defined in: packages/xray/src/plate.ts:53
Capture name; comes from the virtual-module specifier, never typed at a call site.
optionalrefs?:Record<string,Plate>
Defined in: packages/xray/src/plate.ts:68
Child plates named by the chunks’ { r } stitches, resolved through the import graph (ADR
0006). Populated by the loader’s generated imports, never serialized into the plates JSON;
absent in production when there are no stitches. In dev the live store takes precedence, so
this need not be present.
rootCls?
Section titled “rootCls?”
optionalrootCls?:string
Defined in: packages/xray/src/plate.ts:61
The root node’s own content classes (its inherited font context), if any.
v:
number
Defined in: packages/xray/src/plate.ts:51
