Skip to content
@drupflare/spool v1.0.0 GitHub
    Preparing search index...

    Type Alias Ring

    The records a first document carries so the second view needs no request: the entry page and its link neighbours up to a byte budget, the routes that render them, and where the full pack is. A ring is trusted as far as the document that carried it; the pack that follows is verified.

    type Ring = {
        boot?: string;
        bootstrap: BootstrapGate;
        complete: boolean;
        digest: string;
        lease?: number;
        pack?: { bytes: number; url: string };
        protocol: 1;
        routes?: SerializedRoute[];
        tables: Record<string, BundleRows>;
        templates?: Record<string, CompiledTemplate>;
        version: number;
        webkitWorker?: true;
        worker: "auto" | "never";
        writes?: ResourceWrite[];
    }
    Index
    boot?: string

    the boot script that carries the runtime, this pack, and on a gate page the routes and templates in one response; absent when the page loads the runtime by its own tag. A gate page adds ?r=<id>, the id of those routes and templates, so a changed template is a new URL.

    bootstrap: BootstrapGate
    complete: boolean

    true when the ring holds every row, so no pack is fetched

    digest: string

    the set digest of the whole pack at that version

    lease?: number

    the worker script's lease in seconds; the worker's views inside one lease make the third; absent on an older ring

    pack?: { bytes: number; url: string }

    where the pack is and how many bytes it is; absent when complete

    protocol: 1
    routes?: SerializedRoute[]

    absent on a gate page, where the boot script the ring names carries the routes and templates

    tables: Record<string, BundleRows>

    rows by table, ascending by key

    templates?: Record<string, CompiledTemplate>

    the compiled template of each route in routes that has one, keyed by route pattern; absent with routes

    version: number

    the pack version the rows belong to

    webkitWorker?: true

    true when the site registers the worker on WebKit too (workerMode: 'always'); absent otherwise

    worker: "auto" | "never"

    an always site writes auto here, so a client that predates always reads the ring as it does an auto one

    writes?: ResourceWrite[]

    the declared resource writes, so a no-worker page can send them through spool.fetch; absent when none