/** * Copyright (c) 2026 AzerothJS. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /** * The manifest as an inert page payload. * * The typed client is synchronous over a manifest VALUE; the only question is how * that value reaches the browser. Fetching `/api/_manifest` costs a network round * trip that serializes ahead of everything importing the client module - a real * waterfall on the hydration path. But on a server-rendered page the value is * already in the process that renders the HTML, so it can ride the document the * same way the router's loader handoff does: an inert JSON script tag written into * ``, read back synchronously before any module runs. * * Both halves of the wire contract live HERE - the tag id, the escaping, the * parse-and-degrade - so the writer (kit's mountPages, via the server entry) and * the reader (application client code, via the shared entry) can never drift. * A page without the tag (dev vite, prerendered files, non-kit servers) reads * `undefined` and the caller falls back to the fetch - always a correct fallback. */ import type { Manifest } from './declare.ts'; /** * SERVER: the manifest as an inert JSON script tag for the document head. * * The `<`-escape closes the only injection route out of a JSON script tag: a payload * string containing `` (or `