@torpor/view 1.2.6 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Effect-DazmAdyC.d.mts → Effect-99HYQdzZ.d.mts} +50 -33
- package/dist/Effect-99HYQdzZ.d.mts.map +1 -0
- package/dist/{Effect-Dewn7MLc.d.cts → Effect-Bf8fz_zC.d.cts} +50 -33
- package/dist/Effect-Bf8fz_zC.d.cts.map +1 -0
- package/dist/compile.cjs +1498 -101
- package/dist/compile.d.cts +268 -1
- package/dist/compile.d.cts.map +1 -1
- package/dist/compile.d.mts +268 -1
- package/dist/compile.d.mts.map +1 -1
- package/dist/compile.mjs +1495 -102
- package/dist/compile.mjs.map +1 -1
- package/dist/dev.d.cts +1 -1
- package/dist/dev.d.mts +1 -1
- package/dist/{fromWebSocket-DrN-IduP.cjs → fromWebSocket-Cdoghvmh.cjs} +15 -0
- package/dist/{fromWebSocket-CFGoMkV2.mjs → fromWebSocket-ERhd9KZR.mjs} +11 -2
- package/dist/fromWebSocket-ERhd9KZR.mjs.map +1 -0
- package/dist/index.cjs +121 -75
- package/dist/index.d.cts +12 -6
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +12 -6
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +121 -75
- package/dist/index.mjs.map +1 -1
- package/dist/runtime.iife.js +1 -0
- package/dist/slotAutoClose-BbKfzpkz.cjs +177 -0
- package/dist/slotAutoClose-CgDkf8fM.mjs +156 -0
- package/dist/slotAutoClose-CgDkf8fM.mjs.map +1 -0
- package/dist/ssr.cjs +29 -1
- package/dist/ssr.d.cts +32 -1
- package/dist/ssr.d.cts.map +1 -1
- package/dist/ssr.d.mts +32 -1
- package/dist/ssr.d.mts.map +1 -1
- package/dist/ssr.mjs +25 -2
- package/dist/ssr.mjs.map +1 -1
- package/package.json +8 -5
- package/dist/Effect-DazmAdyC.d.mts.map +0 -1
- package/dist/Effect-Dewn7MLc.d.cts.map +0 -1
- package/dist/fromWebSocket-CFGoMkV2.mjs.map +0 -1
package/dist/ssr.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { a as buildStyles, i as formatText, n as fromServer, o as buildClasses, r as fromElement, t as fromWebSocket } from "./fromWebSocket-
|
|
1
|
+
import { a as buildStyles, i as formatText, n as fromServer, o as buildClasses, r as fromElement, t as fromWebSocket } from "./fromWebSocket-ERhd9KZR.mjs";
|
|
2
|
+
import { i as firstElementTag, n as autoCloseMessage, r as closesAncestor, t as AUTO_CLOSEABLE } from "./slotAutoClose-CgDkf8fM.mjs";
|
|
2
3
|
//#region src/render/formatAttributeText.ts
|
|
3
4
|
function formatAttributeText(value) {
|
|
4
5
|
return (value ?? "").toString().replaceAll("\"", """);
|
|
@@ -47,6 +48,28 @@ function buildServerStyles(value) {
|
|
|
47
48
|
return styles === "" ? "" : `style="${styles}"`;
|
|
48
49
|
}
|
|
49
50
|
//#endregion
|
|
51
|
+
//#region src/ssr/slotGuard.ts
|
|
52
|
+
/**
|
|
53
|
+
* Server counterpart for generated slot regions whose wrapper the HTML
|
|
54
|
+
* parser can auto-close (e.g. a `<slot>` inside `<li>`). Checks the rendered
|
|
55
|
+
* fill content and throws when the parser would re-nest the region, so
|
|
56
|
+
* broken shapes fail loudly at SSR instead of shipping markup hydration
|
|
57
|
+
* can't adopt. Exported as `t_slot_guard` from `@torpor/view/ssr`.
|
|
58
|
+
*
|
|
59
|
+
* @param closeTags The slot's enclosing tags that some start tag can
|
|
60
|
+
* auto-close (nearest last).
|
|
61
|
+
* @param content The rendered fill content.
|
|
62
|
+
* @param slotName The slot name, for the error message.
|
|
63
|
+
*/
|
|
64
|
+
function slotGuard(closeTags, content, slotName) {
|
|
65
|
+
const firstTag = firstElementTag(content);
|
|
66
|
+
if (firstTag !== void 0 && closesAncestor(firstTag, closeTags)) {
|
|
67
|
+
const ancestor = closeTags.slice().reverse().find((ancestor) => closesAncestor(firstTag, [ancestor]));
|
|
68
|
+
throw new Error(`Slot "${slotName}": ${autoCloseMessage(firstTag, ancestor ?? closeTags[0])}`);
|
|
69
|
+
}
|
|
70
|
+
return content;
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
50
73
|
//#region src/ssr/$serverWatch.ts
|
|
51
74
|
let currentSite = null;
|
|
52
75
|
/** The watched getter currently being read, or null outside a `$watch` get. */
|
|
@@ -497,6 +520,6 @@ const t_run_try = unavailable("t_run_try");
|
|
|
497
520
|
const t_save_hydration = unavailable("t_save_hydration");
|
|
498
521
|
const t_skip = unavailable("t_skip");
|
|
499
522
|
//#endregion
|
|
500
|
-
export { $serverAsync as $async, $serverBatch as $batch, $serverBind as $bind, $serverCache as $cache, $serverOnmount as $onmount, $serverPeek as $peek, $serverPending as $pending, $serverRefresh as $refresh, $serverRun as $run, $serverStream as $stream, $serverUnwrap as $unwrap, $serverWatch as $watch, clearLayoutSlot, fillLayoutSlot, fromElement, fromServer, fromWebSocket, hydrate, mount, t_add_element, t_add_fragment, t_anchor, t_animate, t_apply_props, formatAttributeText as t_attr, t_attribute, runServerAwait as t_await_server, t_child, buildServerClasses as t_class, t_dynamic, t_event, t_first_inside, formatServerText as t_fmt, t_fragment, t_fragment_el, t_head_element, t_list_item, t_next, t_pop_region, t_push_region, t_region, t_rerun_region_effects, t_restore_hydration, t_root, t_root_el, t_run_await, t_run_branch, t_run_control, t_run_list, t_run_try, t_save_hydration, serverFlush as t_server_flush, t_skip, buildServerStyles as t_style, unmount };
|
|
523
|
+
export { $serverAsync as $async, $serverBatch as $batch, $serverBind as $bind, $serverCache as $cache, $serverOnmount as $onmount, $serverPeek as $peek, $serverPending as $pending, $serverRefresh as $refresh, $serverRun as $run, $serverStream as $stream, $serverUnwrap as $unwrap, $serverWatch as $watch, AUTO_CLOSEABLE, autoCloseMessage, clearLayoutSlot, closesAncestor, fillLayoutSlot, firstElementTag, fromElement, fromServer, fromWebSocket, hydrate, mount, t_add_element, t_add_fragment, t_anchor, t_animate, t_apply_props, formatAttributeText as t_attr, t_attribute, runServerAwait as t_await_server, t_child, buildServerClasses as t_class, t_dynamic, t_event, t_first_inside, formatServerText as t_fmt, t_fragment, t_fragment_el, t_head_element, t_list_item, t_next, t_pop_region, t_push_region, t_region, t_rerun_region_effects, t_restore_hydration, t_root, t_root_el, t_run_await, t_run_branch, t_run_control, t_run_list, t_run_try, t_save_hydration, serverFlush as t_server_flush, t_skip, slotGuard as t_slot_guard, buildServerStyles as t_style, unmount };
|
|
501
524
|
|
|
502
525
|
//# sourceMappingURL=ssr.mjs.map
|
package/dist/ssr.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr.mjs","names":[],"sources":["../src/render/formatAttributeText.ts","../src/ssr/formatText.ts","../src/ssr/buildClasses.ts","../src/ssr/buildStyles.ts","../src/ssr/$serverWatch.ts","../src/ssr/serverAwaitState.ts","../src/ssr/$serverAsync.ts","../src/ssr/$serverBatch.ts","../src/ssr/$serverBind.ts","../src/ssr/$serverCache.ts","../src/ssr/$serverOnmount.ts","../src/ssr/$serverPeek.ts","../src/ssr/$serverPending.ts","../src/ssr/$serverRefresh.ts","../src/ssr/$serverRun.ts","../src/ssr/$serverStream.ts","../src/ssr/$serverUnwrap.ts","../src/ssr/serverSentinels.ts","../src/ssr/runServerAwait.ts","../src/ssr/unavailable.ts"],"sourcesContent":["export default function formatAttributeText(value: any): string {\n\treturn (value ?? \"\").toString().replaceAll('\"', \""\");\n}\n","import formatText from \"../render/formatText\";\n\nconst ESCAPABLE: Record<string, string> = {\n\t\"&\": \"&\",\n\t\"<\": \"<\",\n\t\">\": \">\",\n};\n\n/**\n * Formats a text value for inclusion in server-rendered HTML.\n *\n * Unlike the client version (which assigns to `textContent` and so needs no\n * escaping), the server interpolates values into an HTML string, so the\n * characters that would otherwise be parsed as markup are escaped here.\n */\nexport default function formatServerText(value: any): string {\n\treturn formatText(value).replace(/[&<>]/g, (c) => ESCAPABLE[c]);\n}\n","import type ClassValue from \"../types/ClassValue\";\nimport buildClasses from \"../render/buildClasses\";\n\n/**\n * Server counterpart of `render/buildClasses`: builds the class string and\n * wraps it in a `class=\"...\"` attribute, or returns `\"\"` when there are no\n * classes, so the attribute is omitted rather than rendered empty. Exported\n * as `t_class` from `@torpor/view/ssr` — the only way server-compiled code\n * uses it is to interpolate the attribute into a tag.\n */\nexport default function buildServerClasses(value: ClassValue, styleHash?: string): string {\n\tconst classes = buildClasses(value, styleHash);\n\treturn classes === \"\" ? \"\" : `class=\"${classes}\"`;\n}\n","import type StyleValue from \"../types/StyleValue\";\nimport buildStyles from \"../render/buildStyles\";\n\n/**\n * Server counterpart of `render/buildStyles`: builds the style string and\n * wraps it in a `style=\"...\"` attribute, or returns `\"\"` when there are no\n * styles, so the attribute is omitted rather than rendered empty. Exported\n * as `t_style` from `@torpor/view/ssr` — the only way server-compiled code\n * uses it is to interpolate the attribute into a tag.\n */\nexport default function buildServerStyles(value: StyleValue): string {\n\tconst styles = buildStyles(value);\n\treturn styles === \"\" ? \"\" : `style=\"${styles}\"`;\n}\n","/**\n * The identity of a `source: \"server\"` getter read: the watched object and the\n * property key being read. The server await state records reads by identity\n * (rather than position) so the render pass can read a getter a different\n * number of times than the collect pass did — e.g. when markup branches on the\n * resolved value.\n */\nexport interface ServerReadSite {\n\towner: object | null;\n\tkey: PropertyKey | string;\n}\n\nlet currentSite: ServerReadSite | null = null;\n\n/** The watched getter currently being read, or null outside a `$watch` get. */\nexport function currentServerReadSite(): ServerReadSite | null {\n\treturn currentSite;\n}\n\n/**\n * Server-render counterpart of `$watch`.\n *\n * State doesn't need to be reactive on the server, so values aren't wrapped\n * for tracking. Plain objects and arrays are wrapped in a lightweight proxy\n * that only records the property key while an accessor getter runs:\n * `$serverAsync` uses that to identify the getter site across the collect and\n * render passes. Other objects (Maps, class instances, …) are returned\n * untouched — proxying them would break internal slots or private fields, and\n * they rarely carry async getters.\n */\nexport default function $serverWatch<T extends Record<PropertyKey, any>>(object: T): T {\n\tif (object === null || object === undefined) {\n\t\treturn object;\n\t}\n\tconst prototype = Object.getPrototypeOf(object);\n\tif (!Array.isArray(object) && prototype !== Object.prototype && prototype !== null) {\n\t\treturn object;\n\t}\n\n\treturn new Proxy(object, {\n\t\tget(target, key, receiver) {\n\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(target, key);\n\t\t\tif (descriptor?.get === undefined) {\n\t\t\t\treturn Reflect.get(target, key, receiver);\n\t\t\t}\n\t\t\tconst previous = currentSite;\n\t\t\tcurrentSite = { owner: target, key };\n\t\t\ttry {\n\t\t\t\treturn Reflect.get(target, key, receiver);\n\t\t\t} finally {\n\t\t\t\tcurrentSite = previous;\n\t\t\t}\n\t\t},\n\t});\n}\n","/**\n * The per-request state for a `source: \"server\"` async render. Server awaits\n * are orchestrated by `t_server_flush` (the component's render) and\n * `t_await_server` (each `@await` boundary), which coordinate through the\n * module-level `current` pointer:\n *\n * - **Collect phase** — the boundary's content is rendered speculatively (a\n * discarded pass) purely to invoke its getters. Each `source: \"server\"`\n * getter read calls its thunk (starting the fetch) and records the promise\n * here. Sibling reads in the same pass therefore start in one wave, exactly\n * like the client's speculative render.\n * - **Render phase** — after the recorded promises settle, the content is\n * rendered again; getter reads look up the settled value by getter identity\n * (watched object + property key), so the pass may read a getter a different\n * number of times than the collect pass did. The second pass's output is\n * what ships.\n *\n * `current` is only ever read synchronously (inside a helper's render\n * segments), so concurrent requests interleave safely: each helper captures\n * and restores the pointer around its awaits.\n */\nexport default interface ServerAwaitState {\n\t/** \"collect\" during the speculative pass, \"render\" during the resolved pass. */\n\tphase: \"collect\" | \"render\";\n\n\t/**\n\t * Recorded `source: \"server\"` reads, in first-read order. Each entry holds\n\t * the getter identity, the promise, its per-getter timeout, and — once\n\t * settled — the fulfilled value or rejection. A getter read more than once\n\t * is recorded once, so repeated reads share one fetch.\n\t */\n\tpromises: ServerPromiseEntry[];\n\n\t/**\n\t * Recorded reads made during the render pass, in first-read order. This is\n\t * the order the client will read the getters during hydration, so it also\n\t * determines the payload's value order.\n\t */\n\trenderEntries: ServerPromiseEntry[];\n\n\t/** Entries in `renderEntries`, for O(1) dedup while rendering. */\n\trenderSeen: Set<ServerPromiseEntry>;\n\n\t/**\n\t * Client-fetch `$async` reads made during the render pass (the server\n\t * stub's no-option calls). Any of these would suspend on the client, so a\n\t * boundary that touched one cannot ship resolved content — it degrades.\n\t */\n\tclientReads: number;\n\n\t/**\n\t * Nested boundary states created inside this boundary's collect pass,\n\t * keyed by `\"<site id>:<occurrence>\"`. The render pass re-invokes each\n\t * nested boundary in the same order, so it looks up the state by the same\n\t * key and awaits its final HTML instead of re-fetching.\n\t */\n\tchildren: Map<string, Promise<{ body: string; head: string }>>;\n\n\t/** Per-site occurrence counters, reset at the start of each pass. */\n\tcounters: Map<string, number>;\n\n\t/** Set when the boundary degrades to its `with` branch. */\n\tdegraded: boolean;\n\n\t/**\n\t * True for component flush roots. A flush root is a collect-phase context\n\t * but not a recording one: `source: \"server\"` reads outside any boundary\n\t * don't fetch. Boundaries created directly under the root stash their\n\t * final HTML here, keyed by the sentinel they returned.\n\t */\n\tisRoot: boolean;\n\n\t/**\n\t * Stashed boundary lifecycles keyed by sentinel comment, for substitution\n\t * at the end of the flush (or a degraded `with` branch's render). Only\n\t * used by flush roots.\n\t */\n\tsentinels: Map<string, Promise<{ body: string; head: string }>>;\n}\n\n/**\n * A recorded `source: \"server\"` read: the getter identity, the promise\n * returned by the getter's thunk, and the settled outcome once it arrives.\n */\nexport interface ServerPromiseEntry {\n\t/** The watched object (or null for an untracked getter). */\n\towner: object | null;\n\t/** The property key on `owner` (or the thunk source when untracked). */\n\tkey: PropertyKey | string;\n\tpromise: Promise<any>;\n\ttimeout: number;\n\t/** Set by the settle handler: `{ ok: true, value }` or `{ ok: false, error }`. */\n\tresult?: { ok: true; value: any } | { ok: false; error: any };\n}\n\n/**\n * The sentinel thrown when the render pass reads a `source: \"server\"` getter\n * that the collect pass never recorded (or one whose value hasn't settled).\n * Only this error degrades the boundary; real render errors propagate.\n */\nexport class ServerAwaitMisaligned extends Error {\n\tconstructor() {\n\t\tsuper(\"Server await render pass did not match the collect pass\");\n\t}\n}\n\n/** The innermost active server await state, or null outside any. */\nlet current: ServerAwaitState | null = null;\n\n/**\n * Runs `fn` with `state` as the current server await state. `fn` may be sync\n * or async; the pointer is restored when it settles. Because the pointer is\n * only read synchronously, interleaved async renders restore it correctly.\n */\nexport async function withServerAwait<T>(\n\tstate: ServerAwaitState | null,\n\tfn: () => T | Promise<T>,\n): Promise<T> {\n\tconst previous = current;\n\tcurrent = state;\n\ttry {\n\t\treturn await fn();\n\t} finally {\n\t\tcurrent = previous;\n\t}\n}\n\n/** The current server await state, or null. Only read synchronously. */\nexport function currentServerAwait(): ServerAwaitState | null {\n\treturn current;\n}\n\n/** Creates a fresh state for one boundary (or component flush root). */\nexport function newServerAwaitState(): ServerAwaitState {\n\treturn {\n\t\tphase: \"collect\",\n\t\tpromises: [],\n\t\trenderEntries: [],\n\t\trenderSeen: new Set(),\n\t\tclientReads: 0,\n\t\tchildren: new Map(),\n\t\tcounters: new Map(),\n\t\tdegraded: false,\n\t\tisRoot: false,\n\t\tsentinels: new Map(),\n\t};\n}\n\n/**\n * The occurrence key for a nested boundary call site: `\"<id>:<n>\"`. The\n * counter lives on the enclosing state and resets each pass, so the collect\n * and render passes derive identical key sequences.\n */\nexport function childKey(state: ServerAwaitState, id: string): string {\n\tconst n = state.counters.get(id) ?? 0;\n\tstate.counters.set(id, n + 1);\n\treturn `${id}:${n}`;\n}\n","import type AsyncOptions from \"../types/AsyncOptions\";\nimport { currentServerReadSite } from \"./$serverWatch\";\nimport type ServerAwaitState from \"./serverAwaitState\";\nimport {\n\tcurrentServerAwait,\n\tServerAwaitMisaligned,\n\ttype ServerPromiseEntry,\n} from \"./serverAwaitState\";\n\n/**\n * Default number of milliseconds a `source: \"server\"` read may take before\n * its boundary degrades to the `with` branch and the client fetches instead\n * (ASYNC.md → \"Server rendering\").\n */\nexport const SERVER_ASYNC_TIMEOUT = 5000;\n\n/**\n * Server counterpart of the client-side `$async` getter primitive.\n *\n * Without options (the default), this is a no-op stub: server renders are\n * synchronous, an async value never resolves during SSR, and `@await`\n * boundaries render their `with` branch and never read the getter. The stub\n * exists so server builds importing `$async` don't emit a dangling import.\n * A read inside a boundary's render pass is still recorded, so the boundary\n * degrades to the `with` branch + client fetch instead of shipping content\n * that would suspend on the client.\n *\n * With `{ source: \"server\" }` the getter participates in the server's\n * collect/render pass (ASYNC.md → \"Server rendering\"):\n *\n * - **Collect pass** — calls the thunk (starting the fetch) and records the\n * promise on the enclosing boundary, so sibling reads start in one wave.\n * The read is keyed by getter identity (watched object + property key), so\n * reading the same getter again reuses the recorded fetch. Returns\n * `undefined`; the speculative pass's output is discarded.\n * - **Render pass** — returns the settled value for the same getter identity,\n * without calling the thunk again. The pass may read a getter any number of\n * times, so markup may branch on the resolved value. A rejection is\n * re-thrown here so `@try`/`@error` handles it like any other render error.\n * Reading a getter the collect pass never touched throws a sentinel that\n * degrades the boundary (its value can't be resolved without fetching, and\n * the shipped HTML can't be trusted).\n *\n * Outside any `@await` boundary (including in a `with` branch) a\n * `source: \"server\"` read returns `undefined` without fetching — the same\n * undefined-then-recover contract the client has for un-boundaried reads.\n */\nexport default function $serverAsync<T>(\n\tfn: (serverValue?: T) => Promise<T>,\n\toptions?: AsyncOptions,\n): T {\n\tconst state = currentServerAwait();\n\n\tif (state === null || state.isRoot || options?.source !== \"server\") {\n\t\tif (state !== null && !state.isRoot && state.phase === \"render\") {\n\t\t\t// A client-fetch read during a boundary's render pass: the client\n\t\t\t// will suspend on it, so the boundary can't ship resolved content\n\t\t\tstate.clientReads++;\n\t\t}\n\t\treturn undefined as T;\n\t}\n\n\t// Identity captured before the thunk runs: reads inside the thunk (e.g.\n\t// `$state.id`) must not be mistaken for the getter being read here\n\tconst site = currentServerReadSite();\n\tconst owner = site?.owner ?? null;\n\tconst key = site?.key ?? fn.toString();\n\n\tif (state.phase === \"collect\") {\n\t\t// A repeated read of the same getter shares the first fetch\n\t\tconst existing = findEntry(state, owner, key);\n\t\tif (existing === undefined) {\n\t\t\tconst entry: ServerPromiseEntry = {\n\t\t\t\towner,\n\t\t\t\tkey,\n\t\t\t\tpromise: fn(),\n\t\t\t\ttimeout: options.timeout ?? SERVER_ASYNC_TIMEOUT,\n\t\t\t};\n\t\t\t// Record the outcome as soon as it settles — this both captures the\n\t\t\t// value/error for the render pass and consumes the rejection, so a\n\t\t\t// boundary that degrades (timeout) or a superseded fetch can never\n\t\t\t// surface as an unhandled rejection\n\t\t\tentry.promise.then(\n\t\t\t\t(value) => {\n\t\t\t\t\tentry.result = { ok: true, value };\n\t\t\t\t},\n\t\t\t\t(error) => {\n\t\t\t\t\tentry.result = { ok: false, error };\n\t\t\t\t},\n\t\t\t);\n\t\t\tstate.promises.push(entry);\n\t\t}\n\t\treturn undefined as T;\n\t}\n\n\t// Render pass: look the recorded read up by getter identity\n\tconst entry = findEntry(state, owner, key);\n\tif (entry === undefined) {\n\t\tthrow new ServerAwaitMisaligned();\n\t}\n\tif (!state.renderSeen.has(entry)) {\n\t\tstate.renderSeen.add(entry);\n\t\tstate.renderEntries.push(entry);\n\t}\n\tconst result = entry.result;\n\tif (result === undefined) {\n\t\t// Not settled — only possible when the boundary already blew its\n\t\t// timeout, which degrades before rendering; treat as misaligned\n\t\tthrow new ServerAwaitMisaligned();\n\t}\n\tif (result.ok) {\n\t\treturn result.value as T;\n\t}\n\tthrow result.error;\n}\n\nfunction findEntry(\n\tstate: ServerAwaitState,\n\towner: object | null,\n\tkey: PropertyKey | string,\n): ServerPromiseEntry | undefined {\n\tfor (const entry of state.promises) {\n\t\tif (entry.owner === owner && entry.key === key) {\n\t\t\treturn entry;\n\t\t}\n\t}\n\treturn undefined;\n}\n","export default function $serverBatch<T>(fn: () => T): T {\n\treturn fn();\n}\n","/**\n * Server no-op for the client-side `$bind` two-way sync primitive. Two-way\n * binding is a client runtime feature — there are no reactive updates during\n * SSR, so there is nothing to sync. The stub exists so server builds\n * importing `$bind` don't emit a dangling import.\n */\nexport default function $serverBind(\n\t_state: Record<PropertyKey, any>,\n\t_props: Record<PropertyKey, any> | undefined,\n\t..._keys: (string | string[])[]\n): void {}\n","export default function $serverCache<T>(fn: () => T): T {\n\treturn fn();\n}\n","import type Cleanup from \"../types/Cleanup\";\n\nexport default function $serverOnmount(_fn: () => Cleanup | void): void {}\n","export default function $serverPeek<T>(fn: () => T): T {\n\treturn fn();\n}\n","/**\n * Server no-op for the client-side `$pending` query. Nothing is ever pending\n * during a synchronous SSR render, so the query is always `false`. The stub\n * exists so server builds importing `$pending` don't emit a dangling import.\n */\nexport default function $serverPending(_fn: () => any): boolean {\n\treturn false;\n}\n","/**\n * Server no-op for the client-side `$refresh` primitive. A refresh is an\n * imperative action that never runs during SSR. The stub exists so server\n * builds importing `$refresh` don't emit a dangling import.\n */\nexport default function $serverRefresh(_fn: () => any): void {}\n","import type Cleanup from \"../types/Cleanup\";\n\nexport default function $serverRun(_fn: () => Cleanup | void): void {}\n","import type StreamSource from \"../types/StreamSource\";\n\n/**\n * Server stub for `$stream` — external sources are never subscribed to\n * during a server render. The subscription starts when the component is\n * mounted on the client.\n */\nexport default function $serverStream<T>(\n\t_source: StreamSource<T>,\n\t_handler: (value: T) => void,\n\t_options?: { debounce?: number },\n): void {}\n","export default function $serverUnwrap<T extends Record<PropertyKey, any>>(object: T): T {\n\treturn object;\n}\n","import { newServerAwaitState, withServerAwait } from \"./serverAwaitState\";\nimport type ServerAwaitState from \"./serverAwaitState\";\n\n/** Comment prefix marking an unsubstituted boundary sentinel. */\nexport const SENTINEL_PREFIX = \"<!--t-aw:\";\n\n/** The body/head pair that server components and boundaries render into. */\nexport interface ServerHtml {\n\tbody: string;\n\thead: string;\n}\n\n/**\n * Renders a component's (or a degraded boundary's `with` branch's) markup\n * with a fresh flush root as the enclosing await state, then substitutes any\n * boundary sentinels with their final HTML.\n *\n * Boundaries created during the render stash their lifecycle promise under a\n * sentinel comment and return the sentinel immediately, so the render itself\n * never blocks on a fetch — every `source: \"server\"` read in the render\n * starts in the same wave. Substitution awaits the stashed promises at the\n * end, which is the only point an async component render actually waits.\n *\n * On the client this has no counterpart: `render` here is the compiled\n * component body closure that the generated component function returns.\n */\nexport async function serverFlush(render: () => Promise<ServerHtml>): Promise<ServerHtml> {\n\tconst state = newServerAwaitState();\n\tstate.isRoot = true;\n\tconst result = await withServerAwait(state, render);\n\treturn substituteSentinels(result, state);\n}\n\n/**\n * Renders a degraded boundary's `with` branch inside its own flush root, so\n * a `with` branch containing its own `@await` boundaries still resolves\n * them, then wraps it in the boundary's hydration markers. The `with` branch\n * must not start server fetches for its own reads — the flush root isn't a\n * recording context.\n */\nexport async function renderWithBranch(\n\trenderWith: (() => Promise<ServerHtml>) | null,\n): Promise<ServerHtml> {\n\tconst html = await serverFlush(async () => {\n\t\tif (renderWith === null) {\n\t\t\treturn { body: \"\", head: \"\" };\n\t\t}\n\t\treturn renderWith();\n\t});\n\treturn { body: `<![>${html.body}<!]><!>`, head: html.head };\n}\n\n/**\n * Replaces every sentinel the state stashed with its boundary's final HTML.\n * Boundary head tags are appended to the head (they hoist into the document\n * head regardless of where the boundary sits in the body). Any sentinel left\n * over means a boundary's state was lost — a bug, not a degradation path, so\n * it throws.\n */\nexport async function substituteSentinels(\n\tresult: ServerHtml,\n\tstate: ServerAwaitState,\n): Promise<ServerHtml> {\n\tlet { body, head } = result;\n\tfor (const [sentinel, promise] of state.sentinels) {\n\t\tconst html = await promise;\n\t\tbody = body.split(sentinel).join(html.body);\n\t\thead += html.head;\n\t}\n\tif (body.includes(SENTINEL_PREFIX) || head.includes(SENTINEL_PREFIX)) {\n\t\tthrow new Error(\"Unsubstituted async boundary sentinel — boundary state was lost\");\n\t}\n\treturn { body, head };\n}\n","import {\n\tchildKey,\n\tcurrentServerAwait,\n\tnewServerAwaitState,\n\tServerAwaitMisaligned,\n\twithServerAwait,\n} from \"./serverAwaitState\";\nimport type ServerAwaitState from \"./serverAwaitState\";\nimport { renderWithBranch } from \"./serverSentinels\";\n\nlet sentinelCount = 0;\n\nfunction nextSentinel(): string {\n\treturn `<!--t-aw:${sentinelCount++}-->`;\n}\n\n/**\n * Renders an `@await` boundary on the server (compiled as `t_await_server`).\n *\n * The generated code calls this for every `@await`, passing the boundary's\n * site id, a closure that renders the content branch, and one that renders\n * the `with` branch. It always returns a `{ body, head }` pair to append:\n *\n * - **Inside a boundary's render pass** — this boundary was already started\n * during the collect pass; its body/head is the finished HTML (awaited if\n * still in flight). A missing entry means the render pass doesn't match\n * the collect pass, which degrades the enclosing boundary.\n * - **Inside a collect pass or a component flush** — start the full\n * lifecycle (collect, settle, render) without blocking the enclosing\n * render, and return a sentinel comment as the body. Sibling reads and\n * nested boundaries keep rendering, so every fetch in the pass starts in\n * one wave. The sentinel is substituted later: by the enclosing boundary's\n * render pass (which re-invokes this helper and awaits the finished HTML),\n * or by the component flush (which replaces top-level sentinels directly).\n *\n * The lifecycle: render content once to start the `source: \"server\"` fetches\n * (discarding the output), wait for them with a per-getter timeout, then\n * render again with the settled values. Reads are matched by getter identity,\n * so the render pass may read a getter more than once (e.g. branch on it).\n * The second pass ships wrapped in hydration markers plus a\n * `<!--t-await:...-->` comment carrying the values for the client's `$async`\n * hydration path. Any instability — timeout, a render pass that reads a getter\n * the collect pass never touched, a client-fetch read — degrades to the `with`\n * branch + client fetch, exactly the pre-`source` behavior.\n *\n * @param id The boundary's site id (unique per `@await` in the component)\n * @param renderContent Renders the content branch (may read `$async` getters)\n * @param renderWith Renders the `with` branch, or null for empty\n */\nexport default function runServerAwait(\n\tid: string,\n\trenderContent: () => Promise<{ body: string; head: string }>,\n\trenderWith: (() => Promise<{ body: string; head: string }>) | null,\n): { body: string; head: string } | Promise<{ body: string; head: string }> {\n\tconst parent = currentServerAwait();\n\n\tif (parent !== null && parent.phase === \"render\") {\n\t\t// The enclosing boundary is rendering its resolved pass: this nested\n\t\t// boundary was started during the collect pass, so reuse its result\n\t\tconst cached = parent.children.get(childKey(parent, id));\n\t\tif (cached === undefined) {\n\t\t\tthrow new ServerAwaitMisaligned();\n\t\t}\n\t\treturn cached;\n\t}\n\n\tconst state = newServerAwaitState();\n\tconst final = renderBoundary(state, renderContent, renderWith);\n\n\tconst sentinel = nextSentinel();\n\tif (parent !== null) {\n\t\tif (parent.isRoot) {\n\t\t\t// Top-level boundary: the component flush substitutes the sentinel\n\t\t\tparent.sentinels.set(sentinel, final);\n\t\t} else {\n\t\t\t// Nested boundary: the enclosing boundary's render pass looks this\n\t\t\t// up by occurrence key\n\t\t\tparent.children.set(childKey(parent, id), final);\n\t\t}\n\t}\n\t// The sentinel body is replaced by the finished content; the head tags a\n\t// resolved boundary renders are hoisted when it finishes\n\treturn { body: sentinel, head: \"\" };\n}\n\n/**\n * The full lifecycle for one boundary: speculative collect pass, settle, and\n * resolved render pass. Runs concurrently with the enclosing render; the\n * returned promise resolves to the boundary's final HTML.\n */\nasync function renderBoundary(\n\tstate: ServerAwaitState,\n\trenderContent: () => Promise<{ body: string; head: string }>,\n\trenderWith: (() => Promise<{ body: string; head: string }>) | null,\n): Promise<{ body: string; head: string }> {\n\t// Collect pass: render content speculatively to invoke the getters. Each\n\t// `source: \"server\"` read starts its fetch and is recorded; sibling reads\n\t// in this pass therefore start together. The output is discarded — reads\n\t// return undefined, so user markup that dereferences them may throw, and\n\t// a throw here costs nothing.\n\tawait withServerAwait(state, renderContent).catch(() => {\n\t\t// Expected when unresolved values are dereferenced; fetches already\n\t\t// started. Any other error resurfaces in the render pass below.\n\t});\n\n\tif (state.promises.length === 0) {\n\t\t// No server-source reads: nothing was (or can be) resolved here, so\n\t\t// ship the `with` branch and let the client fetch — the default SSR\n\t\t// behavior for client-fetch getters\n\t\treturn renderWithBranch(renderWith);\n\t}\n\n\t// Settle the recorded fetches. Each getter carries its own timeout; the\n\t// boundary waits for the longest, and a miss degrades the whole boundary\n\t// (content ships only when every read resolved)\n\tconst timeout = Math.max(...state.promises.map((entry) => entry.timeout));\n\tconst settled = await Promise.race([\n\t\tPromise.all(\n\t\t\tstate.promises.map((entry) =>\n\t\t\t\tentry.promise.then(\n\t\t\t\t\t() => true,\n\t\t\t\t\t() => true,\n\t\t\t\t),\n\t\t\t),\n\t\t).then(\n\t\t\t() => true,\n\t\t\t() => true,\n\t\t),\n\t\tnew Promise<false>((resolve) => setTimeout(resolve, timeout, false)),\n\t]);\n\n\t// Render pass: same reads, now looking settled values up by getter\n\t// identity. The pass may read a getter more than once (markup can branch\n\t// on its value), but every read must have been recorded by the collect\n\t// pass. A read the collect pass never touched, a client-fetch read, or a\n\t// render error means the content can't be trusted, and the boundary\n\t// degrades.\n\t//\n\t// A rejection (or any render error) also degrades: the boundary's\n\t// lifecycle runs detached from the enclosing render (which has already\n\t// moved on after the sentinel), so the error can't propagate to the\n\t// emitted `@try` positionally. Instead the with branch ships and the\n\t// client re-runs the getter, rejects there, and its `@try` renders the\n\t// catch branch — the same path a client-fetch error takes.\n\tlet degraded = settled === false;\n\tlet content: { body: string; head: string } | undefined;\n\tif (!degraded) {\n\t\tstate.phase = \"render\";\n\t\tstate.renderEntries.length = 0;\n\t\tstate.renderSeen.clear();\n\t\tstate.clientReads = 0;\n\t\tstate.counters.clear();\n\t\ttry {\n\t\t\tcontent = await withServerAwait(state, renderContent);\n\t\t\tif (state.clientReads > 0) {\n\t\t\t\tdegraded = true;\n\t\t\t}\n\t\t} catch {\n\t\t\tdegraded = true;\n\t\t}\n\t}\n\n\tif (degraded || content === undefined) {\n\t\tstate.degraded = true;\n\t\ttry {\n\t\t\treturn await renderWithBranch(renderWith);\n\t\t} catch {\n\t\t\t// A with-branch render error can't be positioned either; ship an\n\t\t\t// empty boundary rather than failing the whole response\n\t\t\treturn { body: \"<![><!]><!>\", head: \"\" };\n\t\t}\n\t}\n\n\t// Ship the resolved content with the embedded values for hydration.\n\t// Rejections never reach here — the render pass consumes them and\n\t// degrades — but guard anyway so a bad entry can't ship as `undefined`\n\tconst values: any[] = [];\n\tfor (const entry of state.renderEntries) {\n\t\tconst result = entry.result;\n\t\tif (result === undefined) {\n\t\t\tdegraded = true;\n\t\t\tbreak;\n\t\t}\n\t\tvalues.push(result.ok ? result.value : undefined);\n\t}\n\tif (degraded) {\n\t\tstate.degraded = true;\n\t\treturn renderWithBranch(renderWith);\n\t}\n\treturn {\n\t\tbody: `${\"<![>\"}${content.body}${\"<!]><!>\"}${payloadComment(values)}`,\n\t\thead: content.head,\n\t};\n}\n\n/**\n * The `<!--t-await:...-->` comment carrying the boundary's resolved values,\n * in the order the render pass first read them, for the client's `$async`\n * hydration path. `-->` inside the JSON is escaped so the comment can't\n * terminate early.\n */\nfunction payloadComment(values: any[]): string {\n\tconst json = JSON.stringify(values).replaceAll(\"-->\", \"--\\\\u003E\");\n\treturn `<!--t-await:${json}-->`;\n}\n","/**\n * Server stubs for the client-only runtime, so that modules compiled for the\n * client -- or shared helpers that import them from the main `@torpor/view`\n * entry -- still resolve when they end up in a server bundle (the SSR\n * environment resolves `@torpor/view` to this module; see @torpor/build's\n * ssr-view plugin).\n *\n * They throw when called: mounting, hydrating and DOM rendering must not run\n * during SSR. Importing them is fine, which keeps a stray client-only import\n * from failing the server build.\n */\ntype Unavailable = (...args: unknown[]) => never;\n\nfunction unavailable(name: string): Unavailable {\n\treturn (..._args: unknown[]): never => {\n\t\tthrow new Error(`${name} is not available during server rendering`);\n\t};\n}\n\nexport const mount: Unavailable = unavailable(\"mount\");\nexport const hydrate: Unavailable = unavailable(\"hydrate\");\nexport const unmount: Unavailable = unavailable(\"unmount\");\nexport const fillLayoutSlot: Unavailable = unavailable(\"fillLayoutSlot\");\nexport const clearLayoutSlot: Unavailable = unavailable(\"clearLayoutSlot\");\n\nexport const t_add_element: Unavailable = unavailable(\"t_add_element\");\nexport const t_add_fragment: Unavailable = unavailable(\"t_add_fragment\");\nexport const t_anchor: Unavailable = unavailable(\"t_anchor\");\nexport const t_animate: Unavailable = unavailable(\"t_animate\");\nexport const t_apply_props: Unavailable = unavailable(\"t_apply_props\");\nexport const t_attribute: Unavailable = unavailable(\"t_attribute\");\nexport const t_child: Unavailable = unavailable(\"t_child\");\nexport const t_dynamic: Unavailable = unavailable(\"t_dynamic\");\nexport const t_event: Unavailable = unavailable(\"t_event\");\nexport const t_first_inside: Unavailable = unavailable(\"t_first_inside\");\nexport const t_fragment: Unavailable = unavailable(\"t_fragment\");\nexport const t_fragment_el: Unavailable = unavailable(\"t_fragment_el\");\nexport const t_head_element: Unavailable = unavailable(\"t_head_element\");\nexport const t_list_item: Unavailable = unavailable(\"t_list_item\");\nexport const t_next: Unavailable = unavailable(\"t_next\");\nexport const t_pop_region: Unavailable = unavailable(\"t_pop_region\");\nexport const t_push_region: Unavailable = unavailable(\"t_push_region\");\nexport const t_region: Unavailable = unavailable(\"t_region\");\nexport const t_rerun_region_effects: Unavailable = unavailable(\"t_rerun_region_effects\");\nexport const t_restore_hydration: Unavailable = unavailable(\"t_restore_hydration\");\nexport const t_root: Unavailable = unavailable(\"t_root\");\nexport const t_root_el: Unavailable = unavailable(\"t_root_el\");\nexport const t_run_await: Unavailable = unavailable(\"t_run_await\");\nexport const t_run_branch: Unavailable = unavailable(\"t_run_branch\");\nexport const t_run_control: Unavailable = unavailable(\"t_run_control\");\nexport const t_run_list: Unavailable = unavailable(\"t_run_list\");\nexport const t_run_try: Unavailable = unavailable(\"t_run_try\");\nexport const t_save_hydration: Unavailable = unavailable(\"t_save_hydration\");\nexport const t_skip: Unavailable = unavailable(\"t_skip\");\n"],"mappings":";;AAAA,SAAwB,oBAAoB,OAAoB;CAC/D,QAAQ,SAAS,GAAA,CAAI,SAAS,CAAC,CAAC,WAAW,MAAK,QAAQ;AACzD;;;ACAA,MAAM,YAAoC;CACzC,KAAK;CACL,KAAK;CACL,KAAK;AACN;;;;;;;;AASA,SAAwB,iBAAiB,OAAoB;CAC5D,OAAO,WAAW,KAAK,CAAC,CAAC,QAAQ,WAAW,MAAM,UAAU,EAAE;AAC/D;;;;;;;;;;ACPA,SAAwB,mBAAmB,OAAmB,WAA4B;CACzF,M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gB;AACvE,MAAa,WAAwB,YAAY,UAAU;AAC3D,MAAa,YAAyB,YAAY,WAAW;AAC7D,MAAa,gBAA6B,YAAY,eAAe;AACrE,MAAa,cAA2B,YAAY,aAAa;AACjE,MAAa,UAAuB,YAAY,SAAS;AACzD,MAAa,YAAyB,YAAY,WAAW;AAC7D,MAAa,UAAuB,YAAY,SAAS;AACzD,MAAa,iBAA8B,YAAY,gBAAgB;AACvE,MAAa,aAA0B,YAAY,YAAY;AAC/D,MAAa,gBAA6B,YAAY,eAAe;AACrE,MAAa,iBAA8B,YAAY,gBAAgB;AACvE,MAAa,cAA2B,YAAY,aAAa;AACjE,MAAa,SAAsB,YAAY,QAAQ;AACvD,MAAa,eAA4B,YAAY,cAAc;AACnE,MAAa,gBAA6B,YAAY,eAAe;AACrE,MAAa,WAAwB,YAAY,UAAU;AAC3D,MAAa,yBAAsC,YAAY,wBAAwB;AACvF,MAAa,sBAAmC,YAAY,qBAAqB;AACjF,MAAa,SAAsB,YAAY,QAAQ;AACvD,MAAa,YAAyB,YAAY,WAAW;AAC7D,MAAa,cAA2B,YAAY,aAAa;AACjE,MAAa,eAA4B,YAAY,cAAc;AACnE,MAAa,gBAA6B,YAAY,eAAe;AACrE,MAAa,aAA0B,YAAY,YAAY;AAC/D,MAAa,YAAyB,YAAY,WAAW;AAC7D,MAAa,mBAAgC,YAAY,kBAAkB;AAC3E,MAAa,SAAsB,YAAY,QAAQ"}
|
|
1
|
+
{"version":3,"file":"ssr.mjs","names":[],"sources":["../src/render/formatAttributeText.ts","../src/ssr/formatText.ts","../src/ssr/buildClasses.ts","../src/ssr/buildStyles.ts","../src/ssr/slotGuard.ts","../src/ssr/$serverWatch.ts","../src/ssr/serverAwaitState.ts","../src/ssr/$serverAsync.ts","../src/ssr/$serverBatch.ts","../src/ssr/$serverBind.ts","../src/ssr/$serverCache.ts","../src/ssr/$serverOnmount.ts","../src/ssr/$serverPeek.ts","../src/ssr/$serverPending.ts","../src/ssr/$serverRefresh.ts","../src/ssr/$serverRun.ts","../src/ssr/$serverStream.ts","../src/ssr/$serverUnwrap.ts","../src/ssr/serverSentinels.ts","../src/ssr/runServerAwait.ts","../src/ssr/unavailable.ts"],"sourcesContent":["export default function formatAttributeText(value: any): string {\n\treturn (value ?? \"\").toString().replaceAll('\"', \""\");\n}\n","import formatText from \"../render/formatText\";\n\nconst ESCAPABLE: Record<string, string> = {\n\t\"&\": \"&\",\n\t\"<\": \"<\",\n\t\">\": \">\",\n};\n\n/**\n * Formats a text value for inclusion in server-rendered HTML.\n *\n * Unlike the client version (which assigns to `textContent` and so needs no\n * escaping), the server interpolates values into an HTML string, so the\n * characters that would otherwise be parsed as markup are escaped here.\n */\nexport default function formatServerText(value: any): string {\n\treturn formatText(value).replace(/[&<>]/g, (c) => ESCAPABLE[c]);\n}\n","import type ClassValue from \"../types/ClassValue\";\nimport buildClasses from \"../render/buildClasses\";\n\n/**\n * Server counterpart of `render/buildClasses`: builds the class string and\n * wraps it in a `class=\"...\"` attribute, or returns `\"\"` when there are no\n * classes, so the attribute is omitted rather than rendered empty. Exported\n * as `t_class` from `@torpor/view/ssr` — the only way server-compiled code\n * uses it is to interpolate the attribute into a tag.\n */\nexport default function buildServerClasses(value: ClassValue, styleHash?: string): string {\n\tconst classes = buildClasses(value, styleHash);\n\treturn classes === \"\" ? \"\" : `class=\"${classes}\"`;\n}\n","import type StyleValue from \"../types/StyleValue\";\nimport buildStyles from \"../render/buildStyles\";\n\n/**\n * Server counterpart of `render/buildStyles`: builds the style string and\n * wraps it in a `style=\"...\"` attribute, or returns `\"\"` when there are no\n * styles, so the attribute is omitted rather than rendered empty. Exported\n * as `t_style` from `@torpor/view/ssr` — the only way server-compiled code\n * uses it is to interpolate the attribute into a tag.\n */\nexport default function buildServerStyles(value: StyleValue): string {\n\tconst styles = buildStyles(value);\n\treturn styles === \"\" ? \"\" : `style=\"${styles}\"`;\n}\n","import { autoCloseMessage, closesAncestor, firstElementTag } from \"../compile/utils/slotAutoClose\";\n\n/**\n * Server counterpart for generated slot regions whose wrapper the HTML\n * parser can auto-close (e.g. a `<slot>` inside `<li>`). Checks the rendered\n * fill content and throws when the parser would re-nest the region, so\n * broken shapes fail loudly at SSR instead of shipping markup hydration\n * can't adopt. Exported as `t_slot_guard` from `@torpor/view/ssr`.\n *\n * @param closeTags The slot's enclosing tags that some start tag can\n * auto-close (nearest last).\n * @param content The rendered fill content.\n * @param slotName The slot name, for the error message.\n */\nexport default function slotGuard(closeTags: string[], content: string, slotName: string): string {\n\tconst firstTag = firstElementTag(content);\n\tif (firstTag !== undefined && closesAncestor(firstTag, closeTags)) {\n\t\tconst ancestor = closeTags\n\t\t\t.slice()\n\t\t\t.reverse()\n\t\t\t.find((ancestor) => closesAncestor(firstTag, [ancestor]));\n\t\tthrow new Error(`Slot \"${slotName}\": ${autoCloseMessage(firstTag, ancestor ?? closeTags[0]!)}`);\n\t}\n\treturn content;\n}\n","/**\n * The identity of a `source: \"server\"` getter read: the watched object and the\n * property key being read. The server await state records reads by identity\n * (rather than position) so the render pass can read a getter a different\n * number of times than the collect pass did — e.g. when markup branches on the\n * resolved value.\n */\nexport interface ServerReadSite {\n\towner: object | null;\n\tkey: PropertyKey | string;\n}\n\nlet currentSite: ServerReadSite | null = null;\n\n/** The watched getter currently being read, or null outside a `$watch` get. */\nexport function currentServerReadSite(): ServerReadSite | null {\n\treturn currentSite;\n}\n\n/**\n * Server-render counterpart of `$watch`.\n *\n * State doesn't need to be reactive on the server, so values aren't wrapped\n * for tracking. Plain objects and arrays are wrapped in a lightweight proxy\n * that only records the property key while an accessor getter runs:\n * `$serverAsync` uses that to identify the getter site across the collect and\n * render passes. Other objects (Maps, class instances, …) are returned\n * untouched — proxying them would break internal slots or private fields, and\n * they rarely carry async getters.\n */\nexport default function $serverWatch<T extends Record<PropertyKey, any>>(object: T): T {\n\tif (object === null || object === undefined) {\n\t\treturn object;\n\t}\n\tconst prototype = Object.getPrototypeOf(object);\n\tif (!Array.isArray(object) && prototype !== Object.prototype && prototype !== null) {\n\t\treturn object;\n\t}\n\n\treturn new Proxy(object, {\n\t\tget(target, key, receiver) {\n\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(target, key);\n\t\t\tif (descriptor?.get === undefined) {\n\t\t\t\treturn Reflect.get(target, key, receiver);\n\t\t\t}\n\t\t\tconst previous = currentSite;\n\t\t\tcurrentSite = { owner: target, key };\n\t\t\ttry {\n\t\t\t\treturn Reflect.get(target, key, receiver);\n\t\t\t} finally {\n\t\t\t\tcurrentSite = previous;\n\t\t\t}\n\t\t},\n\t});\n}\n","/**\n * The per-request state for a `source: \"server\"` async render. Server awaits\n * are orchestrated by `t_server_flush` (the component's render) and\n * `t_await_server` (each `@await` boundary), which coordinate through the\n * module-level `current` pointer:\n *\n * - **Collect phase** — the boundary's content is rendered speculatively (a\n * discarded pass) purely to invoke its getters. Each `source: \"server\"`\n * getter read calls its thunk (starting the fetch) and records the promise\n * here. Sibling reads in the same pass therefore start in one wave, exactly\n * like the client's speculative render.\n * - **Render phase** — after the recorded promises settle, the content is\n * rendered again; getter reads look up the settled value by getter identity\n * (watched object + property key), so the pass may read a getter a different\n * number of times than the collect pass did. The second pass's output is\n * what ships.\n *\n * `current` is only ever read synchronously (inside a helper's render\n * segments), so concurrent requests interleave safely: each helper captures\n * and restores the pointer around its awaits.\n */\nexport default interface ServerAwaitState {\n\t/** \"collect\" during the speculative pass, \"render\" during the resolved pass. */\n\tphase: \"collect\" | \"render\";\n\n\t/**\n\t * Recorded `source: \"server\"` reads, in first-read order. Each entry holds\n\t * the getter identity, the promise, its per-getter timeout, and — once\n\t * settled — the fulfilled value or rejection. A getter read more than once\n\t * is recorded once, so repeated reads share one fetch.\n\t */\n\tpromises: ServerPromiseEntry[];\n\n\t/**\n\t * Recorded reads made during the render pass, in first-read order. This is\n\t * the order the client will read the getters during hydration, so it also\n\t * determines the payload's value order.\n\t */\n\trenderEntries: ServerPromiseEntry[];\n\n\t/** Entries in `renderEntries`, for O(1) dedup while rendering. */\n\trenderSeen: Set<ServerPromiseEntry>;\n\n\t/**\n\t * Client-fetch `$async` reads made during the render pass (the server\n\t * stub's no-option calls). Any of these would suspend on the client, so a\n\t * boundary that touched one cannot ship resolved content — it degrades.\n\t */\n\tclientReads: number;\n\n\t/**\n\t * Nested boundary states created inside this boundary's collect pass,\n\t * keyed by `\"<site id>:<occurrence>\"`. The render pass re-invokes each\n\t * nested boundary in the same order, so it looks up the state by the same\n\t * key and awaits its final HTML instead of re-fetching.\n\t */\n\tchildren: Map<string, Promise<{ body: string; head: string }>>;\n\n\t/** Per-site occurrence counters, reset at the start of each pass. */\n\tcounters: Map<string, number>;\n\n\t/** Set when the boundary degrades to its `with` branch. */\n\tdegraded: boolean;\n\n\t/**\n\t * True for component flush roots. A flush root is a collect-phase context\n\t * but not a recording one: `source: \"server\"` reads outside any boundary\n\t * don't fetch. Boundaries created directly under the root stash their\n\t * final HTML here, keyed by the sentinel they returned.\n\t */\n\tisRoot: boolean;\n\n\t/**\n\t * Stashed boundary lifecycles keyed by sentinel comment, for substitution\n\t * at the end of the flush (or a degraded `with` branch's render). Only\n\t * used by flush roots.\n\t */\n\tsentinels: Map<string, Promise<{ body: string; head: string }>>;\n}\n\n/**\n * A recorded `source: \"server\"` read: the getter identity, the promise\n * returned by the getter's thunk, and the settled outcome once it arrives.\n */\nexport interface ServerPromiseEntry {\n\t/** The watched object (or null for an untracked getter). */\n\towner: object | null;\n\t/** The property key on `owner` (or the thunk source when untracked). */\n\tkey: PropertyKey | string;\n\tpromise: Promise<any>;\n\ttimeout: number;\n\t/** Set by the settle handler: `{ ok: true, value }` or `{ ok: false, error }`. */\n\tresult?: { ok: true; value: any } | { ok: false; error: any };\n}\n\n/**\n * The sentinel thrown when the render pass reads a `source: \"server\"` getter\n * that the collect pass never recorded (or one whose value hasn't settled).\n * Only this error degrades the boundary; real render errors propagate.\n */\nexport class ServerAwaitMisaligned extends Error {\n\tconstructor() {\n\t\tsuper(\"Server await render pass did not match the collect pass\");\n\t}\n}\n\n/** The innermost active server await state, or null outside any. */\nlet current: ServerAwaitState | null = null;\n\n/**\n * Runs `fn` with `state` as the current server await state. `fn` may be sync\n * or async; the pointer is restored when it settles. Because the pointer is\n * only read synchronously, interleaved async renders restore it correctly.\n */\nexport async function withServerAwait<T>(\n\tstate: ServerAwaitState | null,\n\tfn: () => T | Promise<T>,\n): Promise<T> {\n\tconst previous = current;\n\tcurrent = state;\n\ttry {\n\t\treturn await fn();\n\t} finally {\n\t\tcurrent = previous;\n\t}\n}\n\n/** The current server await state, or null. Only read synchronously. */\nexport function currentServerAwait(): ServerAwaitState | null {\n\treturn current;\n}\n\n/** Creates a fresh state for one boundary (or component flush root). */\nexport function newServerAwaitState(): ServerAwaitState {\n\treturn {\n\t\tphase: \"collect\",\n\t\tpromises: [],\n\t\trenderEntries: [],\n\t\trenderSeen: new Set(),\n\t\tclientReads: 0,\n\t\tchildren: new Map(),\n\t\tcounters: new Map(),\n\t\tdegraded: false,\n\t\tisRoot: false,\n\t\tsentinels: new Map(),\n\t};\n}\n\n/**\n * The occurrence key for a nested boundary call site: `\"<id>:<n>\"`. The\n * counter lives on the enclosing state and resets each pass, so the collect\n * and render passes derive identical key sequences.\n */\nexport function childKey(state: ServerAwaitState, id: string): string {\n\tconst n = state.counters.get(id) ?? 0;\n\tstate.counters.set(id, n + 1);\n\treturn `${id}:${n}`;\n}\n","import type AsyncOptions from \"../types/AsyncOptions\";\nimport { currentServerReadSite } from \"./$serverWatch\";\nimport type ServerAwaitState from \"./serverAwaitState\";\nimport {\n\tcurrentServerAwait,\n\tServerAwaitMisaligned,\n\ttype ServerPromiseEntry,\n} from \"./serverAwaitState\";\n\n/**\n * Default number of milliseconds a `source: \"server\"` read may take before\n * its boundary degrades to the `with` branch and the client fetches instead\n * (ASYNC.md → \"Server rendering\").\n */\nexport const SERVER_ASYNC_TIMEOUT = 5000;\n\n/**\n * Server counterpart of the client-side `$async` getter primitive.\n *\n * Without options (the default), this is a no-op stub: server renders are\n * synchronous, an async value never resolves during SSR, and `@await`\n * boundaries render their `with` branch and never read the getter. The stub\n * exists so server builds importing `$async` don't emit a dangling import.\n * A read inside a boundary's render pass is still recorded, so the boundary\n * degrades to the `with` branch + client fetch instead of shipping content\n * that would suspend on the client.\n *\n * With `{ source: \"server\" }` the getter participates in the server's\n * collect/render pass (ASYNC.md → \"Server rendering\"):\n *\n * - **Collect pass** — calls the thunk (starting the fetch) and records the\n * promise on the enclosing boundary, so sibling reads start in one wave.\n * The read is keyed by getter identity (watched object + property key), so\n * reading the same getter again reuses the recorded fetch. Returns\n * `undefined`; the speculative pass's output is discarded.\n * - **Render pass** — returns the settled value for the same getter identity,\n * without calling the thunk again. The pass may read a getter any number of\n * times, so markup may branch on the resolved value. A rejection is\n * re-thrown here so `@try`/`@error` handles it like any other render error.\n * Reading a getter the collect pass never touched throws a sentinel that\n * degrades the boundary (its value can't be resolved without fetching, and\n * the shipped HTML can't be trusted).\n *\n * Outside any `@await` boundary (including in a `with` branch) a\n * `source: \"server\"` read returns `undefined` without fetching — the same\n * undefined-then-recover contract the client has for un-boundaried reads.\n */\nexport default function $serverAsync<T>(\n\tfn: (serverValue?: T) => Promise<T>,\n\toptions?: AsyncOptions,\n): T {\n\tconst state = currentServerAwait();\n\n\tif (state === null || state.isRoot || options?.source !== \"server\") {\n\t\tif (state !== null && !state.isRoot && state.phase === \"render\") {\n\t\t\t// A client-fetch read during a boundary's render pass: the client\n\t\t\t// will suspend on it, so the boundary can't ship resolved content\n\t\t\tstate.clientReads++;\n\t\t}\n\t\treturn undefined as T;\n\t}\n\n\t// Identity captured before the thunk runs: reads inside the thunk (e.g.\n\t// `$state.id`) must not be mistaken for the getter being read here\n\tconst site = currentServerReadSite();\n\tconst owner = site?.owner ?? null;\n\tconst key = site?.key ?? fn.toString();\n\n\tif (state.phase === \"collect\") {\n\t\t// A repeated read of the same getter shares the first fetch\n\t\tconst existing = findEntry(state, owner, key);\n\t\tif (existing === undefined) {\n\t\t\tconst entry: ServerPromiseEntry = {\n\t\t\t\towner,\n\t\t\t\tkey,\n\t\t\t\tpromise: fn(),\n\t\t\t\ttimeout: options.timeout ?? SERVER_ASYNC_TIMEOUT,\n\t\t\t};\n\t\t\t// Record the outcome as soon as it settles — this both captures the\n\t\t\t// value/error for the render pass and consumes the rejection, so a\n\t\t\t// boundary that degrades (timeout) or a superseded fetch can never\n\t\t\t// surface as an unhandled rejection\n\t\t\tentry.promise.then(\n\t\t\t\t(value) => {\n\t\t\t\t\tentry.result = { ok: true, value };\n\t\t\t\t},\n\t\t\t\t(error) => {\n\t\t\t\t\tentry.result = { ok: false, error };\n\t\t\t\t},\n\t\t\t);\n\t\t\tstate.promises.push(entry);\n\t\t}\n\t\treturn undefined as T;\n\t}\n\n\t// Render pass: look the recorded read up by getter identity\n\tconst entry = findEntry(state, owner, key);\n\tif (entry === undefined) {\n\t\tthrow new ServerAwaitMisaligned();\n\t}\n\tif (!state.renderSeen.has(entry)) {\n\t\tstate.renderSeen.add(entry);\n\t\tstate.renderEntries.push(entry);\n\t}\n\tconst result = entry.result;\n\tif (result === undefined) {\n\t\t// Not settled — only possible when the boundary already blew its\n\t\t// timeout, which degrades before rendering; treat as misaligned\n\t\tthrow new ServerAwaitMisaligned();\n\t}\n\tif (result.ok) {\n\t\treturn result.value as T;\n\t}\n\tthrow result.error;\n}\n\nfunction findEntry(\n\tstate: ServerAwaitState,\n\towner: object | null,\n\tkey: PropertyKey | string,\n): ServerPromiseEntry | undefined {\n\tfor (const entry of state.promises) {\n\t\tif (entry.owner === owner && entry.key === key) {\n\t\t\treturn entry;\n\t\t}\n\t}\n\treturn undefined;\n}\n","export default function $serverBatch<T>(fn: () => T): T {\n\treturn fn();\n}\n","/**\n * Server no-op for the client-side `$bind` two-way sync primitive. Two-way\n * binding is a client runtime feature — there are no reactive updates during\n * SSR, so there is nothing to sync. The stub exists so server builds\n * importing `$bind` don't emit a dangling import.\n */\nexport default function $serverBind(\n\t_state: Record<PropertyKey, any>,\n\t_props: Record<PropertyKey, any> | undefined,\n\t..._keys: (string | string[])[]\n): void {}\n","export default function $serverCache<T>(fn: () => T): T {\n\treturn fn();\n}\n","import type Cleanup from \"../types/Cleanup\";\n\nexport default function $serverOnmount(_fn: () => Cleanup | void): void {}\n","export default function $serverPeek<T>(fn: () => T): T {\n\treturn fn();\n}\n","/**\n * Server no-op for the client-side `$pending` query. Nothing is ever pending\n * during a synchronous SSR render, so the query is always `false`. The stub\n * exists so server builds importing `$pending` don't emit a dangling import.\n */\nexport default function $serverPending(_fn: () => any): boolean {\n\treturn false;\n}\n","/**\n * Server no-op for the client-side `$refresh` primitive. A refresh is an\n * imperative action that never runs during SSR. The stub exists so server\n * builds importing `$refresh` don't emit a dangling import.\n */\nexport default function $serverRefresh(_fn: () => any): void {}\n","import type Cleanup from \"../types/Cleanup\";\n\nexport default function $serverRun(_fn: () => Cleanup | void): void {}\n","import type StreamSource from \"../types/StreamSource\";\n\n/**\n * Server stub for `$stream` — external sources are never subscribed to\n * during a server render. The subscription starts when the component is\n * mounted on the client.\n */\nexport default function $serverStream<T>(\n\t_source: StreamSource<T>,\n\t_handler: (value: T) => void,\n\t_options?: { debounce?: number },\n): void {}\n","export default function $serverUnwrap<T extends Record<PropertyKey, any>>(object: T): T {\n\treturn object;\n}\n","import { newServerAwaitState, withServerAwait } from \"./serverAwaitState\";\nimport type ServerAwaitState from \"./serverAwaitState\";\n\n/** Comment prefix marking an unsubstituted boundary sentinel. */\nexport const SENTINEL_PREFIX = \"<!--t-aw:\";\n\n/** The body/head pair that server components and boundaries render into. */\nexport interface ServerHtml {\n\tbody: string;\n\thead: string;\n}\n\n/**\n * Renders a component's (or a degraded boundary's `with` branch's) markup\n * with a fresh flush root as the enclosing await state, then substitutes any\n * boundary sentinels with their final HTML.\n *\n * Boundaries created during the render stash their lifecycle promise under a\n * sentinel comment and return the sentinel immediately, so the render itself\n * never blocks on a fetch — every `source: \"server\"` read in the render\n * starts in the same wave. Substitution awaits the stashed promises at the\n * end, which is the only point an async component render actually waits.\n *\n * On the client this has no counterpart: `render` here is the compiled\n * component body closure that the generated component function returns.\n */\nexport async function serverFlush(render: () => Promise<ServerHtml>): Promise<ServerHtml> {\n\tconst state = newServerAwaitState();\n\tstate.isRoot = true;\n\tconst result = await withServerAwait(state, render);\n\treturn substituteSentinels(result, state);\n}\n\n/**\n * Renders a degraded boundary's `with` branch inside its own flush root, so\n * a `with` branch containing its own `@await` boundaries still resolves\n * them, then wraps it in the boundary's hydration markers. The `with` branch\n * must not start server fetches for its own reads — the flush root isn't a\n * recording context.\n */\nexport async function renderWithBranch(\n\trenderWith: (() => Promise<ServerHtml>) | null,\n): Promise<ServerHtml> {\n\tconst html = await serverFlush(async () => {\n\t\tif (renderWith === null) {\n\t\t\treturn { body: \"\", head: \"\" };\n\t\t}\n\t\treturn renderWith();\n\t});\n\treturn { body: `<![>${html.body}<!]><!>`, head: html.head };\n}\n\n/**\n * Replaces every sentinel the state stashed with its boundary's final HTML.\n * Boundary head tags are appended to the head (they hoist into the document\n * head regardless of where the boundary sits in the body). Any sentinel left\n * over means a boundary's state was lost — a bug, not a degradation path, so\n * it throws.\n */\nexport async function substituteSentinels(\n\tresult: ServerHtml,\n\tstate: ServerAwaitState,\n): Promise<ServerHtml> {\n\tlet { body, head } = result;\n\tfor (const [sentinel, promise] of state.sentinels) {\n\t\tconst html = await promise;\n\t\tbody = body.split(sentinel).join(html.body);\n\t\thead += html.head;\n\t}\n\tif (body.includes(SENTINEL_PREFIX) || head.includes(SENTINEL_PREFIX)) {\n\t\tthrow new Error(\"Unsubstituted async boundary sentinel — boundary state was lost\");\n\t}\n\treturn { body, head };\n}\n","import {\n\tchildKey,\n\tcurrentServerAwait,\n\tnewServerAwaitState,\n\tServerAwaitMisaligned,\n\twithServerAwait,\n} from \"./serverAwaitState\";\nimport type ServerAwaitState from \"./serverAwaitState\";\nimport { renderWithBranch } from \"./serverSentinels\";\n\nlet sentinelCount = 0;\n\nfunction nextSentinel(): string {\n\treturn `<!--t-aw:${sentinelCount++}-->`;\n}\n\n/**\n * Renders an `@await` boundary on the server (compiled as `t_await_server`).\n *\n * The generated code calls this for every `@await`, passing the boundary's\n * site id, a closure that renders the content branch, and one that renders\n * the `with` branch. It always returns a `{ body, head }` pair to append:\n *\n * - **Inside a boundary's render pass** — this boundary was already started\n * during the collect pass; its body/head is the finished HTML (awaited if\n * still in flight). A missing entry means the render pass doesn't match\n * the collect pass, which degrades the enclosing boundary.\n * - **Inside a collect pass or a component flush** — start the full\n * lifecycle (collect, settle, render) without blocking the enclosing\n * render, and return a sentinel comment as the body. Sibling reads and\n * nested boundaries keep rendering, so every fetch in the pass starts in\n * one wave. The sentinel is substituted later: by the enclosing boundary's\n * render pass (which re-invokes this helper and awaits the finished HTML),\n * or by the component flush (which replaces top-level sentinels directly).\n *\n * The lifecycle: render content once to start the `source: \"server\"` fetches\n * (discarding the output), wait for them with a per-getter timeout, then\n * render again with the settled values. Reads are matched by getter identity,\n * so the render pass may read a getter more than once (e.g. branch on it).\n * The second pass ships wrapped in hydration markers plus a\n * `<!--t-await:...-->` comment carrying the values for the client's `$async`\n * hydration path. Any instability — timeout, a render pass that reads a getter\n * the collect pass never touched, a client-fetch read — degrades to the `with`\n * branch + client fetch, exactly the pre-`source` behavior.\n *\n * @param id The boundary's site id (unique per `@await` in the component)\n * @param renderContent Renders the content branch (may read `$async` getters)\n * @param renderWith Renders the `with` branch, or null for empty\n */\nexport default function runServerAwait(\n\tid: string,\n\trenderContent: () => Promise<{ body: string; head: string }>,\n\trenderWith: (() => Promise<{ body: string; head: string }>) | null,\n): { body: string; head: string } | Promise<{ body: string; head: string }> {\n\tconst parent = currentServerAwait();\n\n\tif (parent !== null && parent.phase === \"render\") {\n\t\t// The enclosing boundary is rendering its resolved pass: this nested\n\t\t// boundary was started during the collect pass, so reuse its result\n\t\tconst cached = parent.children.get(childKey(parent, id));\n\t\tif (cached === undefined) {\n\t\t\tthrow new ServerAwaitMisaligned();\n\t\t}\n\t\treturn cached;\n\t}\n\n\tconst state = newServerAwaitState();\n\tconst final = renderBoundary(state, renderContent, renderWith);\n\n\tconst sentinel = nextSentinel();\n\tif (parent !== null) {\n\t\tif (parent.isRoot) {\n\t\t\t// Top-level boundary: the component flush substitutes the sentinel\n\t\t\tparent.sentinels.set(sentinel, final);\n\t\t} else {\n\t\t\t// Nested boundary: the enclosing boundary's render pass looks this\n\t\t\t// up by occurrence key\n\t\t\tparent.children.set(childKey(parent, id), final);\n\t\t}\n\t}\n\t// The sentinel body is replaced by the finished content; the head tags a\n\t// resolved boundary renders are hoisted when it finishes\n\treturn { body: sentinel, head: \"\" };\n}\n\n/**\n * The full lifecycle for one boundary: speculative collect pass, settle, and\n * resolved render pass. Runs concurrently with the enclosing render; the\n * returned promise resolves to the boundary's final HTML.\n */\nasync function renderBoundary(\n\tstate: ServerAwaitState,\n\trenderContent: () => Promise<{ body: string; head: string }>,\n\trenderWith: (() => Promise<{ body: string; head: string }>) | null,\n): Promise<{ body: string; head: string }> {\n\t// Collect pass: render content speculatively to invoke the getters. Each\n\t// `source: \"server\"` read starts its fetch and is recorded; sibling reads\n\t// in this pass therefore start together. The output is discarded — reads\n\t// return undefined, so user markup that dereferences them may throw, and\n\t// a throw here costs nothing.\n\tawait withServerAwait(state, renderContent).catch(() => {\n\t\t// Expected when unresolved values are dereferenced; fetches already\n\t\t// started. Any other error resurfaces in the render pass below.\n\t});\n\n\tif (state.promises.length === 0) {\n\t\t// No server-source reads: nothing was (or can be) resolved here, so\n\t\t// ship the `with` branch and let the client fetch — the default SSR\n\t\t// behavior for client-fetch getters\n\t\treturn renderWithBranch(renderWith);\n\t}\n\n\t// Settle the recorded fetches. Each getter carries its own timeout; the\n\t// boundary waits for the longest, and a miss degrades the whole boundary\n\t// (content ships only when every read resolved)\n\tconst timeout = Math.max(...state.promises.map((entry) => entry.timeout));\n\tconst settled = await Promise.race([\n\t\tPromise.all(\n\t\t\tstate.promises.map((entry) =>\n\t\t\t\tentry.promise.then(\n\t\t\t\t\t() => true,\n\t\t\t\t\t() => true,\n\t\t\t\t),\n\t\t\t),\n\t\t).then(\n\t\t\t() => true,\n\t\t\t() => true,\n\t\t),\n\t\tnew Promise<false>((resolve) => setTimeout(resolve, timeout, false)),\n\t]);\n\n\t// Render pass: same reads, now looking settled values up by getter\n\t// identity. The pass may read a getter more than once (markup can branch\n\t// on its value), but every read must have been recorded by the collect\n\t// pass. A read the collect pass never touched, a client-fetch read, or a\n\t// render error means the content can't be trusted, and the boundary\n\t// degrades.\n\t//\n\t// A rejection (or any render error) also degrades: the boundary's\n\t// lifecycle runs detached from the enclosing render (which has already\n\t// moved on after the sentinel), so the error can't propagate to the\n\t// emitted `@try` positionally. Instead the with branch ships and the\n\t// client re-runs the getter, rejects there, and its `@try` renders the\n\t// catch branch — the same path a client-fetch error takes.\n\tlet degraded = settled === false;\n\tlet content: { body: string; head: string } | undefined;\n\tif (!degraded) {\n\t\tstate.phase = \"render\";\n\t\tstate.renderEntries.length = 0;\n\t\tstate.renderSeen.clear();\n\t\tstate.clientReads = 0;\n\t\tstate.counters.clear();\n\t\ttry {\n\t\t\tcontent = await withServerAwait(state, renderContent);\n\t\t\tif (state.clientReads > 0) {\n\t\t\t\tdegraded = true;\n\t\t\t}\n\t\t} catch {\n\t\t\tdegraded = true;\n\t\t}\n\t}\n\n\tif (degraded || content === undefined) {\n\t\tstate.degraded = true;\n\t\ttry {\n\t\t\treturn await renderWithBranch(renderWith);\n\t\t} catch {\n\t\t\t// A with-branch render error can't be positioned either; ship an\n\t\t\t// empty boundary rather than failing the whole response\n\t\t\treturn { body: \"<![><!]><!>\", head: \"\" };\n\t\t}\n\t}\n\n\t// Ship the resolved content with the embedded values for hydration.\n\t// Rejections never reach here — the render pass consumes them and\n\t// degrades — but guard anyway so a bad entry can't ship as `undefined`\n\tconst values: any[] = [];\n\tfor (const entry of state.renderEntries) {\n\t\tconst result = entry.result;\n\t\tif (result === undefined) {\n\t\t\tdegraded = true;\n\t\t\tbreak;\n\t\t}\n\t\tvalues.push(result.ok ? result.value : undefined);\n\t}\n\tif (degraded) {\n\t\tstate.degraded = true;\n\t\treturn renderWithBranch(renderWith);\n\t}\n\treturn {\n\t\tbody: `${\"<![>\"}${content.body}${\"<!]><!>\"}${payloadComment(values)}`,\n\t\thead: content.head,\n\t};\n}\n\n/**\n * The `<!--t-await:...-->` comment carrying the boundary's resolved values,\n * in the order the render pass first read them, for the client's `$async`\n * hydration path. `-->` inside the JSON is escaped so the comment can't\n * terminate early.\n */\nfunction payloadComment(values: any[]): string {\n\tconst json = JSON.stringify(values).replaceAll(\"-->\", \"--\\\\u003E\");\n\treturn `<!--t-await:${json}-->`;\n}\n","/**\n * Server stubs for the client-only runtime, so that modules compiled for the\n * client -- or shared helpers that import them from the main `@torpor/view`\n * entry -- still resolve when they end up in a server bundle (the SSR\n * environment resolves `@torpor/view` to this module; see @torpor/build's\n * ssr-view plugin).\n *\n * They throw when called: mounting, hydrating and DOM rendering must not run\n * during SSR. Importing them is fine, which keeps a stray client-only import\n * from failing the server build.\n */\ntype Unavailable = (...args: unknown[]) => never;\n\nfunction unavailable(name: string): Unavailable {\n\treturn (..._args: unknown[]): never => {\n\t\tthrow new Error(`${name} is not available during server rendering`);\n\t};\n}\n\nexport const mount: Unavailable = unavailable(\"mount\");\nexport const hydrate: Unavailable = unavailable(\"hydrate\");\nexport const unmount: Unavailable = unavailable(\"unmount\");\nexport const fillLayoutSlot: Unavailable = unavailable(\"fillLayoutSlot\");\nexport const clearLayoutSlot: Unavailable = unavailable(\"clearLayoutSlot\");\n\nexport const t_add_element: Unavailable = unavailable(\"t_add_element\");\nexport const t_add_fragment: Unavailable = unavailable(\"t_add_fragment\");\nexport const t_anchor: Unavailable = unavailable(\"t_anchor\");\nexport const t_animate: Unavailable = unavailable(\"t_animate\");\nexport const t_apply_props: Unavailable = unavailable(\"t_apply_props\");\nexport const t_attribute: Unavailable = unavailable(\"t_attribute\");\nexport const t_child: Unavailable = unavailable(\"t_child\");\nexport const t_dynamic: Unavailable = unavailable(\"t_dynamic\");\nexport const t_event: Unavailable = unavailable(\"t_event\");\nexport const t_first_inside: Unavailable = unavailable(\"t_first_inside\");\nexport const t_fragment: Unavailable = unavailable(\"t_fragment\");\nexport const t_fragment_el: Unavailable = unavailable(\"t_fragment_el\");\nexport const t_head_element: Unavailable = unavailable(\"t_head_element\");\nexport const t_list_item: Unavailable = unavailable(\"t_list_item\");\nexport const t_next: Unavailable = unavailable(\"t_next\");\nexport const t_pop_region: Unavailable = unavailable(\"t_pop_region\");\nexport const t_push_region: Unavailable = unavailable(\"t_push_region\");\nexport const t_region: Unavailable = unavailable(\"t_region\");\nexport const t_rerun_region_effects: Unavailable = unavailable(\"t_rerun_region_effects\");\nexport const t_restore_hydration: Unavailable = unavailable(\"t_restore_hydration\");\nexport const t_root: Unavailable = unavailable(\"t_root\");\nexport const t_root_el: Unavailable = unavailable(\"t_root_el\");\nexport const t_run_await: Unavailable = unavailable(\"t_run_await\");\nexport const t_run_branch: Unavailable = unavailable(\"t_run_branch\");\nexport const t_run_control: Unavailable = unavailable(\"t_run_control\");\nexport const t_run_list: Unavailable = unavailable(\"t_run_list\");\nexport const t_run_try: Unavailable = unavailable(\"t_run_try\");\nexport const t_save_hydration: Unavailable = unavailable(\"t_save_hydration\");\nexport const t_skip: Unavailable = unavailable(\"t_skip\");\n"],"mappings":";;;AAAA,SAAwB,oBAAoB,OAAoB;CAC/D,QAAQ,SAAS,GAAA,CAAI,SAAS,CAAC,CAAC,WAAW,MAAK,QAAQ;AACzD;;;ACAA,MAAM,YAAoC;CACzC,KAAK;CACL,KAAK;CACL,KAAK;AACN;;;;;;;;AASA,SAAwB,iBAAiB,OAAoB;CAC5D,OAAO,WAAW,KAAK,CAAC,CAAC,QAAQ,WAAW,MAAM,UAAU,EAAE;AAC/D;;;;;;;;;;ACPA,SAAwB,mBAAmB,OAAmB,WAA4B;CACzF,MAAM,UAAU,aAAa,OAAO,SAAS;CAC7C,OAAO,YAAY,KAAK,KAAK,UAAU,QAAQ;AAChD;;;;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@torpor/view",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Torpor's view library, for writing and mounting components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -27,10 +27,13 @@
|
|
|
27
27
|
"types": "./dist/dev.d.mts",
|
|
28
28
|
"import": "./dist/dev.mjs",
|
|
29
29
|
"require": "./dist/dev.cjs"
|
|
30
|
-
}
|
|
30
|
+
},
|
|
31
|
+
"./runtime": "./dist/runtime.iife.js",
|
|
32
|
+
"./package.json": "./package.json"
|
|
31
33
|
},
|
|
32
34
|
"files": [
|
|
33
|
-
"dist"
|
|
35
|
+
"dist",
|
|
36
|
+
"package.json"
|
|
34
37
|
],
|
|
35
38
|
"publishConfig": {
|
|
36
39
|
"access": "public"
|
|
@@ -55,8 +58,8 @@
|
|
|
55
58
|
"vite-plus": "1.2.0"
|
|
56
59
|
},
|
|
57
60
|
"scripts": {
|
|
58
|
-
"check": "tsgo --noEmit && pnpm dlx oxlint --type-aware",
|
|
59
|
-
"build": "tsgo --noEmit && vp pack
|
|
61
|
+
"check": "tsgo --noEmit && pnpm dlx oxlint --type-aware && tsgo --noEmit -p tsconfig.goldens.json",
|
|
62
|
+
"build": "tsgo --noEmit && vp pack",
|
|
60
63
|
"build:watch": "vp pack --watch",
|
|
61
64
|
"test": "vp test",
|
|
62
65
|
"test:build": "tsx ./scripts/buildTestOutput.ts",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Effect-DazmAdyC.d.mts","names":[],"sources":["../src/types/constants.ts","../src/types/ProxySignal.ts","../src/types/Subscription.ts","../src/types/Computed.ts","../src/types/ErrorBoundary.ts","../src/types/Region.ts","../src/types/Effect.ts"],"mappings":";;;;;cAGa;;;;cAKA;;;;cAKA;;;;;;;UCNY;;;;EAIxB,aAAa;;;;EAKb,aAAa;;;;EAKb,oBAAoB;;;;EAKpB;;;;;;;;UClBwB;;;;EAIxB,QAAQ,cAAc;;;;EAKtB,QAAQ,WAAW;;;;;EAMnB,YAAY;;;;;EAMZ,YAAY;;;;;;;EAQZ,gBAAgB;;;;;;EAOhB;;;;;EAMA;;;;EAKA;;;;;;;;;UC/CwB,SAAS;;;;EAIjC,aAAa;;;;;;;;EASb;;;;EAKA,OAAO;;;;EAKP,WAAW;;;;EAKX,aAAa;;;;EAKb,aAAa;;;;;;;EAQb;;;;EAKA;;;;EAKA;;;;;;;EAQA;;;;;;;EAQA;;;;;;;EAQA;;;;;;;;;EAUA;;;;;;;;;;;;;;;EAgBA;;;;;;;;;;;;;EAcA;;;;EAKA,UAAU;;;;EAKV;;;;;;;;;;UC3HwB;;;;;;EAMxB;;;;;EAMA;;;;;EAMA,QAAQ;;;;;;;;;EAUR,cAAc,cAAc;;;;UCnCJ;EACxB,WAAW;EACX,SAAS;EAET,gBAAgB;EAChB,YAAY;EACZ;;;;;EAMA,YAAY,IAAI;;;;EAKhB;;;;EAKA,SAAS;;;;;;;EAQT,gBAAgB;;;;;;;EAQhB;;;;;;EAOA;;;;;;;UCtCwB;;;;EAIxB,aAAa;;;;;EAMb,WAAW;;;;EAKX,SAAS;;;;EAKT,aAAa;EAKb,YAAY;;;;EAKZ;;;;;;EAOA;;;;EAKA;;;;;;;EAQA;;;;;;;;;;EAWA,iBAAiB,IAAI;;;;EAKrB;;;;;;EAOA,SAAS;;;;;;EAOT,gBAAgB,cAAc;;;;;;;;;EAU9B;;;;;;;;;;;;;;;;EAiBA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Effect-Dewn7MLc.d.cts","names":[],"sources":["../src/types/constants.ts","../src/types/ProxySignal.ts","../src/types/Subscription.ts","../src/types/Computed.ts","../src/types/ErrorBoundary.ts","../src/types/Region.ts","../src/types/Effect.ts"],"mappings":";;;;;cAGa;;;;cAKA;;;;cAKA;;;;;;;UCNY;;;;EAIxB,aAAa;;;;EAKb,aAAa;;;;EAKb,oBAAoB;;;;EAKpB;;;;;;;;UClBwB;;;;EAIxB,QAAQ,cAAc;;;;EAKtB,QAAQ,WAAW;;;;;EAMnB,YAAY;;;;;EAMZ,YAAY;;;;;;;EAQZ,gBAAgB;;;;;;EAOhB;;;;;EAMA;;;;EAKA;;;;;;;;;UC/CwB,SAAS;;;;EAIjC,aAAa;;;;;;;;EASb;;;;EAKA,OAAO;;;;EAKP,WAAW;;;;EAKX,aAAa;;;;EAKb,aAAa;;;;;;;EAQb;;;;EAKA;;;;EAKA;;;;;;;EAQA;;;;;;;EAQA;;;;;;;EAQA;;;;;;;;;EAUA;;;;;;;;;;;;;;;EAgBA;;;;;;;;;;;;;EAcA;;;;EAKA,UAAU;;;;EAKV;;;;;;;;;;UC3HwB;;;;;;EAMxB;;;;;EAMA;;;;;EAMA,QAAQ;;;;;;;;;EAUR,cAAc,cAAc;;;;UCnCJ;EACxB,WAAW;EACX,SAAS;EAET,gBAAgB;EAChB,YAAY;EACZ;;;;;EAMA,YAAY,IAAI;;;;EAKhB;;;;EAKA,SAAS;;;;;;;EAQT,gBAAgB;;;;;;;EAQhB;;;;;;EAOA;;;;;;;UCtCwB;;;;EAIxB,aAAa;;;;;EAMb,WAAW;;;;EAKX,SAAS;;;;EAKT,aAAa;EAKb,YAAY;;;;EAKZ;;;;;;EAOA;;;;EAKA;;;;;;;EAQA;;;;;;;;;;EAWA,iBAAiB,IAAI;;;;EAKrB;;;;;;EAOA,SAAS;;;;;;EAOT,gBAAgB,cAAc;;;;;;;;;EAU9B;;;;;;;;;;;;;;;;EAiBA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fromWebSocket-CFGoMkV2.mjs","names":[],"sources":["../src/watch/symbols.ts","../src/watch/$unwrap.ts","../src/render/buildClasses.ts","../src/render/buildStyles.ts","../src/render/formatText.ts","../src/stream/fromElement.ts","../src/stream/fromServer.ts","../src/stream/fromWebSocket.ts"],"sourcesContent":["const proxyDataSymbol: unique symbol = Symbol.for(\"torp.ProxyData\");\n\nexport { proxyDataSymbol };\n","import { proxyDataSymbol } from \"./symbols\";\n\n/**\n * Returns the target object of a proxy\n *\n * @param object The proxy object\n */\nexport default function $unwrap<T extends Record<PropertyKey, any>>(object: T): T {\n\treturn object !== undefined && object !== null && object[proxyDataSymbol] !== undefined\n\t\t? (object[proxyDataSymbol].target ?? object)\n\t\t: object;\n}\n","import ClassValue from \"../types/ClassValue\";\nimport $unwrap from \"../watch/$unwrap\";\n\nexport default function buildClasses(value: ClassValue, styleHash?: string): string {\n\tif (typeof value === \"string\") {\n\t\tif (styleHash !== undefined) {\n\t\t\tvalue += \" \" + styleHash;\n\t\t}\n\t\treturn value;\n\t} else {\n\t\tlet classes: string[] = [];\n\t\tgatherClasses(\"\", value, classes);\n\t\tif (styleHash !== undefined) {\n\t\t\tclasses.push(styleHash);\n\t\t}\n\t\treturn classes.join(\" \");\n\t}\n}\n\nfunction gatherClasses(name: string, value: unknown, classes: string[]) {\n\tif (value) {\n\t\t// Unwrap watched values before iterating: component props are\n\t\t// deep-wrapped, and iterating a watched array disables the active\n\t\t// effect (see the array iterator in proxyGet), which would break\n\t\t// tracking of reads later in the same effect. Per-element tracking is\n\t\t// unnecessary here anyway -- the caller has already subscribed to the\n\t\t// property read that produced the value\n\t\tvalue = $unwrap(value as Record<PropertyKey, any>);\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (let v of value) {\n\t\t\t\tgatherClasses(v as string, v, classes);\n\t\t\t}\n\t\t} else if (typeof value === \"object\") {\n\t\t\t// Use `for-in` instead of `Object.entries(value)`. The entries\n\t\t\t// call allocates a new array (plus a [k, v] pair per entry) on\n\t\t\t// every invocation; `for-in` allocates nothing. Object literals\n\t\t\t// (the dominant case — e.g. `{ danger: bool }` in the row\n\t\t\t// template) have no inherited enumerable properties, so the two\n\t\t\t// are equivalent for our usage. This is on the per-effect re-run\n\t\t\t// hot path: a `select` op re-runs every row effect, each calling\n\t\t\t// `buildClasses({ danger: ... })`.\n\t\t\tfor (const n in value) {\n\t\t\t\tgatherClasses(n, (value as Record<string, unknown>)[n], classes);\n\t\t\t}\n\t\t} else {\n\t\t\tclasses.push(name);\n\t\t}\n\t}\n}\n","import type StyleValue from \"../types/StyleValue\";\n\nconst CAMEL_TO_DASH = /[A-Z]+(?![a-z])|[A-Z]/g;\n\nexport default function buildStyles(value: StyleValue): string {\n\tif (typeof value === \"string\") {\n\t\treturn value;\n\t} else {\n\t\tlet styles: string[] = [];\n\t\tgatherStyles(value, styles);\n\t\treturn styles.join(\"; \");\n\t}\n}\n\nfunction gatherStyles(value: unknown, styles: string[]) {\n\tif (value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (let v of value) {\n\t\t\t\tgatherStyles(v, styles);\n\t\t\t}\n\t\t} else if (typeof value === \"object\") {\n\t\t\tfor (let [n, v] of Object.entries(value)) {\n\t\t\t\tif (v === null || v === undefined) continue;\n\t\t\t\tconst key = n.replace(CAMEL_TO_DASH, (char, i) => (i > 0 ? \"-\" : \"\") + char.toLowerCase());\n\t\t\t\tstyles.push(`${key}: ${v}`);\n\t\t\t}\n\t\t} else {\n\t\t\t// oxlint-disable-next-line typescript/no-base-to-string\n\t\t\tstyles.push(String(value));\n\t\t}\n\t}\n}\n","import $unwrap from \"../watch/$unwrap\";\n\nexport default function formatText(value: any): string {\n\t// We could have anything in value, so we need to\n\t// - use String(...) because Symbols can't be implicitly converted\n\t// - use $unwrap because Proxies can't be converted to a string\n\tif (value === undefined || value === null) {\n\t\treturn \"\";\n\t}\n\t// Fast path: strings already satisfy both concerns above. Skipping the\n\t// `String($unwrap(value))` pair saves two function calls per text\n\t// interpolation on the dominant `typeof value === \"string\"` branch —\n\t// e.g. row labels in js-framework-bench hit this on every effect run.\n\tif (typeof value === \"string\") {\n\t\treturn value;\n\t}\n\treturn String($unwrap(value));\n}\n","import type StreamSource from \"../types/StreamSource\";\n\n/**\n * The element to listen on, or a getter returning it. Use a getter for\n * `&ref`-bound variables — they are only assigned once the element is\n * created, and subscriptions start at mount time:\n *\n * ```torp\n * let saveButton: HTMLButtonElement;\n *\n * $stream(fromElement(() => saveButton, \"click\"), () => save());\n * ```\n */\ntype EventTargetInput = HTMLElement | (() => HTMLElement | null | undefined);\n\n/**\n * Creates a StreamSource that pushes DOM events of the given type from an\n * element.\n *\n * ```torp\n * $stream(fromElement(() => saveButton, \"click\"), (e) => {\n * \t$state.clicks.push(e);\n * });\n * ```\n */\nexport default function fromElement<E extends Event = Event>(\n\ttarget: EventTargetInput,\n\ttype: string,\n): StreamSource<E> {\n\treturn (push) => {\n\t\tconst el = typeof target === \"function\" ? target() : target;\n\t\tif (!el) {\n\t\t\tthrow new Error(\n\t\t\t\t'fromElement: element not found. When passing a &ref variable, wrap it in a getter: fromElement(() => buttonEl, \"click\")',\n\t\t\t);\n\t\t}\n\t\tconst listener = push as EventListener;\n\t\tel.addEventListener(type, listener);\n\t\treturn () => {\n\t\t\tel.removeEventListener(type, listener);\n\t\t};\n\t};\n}\n","import type StreamSource from \"../types/StreamSource\";\n\n/**\n * Creates a StreamSource that receives `message` events from a server-sent\n * events endpoint. The URL may be a getter, so reactive state can be read\n * inside it — when it changes, the connection is closed and re-opened:\n *\n * ```torp\n * $stream(fromServer(`/sse/${$props.id}`), (e) => {\n * \t$state.messages.push(e.data);\n * });\n * ```\n *\n * Reconnection is handled by `EventSource` itself; errors are not pushed —\n * a source that can fail should surface errors as values.\n */\nexport default function fromServer(url: string | (() => string)): StreamSource<MessageEvent> {\n\treturn (push) => {\n\t\tconst eventSource = new EventSource(typeof url === \"function\" ? url() : url);\n\t\teventSource.onmessage = push;\n\t\treturn () => {\n\t\t\teventSource.close();\n\t\t};\n\t};\n}\n","import type StreamSource from \"../types/StreamSource\";\n\n/**\n * Creates a StreamSource that receives `message` events from a WebSocket.\n * The URL may be a getter, so reactive state can be read inside it — when\n * it changes, the socket is closed and re-opened:\n *\n * ```torp\n * $stream(fromWebSocket(`/ws/${$props.id}`), (e) => {\n * \t$state.inbox.push(e.data);\n * });\n * ```\n *\n * Errors are not pushed — a source that can fail should surface errors as\n * values and own its own reconnection.\n */\nexport default function fromWebSocket(url: string | (() => string)): StreamSource<MessageEvent> {\n\treturn (push) => {\n\t\tconst socket = new WebSocket(typeof url === \"function\" ? url() : url);\n\t\tsocket.onmessage = push;\n\t\treturn () => {\n\t\t\tsocket.close();\n\t\t};\n\t};\n}\n"],"mappings":";AAAA,MAAM,kBAAiC,OAAO,IAAI,gBAAgB;;;;;;;;ACOlE,SAAwB,QAA4C,QAAc;CACjF,OAAO,WAAW,KAAA,KAAa,WAAW,QAAQ,OAAO,qBAAqB,KAAA,IAC1E,OAAO,gBAAgB,CAAC,UAAU,SACnC;AACJ;;;ACRA,SAAwB,aAAa,OAAmB,WAA4B;CACnF,IAAI,OAAO,UAAU,UAAU;EAC9B,IAAI,cAAc,KAAA,GACjB,SAAS,MAAM;EAEhB,OAAO;CACR,OAAO;EACN,IAAI,UAAoB,CAAC;EACzB,cAAc,IAAI,OAAO,OAAO;EAChC,IAAI,cAAc,KAAA,GACjB,QAAQ,KAAK,SAAS;EAEvB,OAAO,QAAQ,KAAK,GAAG;CACxB;AACD;AAEA,SAAS,cAAc,MAAc,OAAgB,SAAmB;CACvE,IAAI,OAAO;EAOV,QAAQ,QAAQ,KAAiC;EACjD,IAAI,MAAM,QAAQ,KAAK,GACtB,KAAK,IAAI,KAAK,OACb,cAAc,GAAa,GAAG,OAAO;OAEhC,IAAI,OAAO,UAAU,UAS3B,KAAK,MAAM,KAAK,OACf,cAAc,GAAI,MAAkC,IAAI,OAAO;OAGhE,QAAQ,KAAK,IAAI;CAEnB;AACD;;;AC9CA,MAAM,gBAAgB;AAEtB,SAAwB,YAAY,OAA2B;CAC9D,IAAI,OAAO,UAAU,UACpB,OAAO;MACD;EACN,IAAI,SAAmB,CAAC;EACxB,aAAa,OAAO,MAAM;EAC1B,OAAO,OAAO,KAAK,IAAI;CACxB;AACD;AAEA,SAAS,aAAa,OAAgB,QAAkB;CACvD,IAAI,OAAO;EACV,IAAI,MAAM,QAAQ,KAAK,GACtB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