@bquery/bquery 1.10.0 → 1.11.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.
Files changed (155) hide show
  1. package/README.md +44 -19
  2. package/dist/{a11y-DG2i4iZN.js → a11y-DgUQ8-fI.js} +1 -1
  3. package/dist/{a11y-DG2i4iZN.js.map → a11y-DgUQ8-fI.js.map} +1 -1
  4. package/dist/a11y.es.mjs +1 -1
  5. package/dist/{component-DRotf1hl.js → component-D8ydhe58.js} +2 -2
  6. package/dist/{component-DRotf1hl.js.map → component-D8ydhe58.js.map} +1 -1
  7. package/dist/component.es.mjs +1 -1
  8. package/dist/concurrency-BU1wPEsZ.js.map +1 -1
  9. package/dist/{constraints-CqjhmpZC.js → constraints-Dlbx_m1b.js} +1 -1
  10. package/dist/{constraints-CqjhmpZC.js.map → constraints-Dlbx_m1b.js.map} +1 -1
  11. package/dist/{core-EMYSLzaT.js → core-tOP6QOrY.js} +2 -2
  12. package/dist/{core-EMYSLzaT.js.map → core-tOP6QOrY.js.map} +1 -1
  13. package/dist/core.es.mjs +1 -1
  14. package/dist/{custom-directives-BjFzFhuf.js → custom-directives-5DlKqvd2.js} +1 -1
  15. package/dist/{custom-directives-BjFzFhuf.js.map → custom-directives-5DlKqvd2.js.map} +1 -1
  16. package/dist/{devtools-C5FExMwv.js → devtools-QosAqo0T.js} +2 -2
  17. package/dist/{devtools-C5FExMwv.js.map → devtools-QosAqo0T.js.map} +1 -1
  18. package/dist/devtools.es.mjs +1 -1
  19. package/dist/{dnd-BAqzPlSo.js → dnd-d2OU4len.js} +1 -1
  20. package/dist/{dnd-BAqzPlSo.js.map → dnd-d2OU4len.js.map} +1 -1
  21. package/dist/dnd.es.mjs +1 -1
  22. package/dist/{forms-Dx1Scvh0.js → forms-BLx4ZzT7.js} +1 -1
  23. package/dist/{forms-Dx1Scvh0.js.map → forms-BLx4ZzT7.js.map} +1 -1
  24. package/dist/forms.es.mjs +1 -1
  25. package/dist/full.d.ts +4 -2
  26. package/dist/full.d.ts.map +1 -1
  27. package/dist/full.es.mjs +258 -219
  28. package/dist/full.iife.js +41 -37
  29. package/dist/full.iife.js.map +1 -1
  30. package/dist/full.umd.js +41 -37
  31. package/dist/full.umd.js.map +1 -1
  32. package/dist/{i18n-Cazyk9RD.js → i18n--p7PM-9r.js} +1 -1
  33. package/dist/{i18n-Cazyk9RD.js.map → i18n--p7PM-9r.js.map} +1 -1
  34. package/dist/i18n.es.mjs +1 -1
  35. package/dist/index.d.ts +1 -0
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.es.mjs +291 -252
  38. package/dist/match-CrZRVC4z.js +174 -0
  39. package/dist/match-CrZRVC4z.js.map +1 -0
  40. package/dist/{media-dAKIGPk3.js → media-gjbWNq50.js} +1 -1
  41. package/dist/{media-dAKIGPk3.js.map → media-gjbWNq50.js.map} +1 -1
  42. package/dist/media.es.mjs +1 -1
  43. package/dist/motion-BBMso9Ir.js.map +1 -1
  44. package/dist/{mount-C8O2vXkQ.js → mount-0A9qtcRJ.js} +3 -3
  45. package/dist/{mount-C8O2vXkQ.js.map → mount-0A9qtcRJ.js.map} +1 -1
  46. package/dist/platform-BPHIXbw8.js.map +1 -1
  47. package/dist/{plugin-DjTqWg-P.js → plugin-SZEirbwq.js} +2 -2
  48. package/dist/{plugin-DjTqWg-P.js.map → plugin-SZEirbwq.js.map} +1 -1
  49. package/dist/plugin.es.mjs +1 -1
  50. package/dist/reactive-BAd2hfl8.js.map +1 -1
  51. package/dist/{registry-Cr6VH8CR.js → registry-jpUQHf4E.js} +1 -1
  52. package/dist/{registry-Cr6VH8CR.js.map → registry-jpUQHf4E.js.map} +1 -1
  53. package/dist/router-C4weu0QL.js +333 -0
  54. package/dist/router-C4weu0QL.js.map +1 -0
  55. package/dist/router.es.mjs +1 -1
  56. package/dist/{sanitize-B1V4JswB.js → sanitize-DOMkRO9G.js} +12 -7
  57. package/dist/{sanitize-B1V4JswB.js.map → sanitize-DOMkRO9G.js.map} +1 -1
  58. package/dist/security.es.mjs +1 -1
  59. package/dist/server/create-server.d.ts +25 -0
  60. package/dist/server/create-server.d.ts.map +1 -0
  61. package/dist/server/index.d.ts +11 -0
  62. package/dist/server/index.d.ts.map +1 -0
  63. package/dist/server/types.d.ts +396 -0
  64. package/dist/server/types.d.ts.map +1 -0
  65. package/dist/server-QdyKtCS1.js +349 -0
  66. package/dist/server-QdyKtCS1.js.map +1 -0
  67. package/dist/server.es.mjs +6 -0
  68. package/dist/ssr/adapters.d.ts +74 -0
  69. package/dist/ssr/adapters.d.ts.map +1 -0
  70. package/dist/ssr/async.d.ts +40 -0
  71. package/dist/ssr/async.d.ts.map +1 -0
  72. package/dist/ssr/config.d.ts +60 -0
  73. package/dist/ssr/config.d.ts.map +1 -0
  74. package/dist/ssr/context.d.ts +73 -0
  75. package/dist/ssr/context.d.ts.map +1 -0
  76. package/dist/ssr/defer-brand.d.ts +5 -0
  77. package/dist/ssr/defer-brand.d.ts.map +1 -0
  78. package/dist/ssr/escape.d.ts +17 -0
  79. package/dist/ssr/escape.d.ts.map +1 -0
  80. package/dist/ssr/expression.d.ts +44 -0
  81. package/dist/ssr/expression.d.ts.map +1 -0
  82. package/dist/ssr/hash.d.ts +39 -0
  83. package/dist/ssr/hash.d.ts.map +1 -0
  84. package/dist/ssr/head.d.ts +102 -0
  85. package/dist/ssr/head.d.ts.map +1 -0
  86. package/dist/ssr/html-parser.d.ts +58 -0
  87. package/dist/ssr/html-parser.d.ts.map +1 -0
  88. package/dist/ssr/index.d.ts +49 -43
  89. package/dist/ssr/index.d.ts.map +1 -1
  90. package/dist/ssr/mismatch.d.ts +60 -0
  91. package/dist/ssr/mismatch.d.ts.map +1 -0
  92. package/dist/ssr/render-async.d.ts +84 -0
  93. package/dist/ssr/render-async.d.ts.map +1 -0
  94. package/dist/ssr/render.d.ts.map +1 -1
  95. package/dist/ssr/renderer.d.ts +25 -0
  96. package/dist/ssr/renderer.d.ts.map +1 -0
  97. package/dist/ssr/resumability.d.ts +65 -0
  98. package/dist/ssr/resumability.d.ts.map +1 -0
  99. package/dist/ssr/router-bridge.d.ts +101 -0
  100. package/dist/ssr/router-bridge.d.ts.map +1 -0
  101. package/dist/ssr/runtime.d.ts +63 -0
  102. package/dist/ssr/runtime.d.ts.map +1 -0
  103. package/dist/ssr/serialize.d.ts.map +1 -1
  104. package/dist/ssr/store-snapshot.d.ts +87 -0
  105. package/dist/ssr/store-snapshot.d.ts.map +1 -0
  106. package/dist/ssr/strategies.d.ts +43 -0
  107. package/dist/ssr/strategies.d.ts.map +1 -0
  108. package/dist/ssr/suspense.d.ts +47 -0
  109. package/dist/ssr/suspense.d.ts.map +1 -0
  110. package/dist/ssr/types.d.ts +17 -0
  111. package/dist/ssr/types.d.ts.map +1 -1
  112. package/dist/ssr-Bt6BQA3J.js +2127 -0
  113. package/dist/ssr-Bt6BQA3J.js.map +1 -0
  114. package/dist/ssr.es.mjs +42 -7
  115. package/dist/{store-CjmEeX9-.js → store-DnXuu6Li.js} +2 -2
  116. package/dist/{store-CjmEeX9-.js.map → store-DnXuu6Li.js.map} +1 -1
  117. package/dist/store.es.mjs +2 -2
  118. package/dist/storybook.es.mjs +1 -1
  119. package/dist/{testing-TdfaL7VE.js → testing-CeMUwrRD.js} +2 -2
  120. package/dist/{testing-TdfaL7VE.js.map → testing-CeMUwrRD.js.map} +1 -1
  121. package/dist/testing.es.mjs +1 -1
  122. package/dist/view.es.mjs +1 -1
  123. package/package.json +17 -12
  124. package/src/full.ts +99 -0
  125. package/src/index.ts +3 -0
  126. package/src/server/create-server.ts +754 -0
  127. package/src/server/index.ts +33 -0
  128. package/src/server/types.ts +490 -0
  129. package/src/ssr/adapters.ts +330 -0
  130. package/src/ssr/async.ts +125 -0
  131. package/src/ssr/config.ts +86 -0
  132. package/src/ssr/context.ts +245 -0
  133. package/src/ssr/defer-brand.ts +3 -0
  134. package/src/ssr/escape.ts +25 -0
  135. package/src/ssr/expression.ts +669 -0
  136. package/src/ssr/hash.ts +71 -0
  137. package/src/ssr/head.ts +240 -0
  138. package/src/ssr/html-parser.ts +387 -0
  139. package/src/ssr/index.ts +136 -43
  140. package/src/ssr/mismatch.ts +110 -0
  141. package/src/ssr/render-async.ts +286 -0
  142. package/src/ssr/render.ts +130 -59
  143. package/src/ssr/renderer.ts +453 -0
  144. package/src/ssr/resumability.ts +142 -0
  145. package/src/ssr/router-bridge.ts +177 -0
  146. package/src/ssr/runtime.ts +131 -0
  147. package/src/ssr/serialize.ts +1 -27
  148. package/src/ssr/store-snapshot.ts +209 -0
  149. package/src/ssr/strategies.ts +245 -0
  150. package/src/ssr/suspense.ts +504 -0
  151. package/src/ssr/types.ts +18 -0
  152. package/dist/router-CCepRMpC.js +0 -493
  153. package/dist/router-CCepRMpC.js.map +0 -1
  154. package/dist/ssr-D-1IPcfw.js +0 -248
  155. package/dist/ssr-D-1IPcfw.js.map +0 -1
@@ -0,0 +1,25 @@
1
+ /**
2
+ * DOM-free SSR renderer.
3
+ *
4
+ * Operates on the virtual node tree produced by `html-parser.ts` and
5
+ * evaluates `bq-*` directives without depending on any browser DOM API.
6
+ * Runs unmodified on Bun, Deno and Node and is the default backend used by
7
+ * `renderToString()` whenever the global `DOMParser` is not configured to
8
+ * take precedence.
9
+ *
10
+ * @module bquery/ssr
11
+ * @internal
12
+ */
13
+ import type { BindingContext } from '../view/types';
14
+ export declare const sanitizeHtmlForSSR: (raw: string) => string;
15
+ /**
16
+ * Renders a template through the DOM-free pipeline.
17
+ *
18
+ * @internal
19
+ */
20
+ export declare const renderTemplatePure: (template: string, data: BindingContext, options?: {
21
+ prefix?: string;
22
+ stripDirectives?: boolean;
23
+ annotateHydration?: boolean;
24
+ }) => string;
25
+ //# sourceMappingURL=renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/ssr/renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAUH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAuKpD,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,KAAG,MA6DhD,CAAC;AAmLF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAC7B,UAAU,MAAM,EAChB,MAAM,cAAc,EACpB,UAAS;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IAAC,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAAO,KACxF,MAeF,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Resumability hooks.
3
+ *
4
+ * A *very* small primitive that lets the server publish JSON-serializable
5
+ * values which the client can read back without re-running the producer.
6
+ * Think of it as a typed key/value store that survives the serialization
7
+ * boundary.
8
+ *
9
+ * It is intentionally not a full Qwik-style resumability system — bQuery's
10
+ * reactive graph is rebuilt on the client. Instead, this primitive helps
11
+ * applications avoid double-fetching loader-style data by parking it on
12
+ * `window.__BQUERY_RESUME__` (or a custom global) inside a CSP-nonce-aware
13
+ * `<script>` tag.
14
+ *
15
+ * @module bquery/ssr
16
+ */
17
+ /** Server-side resumable state collector. */
18
+ export interface ResumableState {
19
+ /** Stash a JSON-serializable value under `key`. */
20
+ set: (key: string, value: unknown) => void;
21
+ /** Read a value back (server-side, useful for tests). */
22
+ get: <T = unknown>(key: string) => T | undefined;
23
+ /** All collected entries. */
24
+ entries: () => Record<string, unknown>;
25
+ /** Build the `<script>` tag to embed in HTML. */
26
+ render: (options?: {
27
+ nonce?: string;
28
+ scriptId?: string;
29
+ globalKey?: string;
30
+ }) => string;
31
+ }
32
+ /** Options for `createResumableState()`. */
33
+ export interface CreateResumableStateOptions {
34
+ /** Initial entries. */
35
+ initial?: Record<string, unknown>;
36
+ }
37
+ /**
38
+ * Creates a server-side resumable state collector.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const resume = createResumableState();
43
+ * resume.set('user', { id: 1, name: 'Ada' });
44
+ *
45
+ * // Inject into HTML:
46
+ * const tag = resume.render({ nonce: ctx.nonce });
47
+ * ```
48
+ */
49
+ export declare const createResumableState: (options?: CreateResumableStateOptions) => ResumableState;
50
+ /** Reader returned by `resumeState()`. */
51
+ export interface ResumeReader {
52
+ /** Get a typed value from the resumable snapshot. */
53
+ get: <T = unknown>(key: string) => T | undefined;
54
+ /** Whether the snapshot was found. */
55
+ hasSnapshot: boolean;
56
+ /** All entries (read-only). */
57
+ entries: () => Record<string, unknown>;
58
+ }
59
+ /**
60
+ * Reads a previously-emitted resumable snapshot from `window` and cleans it
61
+ * up. Safe to call in any environment; returns an empty reader when no
62
+ * snapshot is present (server, tests, etc.).
63
+ */
64
+ export declare const resumeState: (globalKey?: string, scriptId?: string) => ResumeReader;
65
+ //# sourceMappingURL=resumability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resumability.d.ts","sourceRoot":"","sources":["../../src/ssr/resumability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,6CAA6C;AAC7C,MAAM,WAAW,cAAc;IAC7B,mDAAmD;IACnD,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,yDAAyD;IACzD,GAAG,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC,GAAG,SAAS,CAAC;IACjD,6BAA6B;IAC7B,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,iDAAiD;IACjD,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;CACzF;AAED,4CAA4C;AAC5C,MAAM,WAAW,2BAA2B;IAC1C,uBAAuB;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAWD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,GAAI,UAAS,2BAAgC,KAAG,cAgChF,CAAC;AAEF,0CAA0C;AAC1C,MAAM,WAAW,YAAY;IAC3B,qDAAqD;IACrD,GAAG,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC,GAAG,SAAS,CAAC;IACjD,sCAAsC;IACtC,WAAW,EAAE,OAAO,CAAC;IACrB,+BAA+B;IAC/B,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,GACtB,kBAA+B,EAC/B,iBAA8B,KAC7B,YA8BF,CAAC"}
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Router ↔ SSR bridge.
3
+ *
4
+ * On the server you typically need to:
5
+ * 1. Match the incoming URL against your router's route table.
6
+ * 2. Run any data loaders attached to the matched route.
7
+ * 3. Inject the resolved route + loader data into the SSR binding context.
8
+ *
9
+ * `resolveSSRRoute()` and `runRouteLoaders()` perform steps 1 and 2 without
10
+ * coupling the SSR module to the actual `createRouter()` runtime — only the
11
+ * pure `matchRoute()` helper from `@bquery/bquery/router` is used. Loaders
12
+ * live on `RouteDefinition.meta.loader` (additive, no existing field changes).
13
+ *
14
+ * @module bquery/ssr
15
+ */
16
+ import type { Route, RouteDefinition } from '../router/types';
17
+ import type { SSRContext } from './context';
18
+ /**
19
+ * Loader signature for SSR routes. Attach as `meta.loader` on a
20
+ * `RouteDefinition` and `runRouteLoaders()` will invoke it with the matched
21
+ * route + the active SSR context.
22
+ */
23
+ export type SSRRouteLoader<T = unknown> = (args: {
24
+ route: Route;
25
+ ctx: SSRContext;
26
+ }) => T | Promise<T>;
27
+ /** Result of `resolveSSRRoute()`. */
28
+ export interface ResolvedSSRRoute {
29
+ /** Route-like snapshot for the requested URL, with `matched` set when found. */
30
+ route: Route;
31
+ /** Whether a route definition was actually matched. */
32
+ matched: boolean;
33
+ /** Whether the matched route has a `redirectTo` target. */
34
+ isRedirect: boolean;
35
+ /** Redirect target, if any. */
36
+ redirectTo?: string;
37
+ }
38
+ /**
39
+ * Matches a URL against a route table without instantiating a full router.
40
+ *
41
+ * Designed to be called on the server before the SSR render so userland can
42
+ * branch on `matched`/`isRedirect` (e.g. issue a 302 instead of rendering).
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * import { resolveSSRRoute } from '@bquery/bquery/ssr';
47
+ *
48
+ * const { route, matched, isRedirect, redirectTo } = resolveSSRRoute({
49
+ * url: new URL(request.url),
50
+ * routes,
51
+ * });
52
+ *
53
+ * if (isRedirect) return Response.redirect(redirectTo!, 302);
54
+ * if (!matched) return new Response('Not Found', { status: 404 });
55
+ * ```
56
+ */
57
+ export declare const resolveSSRRoute: (options: {
58
+ url: string | URL;
59
+ routes: RouteDefinition[];
60
+ /** Strip a base path before matching. Default: `''`. */
61
+ base?: string;
62
+ }) => ResolvedSSRRoute;
63
+ /**
64
+ * Runs the loader attached to the matched route (`meta.loader`), if any.
65
+ * Returns the resolved data, or `undefined` if no loader is configured.
66
+ */
67
+ export declare const runRouteLoaders: <T = unknown>(route: Route, ctx: SSRContext) => Promise<T | undefined>;
68
+ /**
69
+ * Convenience wrapper that resolves a route, runs its loader, and returns a
70
+ * binding-context fragment ready to be merged into the data passed to
71
+ * `renderToStringAsync()` / `renderToResponse()`.
72
+ *
73
+ * @example
74
+ * ```ts
75
+ * import {
76
+ * createSSRContext,
77
+ * createSSRRouterContext,
78
+ * renderToResponse,
79
+ * } from '@bquery/bquery/ssr';
80
+ *
81
+ * const ctx = createSSRContext();
82
+ * const router = await createSSRRouterContext({ url: request.url, routes, ctx });
83
+ * if (router.isRedirect) return Response.redirect(router.redirectTo!, 302);
84
+ *
85
+ * return renderToResponse(template, { ...router.bindings }, { context: ctx });
86
+ * ```
87
+ */
88
+ export declare const createSSRRouterContext: (options: {
89
+ url: string | URL;
90
+ routes: RouteDefinition[];
91
+ base?: string;
92
+ ctx: SSRContext;
93
+ }) => Promise<{
94
+ route: Route;
95
+ matched: boolean;
96
+ isRedirect: boolean;
97
+ redirectTo?: string;
98
+ data: unknown;
99
+ bindings: Record<string, unknown>;
100
+ }>;
101
+ //# sourceMappingURL=router-bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router-bridge.d.ts","sourceRoot":"","sources":["../../src/ssr/router-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C;;;;GAIG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,IAAI,EAAE;IAC/C,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,EAAE,UAAU,CAAC;CACjB,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAQrB,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B,gFAAgF;IAChF,KAAK,EAAE,KAAK,CAAC;IACb,uDAAuD;IACvD,OAAO,EAAE,OAAO,CAAC;IACjB,2DAA2D;IAC3D,UAAU,EAAE,OAAO,CAAC;IACpB,+BAA+B;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS;IACvC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAClB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,KAAG,gBA+BH,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAU,CAAC,GAAG,OAAO,EAC/C,OAAO,KAAK,EACZ,KAAK,UAAU,KACd,OAAO,CAAC,CAAC,GAAG,SAAS,CASvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,sBAAsB,GAAU,SAAS;IACpD,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAClB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,UAAU,CAAC;CACjB,KAAG,OAAO,CAAC;IACV,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CAoBA,CAAC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Runtime detection helpers for the SSR module.
3
+ *
4
+ * Detects whether the current runtime is Bun, Deno, Node.js, a browser,
5
+ * or a Web-Worker / edge runtime (Cloudflare Workers / `workerd`).
6
+ * Detection is feature-based and never throws; calling these helpers is
7
+ * safe in any environment that provides `globalThis`.
8
+ *
9
+ * @module bquery/ssr
10
+ */
11
+ /**
12
+ * Identifier for a recognised JavaScript runtime.
13
+ */
14
+ export type SSRRuntime = 'bun' | 'deno' | 'node' | 'browser' | 'workerd' | 'unknown';
15
+ /**
16
+ * Detects the current runtime via feature checks on `globalThis`.
17
+ * Order matters: Bun and Deno expose Node compatibility shims, so they are
18
+ * checked first.
19
+ *
20
+ * @returns The detected runtime identifier, or `'unknown'` if none match.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * import { detectRuntime } from '@bquery/bquery/ssr';
25
+ *
26
+ * if (detectRuntime() === 'deno') {
27
+ * // Deno-specific behaviour
28
+ * }
29
+ * ```
30
+ */
31
+ export declare const detectRuntime: () => SSRRuntime;
32
+ /**
33
+ * Returns `true` when called inside a server-side runtime (Bun, Deno, Node,
34
+ * Cloudflare Workers / `workerd`).
35
+ */
36
+ export declare const isServerRuntime: () => boolean;
37
+ /**
38
+ * Returns `true` when called inside a browser-like runtime (full DOM available).
39
+ */
40
+ export declare const isBrowserRuntime: () => boolean;
41
+ /**
42
+ * Lightweight feature-detection report for runtime capabilities relevant to SSR.
43
+ */
44
+ export interface SSRRuntimeFeatures {
45
+ /** Whether `Request`/`Response`/`fetch` are available on `globalThis`. */
46
+ fetchApi: boolean;
47
+ /** Whether `ReadableStream` is available on `globalThis`. */
48
+ webStreams: boolean;
49
+ /** Whether `TextEncoder` is available on `globalThis`. */
50
+ textEncoder: boolean;
51
+ /** Whether `crypto.subtle` is available (used for ETag hashing). */
52
+ subtleCrypto: boolean;
53
+ /** Whether `crypto.randomUUID()` is available. */
54
+ randomUuid: boolean;
55
+ /** Whether the global `DOMParser` is available. */
56
+ domParser: boolean;
57
+ }
58
+ /**
59
+ * Returns a feature-detection report for the current runtime. All checks are
60
+ * non-throwing; missing globals yield `false`.
61
+ */
62
+ export declare const getSSRRuntimeFeatures: () => SSRRuntimeFeatures;
63
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/ssr/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAkBrF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa,QAAO,UA8BhC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAO,OAGlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAO,OAAwC,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,QAAQ,EAAE,OAAO,CAAC;IAClB,6DAA6D;IAC7D,UAAU,EAAE,OAAO,CAAC;IACpB,0DAA0D;IAC1D,WAAW,EAAE,OAAO,CAAC;IACrB,oEAAoE;IACpE,YAAY,EAAE,OAAO,CAAC;IACtB,kDAAkD;IAClD,UAAU,EAAE,OAAO,CAAC;IACpB,mDAAmD;IACnD,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAAO,kBAcxC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/ssr/serialize.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAcxE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA6BF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,mBAAmB,GAAI,UAAS,gBAAqB,KAAG,eA4DpE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,qBAAqB,GAChC,kBAAsC,EACtC,iBAAmC,KAClC,sBA2DF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,IAM9E,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,GAAI,UAAU,sBAAsB,KAAG,IAIhE,CAAC"}
1
+ {"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/ssr/serialize.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAcxE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,mBAAmB,GAAI,UAAS,gBAAqB,KAAG,eA4DpE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,qBAAqB,GAChC,kBAAsC,EACtC,iBAAmC,KAClC,sBA2DF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,IAM9E,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,GAAI,UAAU,sBAAsB,KAAG,IAIhE,CAAC"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Versioned store snapshots and strict drift-checking hydration.
3
+ *
4
+ * Sits *on top of* the simple `serializeStoreState()` / `hydrateStore()` pair
5
+ * to give applications a way to:
6
+ * - tag the snapshot with a schema version so a stale client can refuse to
7
+ * apply server data that no longer matches its store shape;
8
+ * - opt into strict mode where unknown keys cause a warning;
9
+ * - selectively serialize / hydrate a subset of stores.
10
+ *
11
+ * Backwards compatible: the existing helpers stay untouched and remain the
12
+ * primary entry-point for simple use cases.
13
+ *
14
+ * @module bquery/ssr
15
+ */
16
+ /** Versioned store snapshot. */
17
+ export interface SSRStoreSnapshot {
18
+ /** Application-defined version string. Stable per schema. */
19
+ version: string;
20
+ /** Map of store ID → sanitized state. */
21
+ state: Record<string, Record<string, unknown>>;
22
+ }
23
+ /** Result of `serializeStoreSnapshot()`. */
24
+ export interface SerializeSnapshotResult {
25
+ snapshot: SSRStoreSnapshot;
26
+ /** JSON-serialized snapshot. */
27
+ json: string;
28
+ /** `<script>` tag ready to embed (CSP-nonce-aware via `options.nonce`). */
29
+ scriptTag: string;
30
+ }
31
+ /** Options for `serializeStoreSnapshot()`. */
32
+ export interface SerializeSnapshotOptions {
33
+ /** Schema version. Required: hydration only succeeds when versions match. */
34
+ version: string;
35
+ /** Subset of store IDs to serialize. Defaults to all registered stores. */
36
+ storeIds?: string[];
37
+ /** Element ID for the generated `<script>` tag. */
38
+ scriptId?: string;
39
+ /** Global window key where the snapshot is assigned. */
40
+ globalKey?: string;
41
+ /** CSP nonce applied to the generated `<script>`. */
42
+ nonce?: string;
43
+ }
44
+ /**
45
+ * Captures every registered store's state into a versioned snapshot and
46
+ * returns both the JSON payload and a ready-to-embed `<script>` tag.
47
+ */
48
+ export declare const serializeStoreSnapshot: (options: SerializeSnapshotOptions) => SerializeSnapshotResult;
49
+ /** Options for `hydrateStoreSnapshot()`. */
50
+ export interface HydrateSnapshotOptions {
51
+ /**
52
+ * If set, the snapshot's `version` must match this value. Otherwise the
53
+ * function returns early (and warns when `strict` is true).
54
+ */
55
+ expectedVersion?: string;
56
+ /**
57
+ * Strict mode: warn on version mismatch + warn on unknown store IDs (i.e.
58
+ * the snapshot has IDs that aren't currently registered). Default: `false`.
59
+ */
60
+ strict?: boolean;
61
+ }
62
+ /** Result of `hydrateStoreSnapshot()`. */
63
+ export interface HydrateSnapshotResult {
64
+ /** Whether the snapshot was applied. */
65
+ applied: boolean;
66
+ /** Reason when not applied (`'version-mismatch' | 'invalid-shape'`). */
67
+ reason?: 'version-mismatch' | 'invalid-shape';
68
+ /** IDs that were applied. */
69
+ appliedIds: string[];
70
+ /** IDs in the snapshot that no store exists for. */
71
+ unknownIds: string[];
72
+ }
73
+ /**
74
+ * Applies a previously-serialized `SSRStoreSnapshot` to the registered stores.
75
+ *
76
+ * Returns a structured result; never throws on drift unless an explicit error
77
+ * is thrown by a store's `$patch()` implementation.
78
+ */
79
+ export declare const hydrateStoreSnapshot: (snapshot: unknown, options?: HydrateSnapshotOptions) => HydrateSnapshotResult;
80
+ /**
81
+ * Reads the snapshot emitted by `serializeStoreSnapshot()` from `window`,
82
+ * cleans up the global, and returns the parsed `SSRStoreSnapshot`.
83
+ *
84
+ * Returns `null` when no snapshot was found or when it has the wrong shape.
85
+ */
86
+ export declare const readStoreSnapshot: (globalKey?: string, scriptId?: string) => SSRStoreSnapshot | null;
87
+ //# sourceMappingURL=store-snapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-snapshot.d.ts","sourceRoot":"","sources":["../../src/ssr/store-snapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAkBH,gCAAgC;AAChC,MAAM,WAAW,gBAAgB;IAC/B,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAChD;AAED,4CAA4C;AAC5C,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,8CAA8C;AAC9C,MAAM,WAAW,wBAAwB;IACvC,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,wBAAwB,KAChC,uBAkCF,CAAC;AAEF,4CAA4C;AAC5C,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,wCAAwC;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,MAAM,CAAC,EAAE,kBAAkB,GAAG,eAAe,CAAC;IAC9C,6BAA6B;IAC7B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,oDAAoD;IACpD,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AASD;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAC/B,UAAU,OAAO,EACjB,UAAS,sBAA2B,KACnC,qBAmCF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAC5B,kBAAuC,EACvC,iBAAsC,KACrC,gBAAgB,GAAG,IAerB,CAAC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Progressive hydration strategies.
3
+ *
4
+ * Provide thin wrappers around `hydrateMount()` that defer the hydration
5
+ * pass until a chosen trigger fires. They are runtime-safe: in non-browser
6
+ * environments they fall back to immediate hydration (or a no-op) so the
7
+ * same code path can run in tests.
8
+ *
9
+ * @module bquery/ssr
10
+ */
11
+ import type { BindingContext, View } from '../view/types';
12
+ import { type HydrateMountOptions } from './hydrate';
13
+ /** Common return shape for progressive hydration. */
14
+ export interface HydrationHandle {
15
+ /** Cancels pending hydration (no-op if it has already run). */
16
+ cancel(): void;
17
+ /** Resolves with the View once hydration runs, or `null` if cancelled. */
18
+ ready: Promise<View | null>;
19
+ }
20
+ /**
21
+ * Hydrates the target only once it scrolls into view.
22
+ *
23
+ * Falls back to immediate hydration if `IntersectionObserver` is unavailable.
24
+ */
25
+ export declare const hydrateOnVisible: (selector: string | Element, context: BindingContext, options?: HydrateMountOptions & {
26
+ rootMargin?: string;
27
+ threshold?: number;
28
+ }) => HydrationHandle;
29
+ /** Hydrates when the browser is idle. */
30
+ export declare const hydrateOnIdle: (selector: string | Element, context: BindingContext, options?: HydrateMountOptions) => HydrationHandle;
31
+ /** Hydrates on first user interaction (click/keydown/pointerdown/touchstart). */
32
+ export declare const hydrateOnInteraction: (selector: string | Element, context: BindingContext, options?: HydrateMountOptions & {
33
+ events?: string[];
34
+ }) => HydrationHandle;
35
+ /** Hydrates only when a media query matches. */
36
+ export declare const hydrateOnMedia: (selector: string | Element, context: BindingContext, query: string, options?: HydrateMountOptions) => HydrationHandle;
37
+ /**
38
+ * Hydrates a single SSR island using the same runtime-safe target resolution
39
+ * as the other progressive hydration helpers. Returns `null` when the DOM is
40
+ * unavailable or the target cannot be resolved.
41
+ */
42
+ export declare const hydrateIsland: (selector: string | Element, context: BindingContext, options?: HydrateMountOptions) => View | null;
43
+ //# sourceMappingURL=strategies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strategies.d.ts","sourceRoot":"","sources":["../../src/ssr/strategies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAgB,KAAK,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAgDnE,qDAAqD;AACrD,MAAM,WAAW,eAAe;IAC9B,+DAA+D;IAC/D,MAAM,IAAI,IAAI,CAAC;IACf,0EAA0E;IAC1E,KAAK,EAAE,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;CAC7B;AAwCD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAC3B,UAAU,MAAM,GAAG,OAAO,EAC1B,SAAS,cAAc,EACvB,UAAS,mBAAmB,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,KAC9E,eA8BF,CAAC;AAEF,yCAAyC;AACzC,eAAO,MAAM,aAAa,GACxB,UAAU,MAAM,GAAG,OAAO,EAC1B,SAAS,cAAc,EACvB,UAAS,mBAAwB,KAChC,eAIF,CAAC;AAEF,iFAAiF;AACjF,eAAO,MAAM,oBAAoB,GAC/B,UAAU,MAAM,GAAG,OAAO,EAC1B,SAAS,cAAc,EACvB,UAAS,mBAAmB,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAAO,KACxD,eAyBF,CAAC;AAEF,gDAAgD;AAChD,eAAO,MAAM,cAAc,GACzB,UAAU,MAAM,GAAG,OAAO,EAC1B,SAAS,cAAc,EACvB,OAAO,MAAM,EACb,UAAS,mBAAwB,KAChC,eAqCF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACxB,UAAU,MAAM,GAAG,OAAO,EAC1B,SAAS,cAAc,EACvB,UAAS,mBAAwB,KAChC,IAAI,GAAG,IAAmD,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Suspense-style out-of-order streaming for SSR.
3
+ *
4
+ * Renders the synchronous shell with `defer(...)` placeholders wrapped in
5
+ * `<bq-slot id="bq-s-N">…</bq-slot>` markers, flushes that initial chunk,
6
+ * then streams a `<template id="bq-r-N">…</template>` plus a tiny inline
7
+ * patch script for every resolved promise. The patch script swaps the
8
+ * template content into the placeholder and removes both.
9
+ *
10
+ * Honours `SSRContext.signal` for cancellation and propagates the context
11
+ * nonce onto every emitted `<script>` tag for CSP-strict environments.
12
+ *
13
+ * @module bquery/ssr
14
+ */
15
+ import type { BindingContext } from '../view/types';
16
+ import type { AsyncRenderOptions } from './render-async';
17
+ /**
18
+ * Options for `renderToStreamSuspense`.
19
+ *
20
+ * Only `context`, `prefix`, `stripDirectives`, and `annotateHydration` are
21
+ * inherited from the base async render options. Head/store injection and other
22
+ * response-shaping options are intentionally unsupported here.
23
+ */
24
+ export interface SuspenseStreamOptions extends Pick<AsyncRenderOptions, 'context' | 'prefix' | 'stripDirectives' | 'annotateHydration'> {
25
+ /**
26
+ * Prefix used for slot/template IDs. Default: `'bq-s'` for placeholders
27
+ * and `'bq-r'` for resolved templates.
28
+ */
29
+ slotIdPrefix?: string;
30
+ /**
31
+ * Tag name used for the placeholder element. Default: `'bq-slot'`.
32
+ * Must be a valid custom-element tag (contain a `-`) so the browser keeps
33
+ * inner content intact.
34
+ */
35
+ slotTag?: string;
36
+ }
37
+ /**
38
+ * Renders a template into a Web `ReadableStream<Uint8Array>` with
39
+ * Suspense-style out-of-order streaming. The synchronous shell is flushed
40
+ * first; deferred slots stream in as their promises resolve.
41
+ *
42
+ * Use `bq-defer="key"` on an element whose content depends on a `defer()`
43
+ * value to mark where the placeholder wrapping should happen. Without the
44
+ * marker, resolved fragments are appended at the end of `<body>`.
45
+ */
46
+ export declare const renderToStreamSuspense: (template: string, data: BindingContext, options?: SuspenseStreamOptions) => ReadableStream<Uint8Array>;
47
+ //# sourceMappingURL=suspense.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suspense.d.ts","sourceRoot":"","sources":["../../src/ssr/suspense.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAKpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AA6GzD;;;;;;GAMG;AACH,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,SAAS,GAAG,QAAQ,GAAG,iBAAiB,GAAG,mBAAmB,CAAC;IAChG;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA2OD;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAU,MAAM,EAChB,MAAM,cAAc,EACpB,UAAS,qBAA0B,KAClC,cAAc,CAAC,UAAU,CAyG3B,CAAC"}
@@ -25,6 +25,23 @@ export type RenderOptions = {
25
25
  * @default false
26
26
  */
27
27
  includeStoreState?: boolean | string[];
28
+ /**
29
+ * Whether to add a `data-bq-h` mismatch hash to every element that carries
30
+ * a `bq-*` directive. Used by `verifyHydration()` on the client to flag
31
+ * Server↔Client divergence in development. Adds ≈ 6–8 bytes per directive
32
+ * element; safe to leave on in production but only useful in dev builds.
33
+ *
34
+ * Do not combine this with `stripDirectives: true` if you plan to call
35
+ * `verifyHydration()` later: once the `bq-*` / `:` directives are stripped
36
+ * from the HTML, the client can no longer recompute the original signature,
37
+ * so verification will deterministically report mismatches.
38
+ *
39
+ * Currently honoured by the DOM-free renderer; the legacy DOM backend
40
+ * applies the same annotation when `DOMParser` is available.
41
+ *
42
+ * @default false
43
+ */
44
+ annotateHydration?: boolean;
28
45
  };
29
46
  /**
30
47
  * Result of a `renderToString` call.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ssr/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAErD;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;CACxC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,qDAAqD;AACrD,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,MAAM,CAAC;CACvC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ssr/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAErD;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;IAEvC;;;;;;;;;;;;;;;OAeG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,qDAAqD;AACrD,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,MAAM,CAAC;CACvC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC"}