@qwik.dev/core 2.0.0-alpha.9 → 2.0.0-beta.10

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 (132) hide show
  1. package/bindings/qwik.darwin-arm64.node +0 -0
  2. package/bindings/qwik.darwin-x64.node +0 -0
  3. package/bindings/qwik.linux-x64-gnu.node +0 -0
  4. package/bindings/qwik.wasm.cjs +27 -27
  5. package/bindings/qwik.wasm.mjs +27 -27
  6. package/bindings/qwik.win32-x64-msvc.node +0 -0
  7. package/bindings/qwik_wasm_bg.wasm +0 -0
  8. package/dist/backpatch/index.cjs +6 -0
  9. package/dist/backpatch/index.d.ts +2 -0
  10. package/dist/backpatch/index.mjs +5 -0
  11. package/dist/{prefetch → backpatch}/package.json +2 -2
  12. package/dist/backpatch-executor.debug.js +34 -0
  13. package/dist/backpatch-executor.js +1 -0
  14. package/dist/build/index.cjs +3 -3
  15. package/dist/build/index.d.ts +22 -22
  16. package/dist/build/package.json +1 -1
  17. package/dist/cli.cjs +3035 -767
  18. package/dist/core-internal.d.ts +4622 -4153
  19. package/dist/core.cjs +7327 -6169
  20. package/dist/core.cjs.map +1 -1
  21. package/dist/core.min.mjs +1 -1
  22. package/dist/core.mjs +7294 -6163
  23. package/dist/core.mjs.map +1 -1
  24. package/dist/core.prod.cjs +3209 -2612
  25. package/dist/core.prod.mjs +3932 -3294
  26. package/dist/insights/index.qwik.cjs +1 -4142
  27. package/dist/insights/index.qwik.mjs +63 -4133
  28. package/dist/insights/vite/index.cjs +1 -82
  29. package/dist/insights/vite/index.mjs +65 -37
  30. package/dist/insights/vite.d.ts +22 -0
  31. package/dist/{insights/insights.d.ts → insights.d.ts} +33 -22
  32. package/dist/loader/index.cjs +2 -2
  33. package/dist/loader/index.mjs +2 -2
  34. package/dist/loader/package.json +1 -1
  35. package/dist/optimizer.cjs +201 -3817
  36. package/dist/optimizer.d.ts +754 -707
  37. package/dist/optimizer.mjs +2605 -3628
  38. package/dist/preloader.cjs +266 -0
  39. package/dist/preloader.mjs +195 -0
  40. package/dist/qwikloader.debug.js +228 -222
  41. package/dist/qwikloader.js +1 -3
  42. package/dist/server.cjs +915 -621
  43. package/dist/server.d.ts +519 -402
  44. package/dist/server.mjs +900 -615
  45. package/dist/starters/adapters/aws-lambda/adapters/aws-lambda/vite.config.mts +1 -1
  46. package/dist/starters/adapters/aws-lambda/package.json +1 -1
  47. package/dist/starters/adapters/aws-lambda/serverless.yml +15 -0
  48. package/dist/starters/adapters/aws-lambda/src/entry_aws-lambda.tsx +2 -8
  49. package/dist/starters/adapters/azure-swa/adapters/azure-swa/vite.config.mts +1 -1
  50. package/dist/starters/adapters/azure-swa/package.json +1 -1
  51. package/dist/starters/adapters/azure-swa/public/staticwebapp.config.json +7 -0
  52. package/dist/starters/adapters/azure-swa/src/entry.azure-swa.tsx +2 -4
  53. package/dist/starters/adapters/bun/adapters/bun/vite.config.mts +2 -2
  54. package/dist/starters/adapters/bun/package.json +1 -1
  55. package/dist/starters/adapters/bun/src/entry.bun.ts +3 -4
  56. package/dist/starters/adapters/cloud-run/adapters/cloud-run/vite.config.mts +1 -1
  57. package/dist/starters/adapters/cloud-run/package.json +1 -1
  58. package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +2 -6
  59. package/dist/starters/adapters/cloudflare-pages/adapters/cloudflare-pages/vite.config.mts +1 -1
  60. package/dist/starters/adapters/cloudflare-pages/package.json +1 -1
  61. package/dist/starters/adapters/cloudflare-pages/public/_headers +2 -0
  62. package/dist/starters/adapters/cloudflare-pages/src/entry.cloudflare-pages.tsx +2 -4
  63. package/dist/starters/adapters/deno/adapters/deno/vite.config.mts +1 -1
  64. package/dist/starters/adapters/deno/package.json +1 -1
  65. package/dist/starters/adapters/deno/src/entry.deno.ts +3 -4
  66. package/dist/starters/adapters/express/adapters/express/vite.config.mts +1 -1
  67. package/dist/starters/adapters/express/package.json +1 -1
  68. package/dist/starters/adapters/express/src/entry.express.tsx +6 -5
  69. package/dist/starters/adapters/fastify/adapters/fastify/vite.config.mts +1 -1
  70. package/dist/starters/adapters/fastify/package.json +1 -1
  71. package/dist/starters/adapters/fastify/src/entry.fastify.tsx +3 -2
  72. package/dist/starters/adapters/fastify/src/plugins/fastify-qwik.ts +10 -3
  73. package/dist/starters/adapters/firebase/adapters/firebase/vite.config.mts +1 -1
  74. package/dist/starters/adapters/firebase/firebase.json +12 -1
  75. package/dist/starters/adapters/firebase/functions/index.js +2 -3
  76. package/dist/starters/adapters/firebase/package.json +1 -1
  77. package/dist/starters/adapters/firebase/src/entry-firebase.tsx +2 -4
  78. package/dist/starters/adapters/netlify-edge/adapters/netlify-edge/vite.config.mts +1 -1
  79. package/dist/starters/adapters/netlify-edge/package.json +1 -1
  80. package/dist/starters/adapters/netlify-edge/public/_headers +2 -0
  81. package/dist/starters/adapters/netlify-edge/src/entry.netlify-edge.tsx +2 -4
  82. package/dist/starters/adapters/node-server/adapters/node-server/vite.config.mts +1 -1
  83. package/dist/starters/adapters/node-server/package.json +1 -1
  84. package/dist/starters/adapters/node-server/src/entry.node-server.tsx +3 -4
  85. package/dist/starters/adapters/ssg/README.md +9 -0
  86. package/dist/starters/adapters/{static/adapters/static → ssg/adapters/ssg}/vite.config.mts +2 -2
  87. package/dist/starters/adapters/ssg/package.json +19 -0
  88. package/dist/starters/adapters/vercel-edge/adapters/vercel-edge/vite.config.mts +1 -1
  89. package/dist/starters/adapters/vercel-edge/package.json +1 -1
  90. package/dist/starters/adapters/vercel-edge/src/entry.vercel-edge.tsx +2 -4
  91. package/dist/starters/adapters/vercel-edge/vercel.json +1 -1
  92. package/dist/starters/features/auth/package.json +1 -1
  93. package/dist/starters/features/bootstrap/src/routes/bootstrap/layout.tsx +0 -11
  94. package/dist/starters/features/csr/index.html +23 -0
  95. package/dist/starters/features/csr/package.json +29 -0
  96. package/dist/starters/features/csr/src/root.tsx +15 -0
  97. package/dist/starters/features/csr/vite.config.mts +13 -0
  98. package/dist/starters/features/localize/package.json +3 -3
  99. package/dist/starters/features/localize/src/entry.ssr.tsx +17 -23
  100. package/dist/starters/features/localize/src/routes/[locale]/i18n-utils.ts +1 -1
  101. package/dist/starters/features/pandacss/package.json +1 -1
  102. package/dist/starters/features/partytown/package.json +4 -4
  103. package/dist/starters/features/partytown/src/components/partytown/partytown.tsx +2 -2
  104. package/dist/starters/features/playwright/playwright-report/index.html +953 -911
  105. package/dist/starters/features/postcss/postcss.config.js +2 -2
  106. package/dist/starters/features/service-worker/package.json +13 -0
  107. package/dist/starters/features/service-worker/src/routes/service-worker.ts +14 -0
  108. package/dist/starters/features/styled-vanilla-extract/package.json +2 -1
  109. package/dist/starters/features/tailwind/package.json +4 -3
  110. package/dist/starters/features/tailwind/prettier.config.js +10 -0
  111. package/dist/starters/features/tailwind/src/global.css +1 -1
  112. package/dist/starters/features/tailwind-v3/package.json +1 -1
  113. package/dist/starters/features/tailwind-v3/prettier.config.js +10 -0
  114. package/dist/starters/features/tailwind-v3/tailwind.config.js +2 -2
  115. package/dist/testing/index.cjs +14313 -11732
  116. package/dist/testing/index.d.ts +1112 -141
  117. package/dist/testing/index.mjs +14225 -11661
  118. package/dist/testing/package.json +1 -1
  119. package/package.json +28 -14
  120. package/public.d.ts +5 -0
  121. package/server.d.ts +1 -0
  122. package/dist/insights/index.d.ts +0 -1
  123. package/dist/insights/vite/index.d.ts +0 -1
  124. package/dist/insights/vite/insights-plugin.d.ts +0 -10
  125. package/dist/prefetch/index.cjs +0 -4
  126. package/dist/prefetch/index.d.ts +0 -2
  127. package/dist/prefetch/index.mjs +0 -3
  128. package/dist/qwik-prefetch.debug.js +0 -244
  129. package/dist/qwik-prefetch.js +0 -1
  130. package/dist/starters/adapters/static/README.md +0 -5
  131. package/dist/starters/adapters/static/package.json +0 -19
  132. package/dist/starters/features/tailwind/.prettierrc.js +0 -3
package/dist/server.d.ts CHANGED
@@ -1,404 +1,521 @@
1
1
  /// <reference path="./server-modules.d.ts" />
2
2
 
3
- import type { QwikManifest } from './optimizer';
4
- import type { ResolvedManifest } from './optimizer';
5
- import type { SnapshotResult } from '.';
6
- import type { StreamWriter } from '.';
7
- import type { SymbolMapperFn } from './optimizer';
8
-
9
- /** @public */
10
- declare interface DevJSX {
11
- fileName: string;
12
- lineNumber: number;
13
- columnNumber: number;
14
- stack?: string;
15
- }
16
-
17
- /**
18
- * Any function taking a props object that returns JSXOutput.
19
- *
20
- * The `key`, `flags` and `dev` parameters are for internal use.
21
- *
22
- * @public
23
- */
24
- declare type FunctionComponent<P = unknown> = {
25
- renderFn(props: P, key: string | null, flags: number, dev?: DevJSX): JSXOutput;
26
- }['renderFn'];
27
-
28
- /**
29
- * Provides the `qwikloader.js` file as a string. Useful for tooling to inline the qwikloader script
30
- * into HTML.
31
- *
32
- * @public
33
- */
34
- export declare function getQwikLoaderScript(opts?: {
35
- debug?: boolean;
36
- }): string;
37
-
38
- /**
39
- * Provides the `qwik-prefetch-service-worker.js` file as a string. Useful for tooling to inline the
40
- * qwik-prefetch-service-worker script into HTML.
41
- *
42
- * @public
43
- */
44
- export declare function getQwikPrefetchWorkerScript(opts?: {
45
- debug?: boolean;
46
- }): string;
47
-
48
- /** @public */
49
- declare interface GlobalInjections {
50
- tag: string;
51
- attributes?: {
52
- [key: string]: string;
53
- };
54
- location: 'head' | 'body';
55
- }
56
-
57
- /** @public */
58
- export declare interface InOrderAuto {
59
- strategy: 'auto';
60
- maximumInitialChunk?: number;
61
- maximumChunk?: number;
62
- }
63
-
64
- /** @public */
65
- declare interface InOrderDirect {
66
- strategy: 'direct';
67
- }
68
-
69
- /** @public */
70
- export declare interface InOrderDisabled {
71
- strategy: 'disabled';
72
- }
73
-
74
- /** @public */
75
- export declare type InOrderStreaming = InOrderAuto | InOrderDisabled | InOrderDirect;
76
-
77
- /** @public */
78
- declare type JSXChildren = string | number | boolean | null | undefined | Function | RegExp | JSXChildren[] | Promise<JSXChildren> | Signal<JSXChildren> | JSXNode;
79
-
80
- /**
81
- * A JSX Node, an internal structure. You probably want to use `JSXOutput` instead.
82
- *
83
- * @public
84
- */
85
- declare interface JSXNode<T extends string | FunctionComponent | unknown = unknown> {
86
- type: T;
87
- props: T extends FunctionComponent<infer P> ? P : Record<any, unknown>;
88
- children: JSXChildren | null;
89
- key: string | null;
90
- dev?: DevJSX;
91
- }
92
-
93
- /**
94
- * Any valid output for a component
95
- *
96
- * @public
97
- */
98
- declare type JSXOutput = JSXNode | string | number | boolean | null | undefined | JSXOutput[];
99
-
100
- /** @public */
101
- export declare interface PrefetchImplementation {
102
- /**
103
- * `js-append`: Use JS runtime to create each `<link>` and append to the body.
104
- *
105
- * `html-append`: Render each `<link>` within html, appended at the end of the body.
106
- */
107
- linkInsert?: 'js-append' | 'html-append' | null;
108
- /**
109
- * Value of the `<link rel="...">` attribute when link is used. Defaults to `prefetch` if links
110
- * are inserted.
111
- */
112
- linkRel?: 'prefetch' | 'preload' | 'modulepreload' | null;
113
- /**
114
- * Value of the `<link fetchpriority="...">` attribute when link is used. Defaults to `null` if
115
- * links are inserted.
116
- */
117
- linkFetchPriority?: 'auto' | 'low' | 'high' | null;
118
- /**
119
- * `always`: Always include the worker fetch JS runtime.
120
- *
121
- * `no-link-support`: Only include the worker fetch JS runtime when the browser doesn't support
122
- * `<link>` prefetch/preload/modulepreload.
123
- */
124
- workerFetchInsert?: 'always' | 'no-link-support' | null;
125
- /**
126
- * Dispatch a `qprefetch` event with detail data containing the bundles that should be prefetched.
127
- * The event dispatch script will be inlined into the document's HTML so any listeners of this
128
- * event should already be ready to handle the event.
129
- *
130
- * This implementation will inject a script similar to:
131
- *
132
- * ```
133
- * <script type="module">
134
- * document.dispatchEvent(new CustomEvent("qprefetch", { detail:{ "bundles": [...] } }))
135
- * </script>
136
- * ```
137
- *
138
- * By default, the `prefetchEvent` implementation will be set to `always`.
139
- */
140
- prefetchEvent?: 'always' | null;
141
- }
142
-
143
- /** @public */
144
- export declare interface PrefetchResource {
145
- url: string;
146
- imports: PrefetchResource[];
147
- }
148
-
149
- /** @public */
150
- export declare interface PrefetchStrategy {
151
- implementation?: PrefetchImplementation;
152
- symbolsToPrefetch?: SymbolsToPrefetch;
153
- }
154
-
155
- /** @public */
156
- declare interface QwikBundle {
157
- size: number;
158
- /** Not precise, but an indication of whether this import may be a task */
159
- isTask?: boolean;
160
- symbols?: string[];
161
- imports?: string[];
162
- dynamicImports?: string[];
163
- origins?: string[];
164
- }
165
-
166
- /** @public */
167
- export declare interface QwikLoaderOptions {
168
- include?: 'always' | 'never' | 'auto';
169
- position?: 'top' | 'bottom';
170
- }
171
-
172
- /**
173
- * The metadata of the build. One of its uses is storing where QRL symbols are located.
174
- *
175
- * @public
176
- */
177
- declare interface QwikManifest_2 {
178
- /** Content hash of the manifest, if this changes, the code changed */
179
- manifestHash: string;
180
- /** QRL symbols */
181
- symbols: {
182
- [symbolName: string]: QwikSymbol;
183
- };
184
- /** Where QRLs are located */
185
- mapping: {
186
- [symbolName: string]: string;
187
- };
188
- /** All code bundles, used to know the import graph */
189
- bundles: {
190
- [fileName: string]: QwikBundle;
191
- };
192
- /** CSS etc to inject in the document head */
193
- injections?: GlobalInjections[];
194
- version: string;
195
- options?: {
196
- target?: string;
197
- buildMode?: string;
198
- entryStrategy?: {
199
- [key: string]: any;
200
- };
201
- };
202
- platform?: {
203
- [name: string]: string;
204
- };
205
- }
206
-
207
- /**
208
- * Options which determine how the Qwik Prefetch Service Worker is added to the document.
209
- *
210
- * Qwik Prefetch Service Worker is used to prefetch resources so that the QwikLoader will always
211
- * have a cache hit. This will ensure that there will not be any delays for the end user while
212
- * interacting with the application.
213
- *
214
- * @public
215
- */
216
- declare interface QwikPrefetchServiceWorkerOptions {
217
- /**
218
- * Should the Qwik Prefetch Service Worker be added to the container. Defaults to `false` until
219
- * the QwikRouter Service Worker is deprecated.
220
- */
221
- include?: boolean;
222
- /**
223
- * Where should the Qwik Prefetch Service Worker be added to the container. Defaults to `top` to
224
- * get prefetching going as fast as possible.
225
- */
226
- position?: 'top' | 'bottom';
227
- }
228
-
229
- /** @public */
230
- declare interface QwikSymbol {
231
- origin: string;
232
- displayName: string;
233
- hash: string;
234
- canonicalFilename: string;
235
- ctxKind: 'function' | 'event';
236
- ctxName: string;
237
- captures: boolean;
238
- parent: string | null;
239
- loc: [number, number];
240
- }
241
-
242
- /** @public */
243
- declare interface ReadonlySignal<T = unknown> {
244
- readonly value: T;
245
- }
246
-
247
- /** @public */
248
- export declare type Render = RenderToString | RenderToStream;
249
-
250
- /** @public */
251
- export declare interface RenderOptions extends SerializeDocumentOptions {
252
- /** Defaults to `true` */
253
- snapshot?: boolean;
254
- /**
255
- * Specifies the root of the JS files of the client build. Setting a base, will cause the render
256
- * of the `q:base` attribute in the `q:container` element.
257
- */
258
- base?: string | ((options: RenderOptions) => string);
259
- /** Language to use when rendering the document. */
260
- locale?: string | ((options: RenderOptions) => string);
261
- /**
262
- * Specifies if the Qwik Loader script is added to the document or not.
263
- *
264
- * Defaults to `{ include: true }`.
265
- */
266
- qwikLoader?: QwikLoaderOptions;
267
- /**
268
- * Specifies if the Qwik Prefetch Service Worker script is added to the document or not.
269
- *
270
- * Defaults to `{ include: false }`. NOTE: This may be change in the future.
271
- */
272
- qwikPrefetchServiceWorker?: QwikPrefetchServiceWorkerOptions;
273
- prefetchStrategy?: PrefetchStrategy | null;
274
- /**
275
- * When set, the app is serialized into a fragment. And the returned html is not a complete
276
- * document. Defaults to `html`
277
- */
278
- containerTagName?: string;
279
- containerAttributes?: Record<string, string>;
280
- serverData?: Record<string, any>;
281
- }
282
-
283
- /** @public */
284
- export declare interface RenderResult {
285
- prefetchResources: PrefetchResource[];
286
- snapshotResult: SnapshotResult | undefined;
287
- isStatic: boolean;
288
- manifest?: QwikManifest;
289
- /** @internal TODO: Move to snapshotResult */
290
- _symbols?: string[];
291
- }
292
-
293
- /** @public */
294
- export declare type RenderToStream = (opts: RenderToStreamOptions) => Promise<RenderToStreamResult>;
295
-
296
- /**
297
- * Creates a server-side `document`, renders to root node to the document, then serializes the
298
- * document to a string.
299
- *
300
- * @public
301
- */
302
- export declare const renderToStream: (jsx: JSXOutput, opts: RenderToStreamOptions) => Promise<RenderToStreamResult>;
303
-
304
- /** @public */
305
- export declare interface RenderToStreamOptions extends RenderOptions {
306
- stream: StreamWriter;
307
- streaming?: StreamingOptions;
308
- }
309
-
310
- /** @public */
311
- export declare interface RenderToStreamResult extends RenderResult {
312
- flushes: number;
313
- size: number;
314
- timing: {
315
- firstFlush: number;
316
- render: number;
317
- snapshot: number;
318
- };
319
- }
320
-
321
- /** @public */
322
- export declare type RenderToString = (opts: RenderToStringOptions) => Promise<RenderToStringResult>;
323
-
324
- /**
325
- * Creates a server-side `document`, renders to root node to the document, then serializes the
326
- * document to a string.
327
- *
328
- * @public
329
- */
330
- export declare const renderToString: (jsx: JSXOutput, opts?: RenderToStringOptions) => Promise<RenderToStringResult>;
331
-
332
- /** @public */
333
- export declare interface RenderToStringOptions extends RenderOptions {
334
- }
335
-
336
- /** @public */
337
- export declare interface RenderToStringResult extends RenderResult {
338
- html: string;
339
- timing: {
340
- firstFlush: number;
341
- render: number;
342
- snapshot: number;
343
- };
344
- }
345
-
346
- /** @public */
347
- declare interface ResolvedManifest_2 {
348
- mapper: SymbolMapper;
349
- manifest: QwikManifest_2;
350
- }
351
-
352
- /** @public */
353
- export declare function resolveManifest(manifest: QwikManifest | ResolvedManifest_2 | undefined): ResolvedManifest_2 | undefined;
354
-
355
- /** @public */
356
- export declare interface SerializeDocumentOptions {
357
- manifest?: QwikManifest | ResolvedManifest;
358
- symbolMapper?: SymbolMapperFn;
359
- debug?: boolean;
360
- }
361
-
362
- /** @public */
363
- export declare function setServerPlatform(manifest: QwikManifest | ResolvedManifest | undefined): Promise<void>;
364
-
365
- /**
366
- * A signal is a reactive value which can be read and written. When the signal is written, all tasks
367
- * which are tracking the signal will be re-run and all components that read the signal will be
368
- * re-rendered.
369
- *
370
- * Furthermore, when a signal value is passed as a prop to a component, the optimizer will
371
- * automatically forward the signal. This means that `return <div title={signal.value}>hi</div>`
372
- * will update the `title` attribute when the signal changes without having to re-render the
373
- * component.
374
- *
375
- * @public
376
- */
377
- declare interface Signal<T = any> extends ReadonlySignal<T> {
378
- value: T;
379
- }
380
-
381
- /** @public */
382
- export declare interface StreamingOptions {
383
- inOrder?: InOrderStreaming;
384
- }
385
-
386
- /** @public */
387
- declare type SymbolMapper = Record<string, readonly [symbol: string, chunk: string]>;
388
-
389
- /**
390
- * Auto: Prefetch all possible QRLs used by the document. Default
391
- *
392
- * @public
393
- */
394
- export declare type SymbolsToPrefetch = 'auto' | ((opts: {
395
- manifest: QwikManifest;
396
- }) => PrefetchResource[]);
397
-
398
- /** @public */
399
- export declare const versions: {
400
- readonly qwik: string;
401
- readonly qwikDom: string;
402
- };
403
-
404
- export { }
3
+ import type { QwikManifest } from './optimizer';
4
+ import type { ResolvedManifest } from './optimizer';
5
+ import type { ServerQwikManifest } from './optimizer';
6
+ import type { SnapshotResult } from '.';
7
+ import type { StreamWriter } from '.';
8
+ import type { SymbolMapperFn } from './optimizer';
9
+
10
+ /** @public */
11
+ declare interface ComponentEntryStrategy {
12
+ type: 'component';
13
+ manual?: Record<string, string>;
14
+ }
15
+
16
+ /** @public */
17
+ declare interface DevJSX {
18
+ fileName: string;
19
+ lineNumber: number;
20
+ columnNumber: number;
21
+ stack?: string;
22
+ }
23
+
24
+ /** @public */
25
+ declare type EntryStrategy = InlineEntryStrategy | HoistEntryStrategy | SingleEntryStrategy | HookEntryStrategy | SegmentEntryStrategy | ComponentEntryStrategy | SmartEntryStrategy;
26
+
27
+ /**
28
+ * Any function taking a props object that returns JSXOutput.
29
+ *
30
+ * The `key`, `flags` and `dev` parameters are for internal use.
31
+ *
32
+ * @public
33
+ */
34
+ declare type FunctionComponent<P = unknown> = {
35
+ renderFn(props: P, key: string | null, flags: number, dev?: DevJSX): JSXOutput;
36
+ }['renderFn'];
37
+
38
+ /**
39
+ * Provides the `backpatch-executor.js` executor script as a string.
40
+ *
41
+ * @public
42
+ */
43
+ export declare function getQwikBackpatchExecutorScript(opts?: {
44
+ debug?: boolean;
45
+ }): string;
46
+
47
+ /**
48
+ * Provides the `qwikloader.js` file as a string. Useful for tooling to inline the qwikloader script
49
+ * into HTML.
50
+ *
51
+ * @public
52
+ */
53
+ export declare function getQwikLoaderScript(opts?: {
54
+ debug?: boolean;
55
+ }): string;
56
+
57
+ /**
58
+ * Provides the `qwik-prefetch-service-worker.js` file as a string. Useful for tooling to inline the
59
+ * qwik-prefetch-service-worker script into HTML.
60
+ *
61
+ * @public
62
+ */
63
+ export declare function getQwikPrefetchWorkerScript(opts?: {
64
+ debug?: boolean;
65
+ }): string;
66
+
67
+ /** @public */
68
+ declare interface GlobalInjections {
69
+ tag: string;
70
+ attributes?: {
71
+ [key: string]: string;
72
+ };
73
+ location: 'head' | 'body';
74
+ }
75
+
76
+ /** @public */
77
+ declare interface HoistEntryStrategy {
78
+ type: 'hoist';
79
+ }
80
+
81
+ /** @deprecated Use SegmentStrategy instead */
82
+ declare interface HookEntryStrategy {
83
+ type: 'hook';
84
+ manual?: Record<string, string>;
85
+ }
86
+
87
+ /** @public */
88
+ declare interface InlineEntryStrategy {
89
+ type: 'inline';
90
+ }
91
+
92
+ /** @public */
93
+ export declare interface InOrderAuto {
94
+ strategy: 'auto';
95
+ maximumInitialChunk?: number;
96
+ maximumChunk?: number;
97
+ }
98
+
99
+ /** @public */
100
+ declare interface InOrderDirect {
101
+ strategy: 'direct';
102
+ }
103
+
104
+ /** @public */
105
+ export declare interface InOrderDisabled {
106
+ strategy: 'disabled';
107
+ }
108
+
109
+ /** @public */
110
+ export declare type InOrderStreaming = InOrderAuto | InOrderDisabled | InOrderDirect;
111
+
112
+ /** @public */
113
+ declare type JSXChildren = string | number | boolean | null | undefined | Function | RegExp | JSXChildren[] | Promise<JSXChildren> | Signal<JSXChildren> | JSXNode;
114
+
115
+ /**
116
+ * A JSX Node, an internal structure. You probably want to use `JSXOutput` instead.
117
+ *
118
+ * @public
119
+ */
120
+ declare interface JSXNode<T extends string | FunctionComponent | unknown = unknown> {
121
+ type: T;
122
+ props: T extends FunctionComponent<infer P> ? P : Record<any, unknown>;
123
+ children: JSXChildren | null;
124
+ key: string | null;
125
+ dev?: DevJSX;
126
+ }
127
+
128
+ /**
129
+ * Any valid output for a component
130
+ *
131
+ * @public
132
+ */
133
+ declare type JSXOutput = JSXNode | string | number | boolean | null | undefined | JSXOutput[];
134
+
135
+ /** @public @deprecated Use `preloader` instead */
136
+ export declare interface PrefetchImplementation {
137
+ /** @deprecated No longer used. */
138
+ linkRel?: 'prefetch' | 'preload' | 'modulepreload' | null;
139
+ /** @deprecated No longer used. */
140
+ linkFetchPriority?: 'auto' | 'low' | 'high' | null;
141
+ /** @deprecated No longer used. */
142
+ linkInsert?: 'js-append' | 'html-append' | null;
143
+ /** @deprecated No longer used. */
144
+ workerFetchInsert?: 'always' | 'no-link-support' | null;
145
+ /** @deprecated No longer used. */
146
+ prefetchEvent?: 'always' | null;
147
+ }
148
+
149
+ /** @public */
150
+ export declare interface PrefetchResource {
151
+ url: string;
152
+ imports: PrefetchResource[];
153
+ }
154
+
155
+ /** @public */
156
+ export declare interface PrefetchStrategy {
157
+ implementation?: PrefetchImplementation;
158
+ symbolsToPrefetch?: SymbolsToPrefetch;
159
+ }
160
+
161
+ /** @public */
162
+ export declare interface PreloaderOptions {
163
+ /**
164
+ * Maximum number of preload links to add during SSR. These instruct the browser to preload likely
165
+ * bundles before the preloader script is active. This most likely includes the core and the
166
+ * preloader script itself. Setting this to 0 will disable all preload links.
167
+ *
168
+ * Preload links can delay LCP, which is a Core Web Vital, but it can increase TTI, which is not a
169
+ * Core Web Vital but more noticeable to the user.
170
+ *
171
+ * Defaults to `5`
172
+ */
173
+ ssrPreloads?: number;
174
+ /**
175
+ * The minimum probability for a bundle to be added as a preload link during SSR.
176
+ *
177
+ * Defaults to `0.7` (70% probability)
178
+ *
179
+ * This makes sure that the most likely bundles are preloaded ahead of time.
180
+ */
181
+ ssrPreloadProbability?: number;
182
+ /**
183
+ * Log preloader debug information to the console.
184
+ *
185
+ * Defaults to `false`
186
+ */
187
+ debug?: boolean;
188
+ /**
189
+ * Maximum number of simultaneous preload links that the preloader will maintain. If you set this
190
+ * higher, the browser will have all JS files in memory sooner, but it will contend with other
191
+ * resource downloads. Furthermore, if a bundle suddenly becomes more likely, it will have to wait
192
+ * longer to be preloaded.
193
+ *
194
+ * Bundles that reach 100% probability (static imports of other bundles) will always be preloaded
195
+ * immediately, no limit.
196
+ *
197
+ * Defaults to `25`
198
+ */
199
+ maxIdlePreloads?: number;
200
+ /**
201
+ * @deprecated The minimum probability for a bundle to be added to the preload queue.
202
+ *
203
+ * Defaulted to `0.35` (35% probability).
204
+ *
205
+ * Deprecated because this could cause performance issues with bundles fetched on on click instead
206
+ * of being preloaded ahead of time.
207
+ */
208
+ preloadProbability?: number;
209
+ }
210
+
211
+ /** @public */
212
+ declare interface QwikAsset {
213
+ /** Name of the asset */
214
+ name: string | undefined;
215
+ /** Size of the asset */
216
+ size: number;
217
+ }
218
+
219
+ /** @public */
220
+ declare interface QwikBundle {
221
+ /** Size of the bundle */
222
+ size: number;
223
+ /** Total size of this bundle's static import graph */
224
+ total: number;
225
+ /** Interactivity score of the bundle */
226
+ interactivity?: number;
227
+ /** Symbols in the bundle */
228
+ symbols?: string[];
229
+ /** Direct imports */
230
+ imports?: string[];
231
+ /** Dynamic imports */
232
+ dynamicImports?: string[];
233
+ /** Source files of the bundle */
234
+ origins?: string[];
235
+ }
236
+
237
+ /**
238
+ * Bundle graph.
239
+ *
240
+ * Format: [ 'bundle-a.js', 3, 5 // Depends on 'bundle-b.js' and 'bundle-c.js' 'bundle-b.js', 5, //
241
+ * Depends on 'bundle-c.js' 'bundle-c.js', ]
242
+ *
243
+ * @public
244
+ */
245
+ declare type QwikBundleGraph = Array<string | number>;
246
+
247
+ /** @public */
248
+ export declare interface QwikLoaderOptions {
249
+ /**
250
+ * Whether to include the qwikloader script in the document. Normally you don't need to worry
251
+ * about this, but in case of multi-container apps using different Qwik versions, you might want
252
+ * to only enable it on one of the containers.
253
+ *
254
+ * Defaults to `'auto'`.
255
+ */
256
+ include?: 'always' | 'never' | 'auto';
257
+ /** @deprecated No longer used, the qwikloader is always loaded as soon as possible */
258
+ position?: 'top' | 'bottom';
259
+ }
260
+
261
+ /**
262
+ * The metadata of the build. One of its uses is storing where QRL symbols are located.
263
+ *
264
+ * @public
265
+ */
266
+ declare interface QwikManifest_2 {
267
+ /** Content hash of the manifest, if this changes, the code changed */
268
+ manifestHash: string;
269
+ /** QRL symbols */
270
+ symbols: {
271
+ [symbolName: string]: QwikSymbol;
272
+ };
273
+ /** Where QRLs are located. The key is the symbol name, the value is the bundle fileName */
274
+ mapping: {
275
+ [symbolName: string]: string;
276
+ };
277
+ /**
278
+ * All code bundles, used to know the import graph. The key is the bundle fileName relative to
279
+ * "build/"
280
+ */
281
+ bundles: {
282
+ [fileName: string]: QwikBundle;
283
+ };
284
+ /** All assets. The key is the fileName relative to the rootDir */
285
+ assets?: {
286
+ [fileName: string]: QwikAsset;
287
+ };
288
+ /** All bundles in a compact graph format with probabilities */
289
+ bundleGraph?: QwikBundleGraph;
290
+ /** The bundle graph fileName */
291
+ bundleGraphAsset?: string;
292
+ /** The preloader bundle fileName */
293
+ preloader?: string;
294
+ /** The Qwik core bundle fileName */
295
+ core?: string;
296
+ /** The Qwik loader bundle fileName */
297
+ qwikLoader?: string;
298
+ /** CSS etc to inject in the document head */
299
+ injections?: GlobalInjections[];
300
+ /** The version of the manifest */
301
+ version: string;
302
+ /** The options used to build the manifest */
303
+ options?: {
304
+ target?: string;
305
+ buildMode?: string;
306
+ entryStrategy?: {
307
+ type: EntryStrategy['type'];
308
+ };
309
+ };
310
+ /** The platform used to build the manifest */
311
+ platform?: {
312
+ [name: string]: string;
313
+ };
314
+ }
315
+
316
+ /** @public */
317
+ declare interface QwikSymbol {
318
+ origin: string;
319
+ displayName: string;
320
+ hash: string;
321
+ canonicalFilename: string;
322
+ ctxKind: 'function' | 'eventHandler';
323
+ ctxName: string;
324
+ /** Whether the symbol captures a variable */
325
+ captures: boolean;
326
+ parent: string | null;
327
+ loc: [number, number];
328
+ /** The parameter names if it's a function with parameters */
329
+ paramNames?: string[];
330
+ /** The transformed names of scoped variables, if any */
331
+ captureNames?: string[];
332
+ }
333
+
334
+ /** @public */
335
+ declare interface ReadonlySignal<T = unknown> {
336
+ readonly value: T;
337
+ }
338
+
339
+ /** @public */
340
+ export declare type Render = RenderToString | RenderToStream;
341
+
342
+ /** @public */
343
+ export declare interface RenderOptions extends SerializeDocumentOptions {
344
+ /** Defaults to `true` */
345
+ snapshot?: boolean;
346
+ /**
347
+ * Specifies the root of the JS files of the client build. Setting a base, will cause the render
348
+ * of the `q:base` attribute in the `q:container` element.
349
+ */
350
+ base?: string | ((options: RenderOptions) => string);
351
+ /** Language to use when rendering the document. */
352
+ locale?: string | ((options: RenderOptions) => string);
353
+ /**
354
+ * Specifies if the Qwik Loader script is added to the document or not.
355
+ *
356
+ * Defaults to `{ include: true }`.
357
+ */
358
+ qwikLoader?: QwikLoaderOptions;
359
+ preloader?: PreloaderOptions | false;
360
+ /** @deprecated Use `preloader` instead */
361
+ prefetchStrategy?: PrefetchStrategy | null;
362
+ /**
363
+ * When set, the app is serialized into a fragment. And the returned html is not a complete
364
+ * document. Defaults to `html`
365
+ */
366
+ containerTagName?: string;
367
+ containerAttributes?: Record<string, string>;
368
+ /** Metadata that can be retrieved during SSR with `useServerData()`. */
369
+ serverData?: Record<string, any>;
370
+ }
371
+
372
+ /** @public */
373
+ export declare interface RenderResult {
374
+ snapshotResult: SnapshotResult | undefined;
375
+ isStatic: boolean;
376
+ manifest?: ServerQwikManifest;
377
+ }
378
+
379
+ /** @public */
380
+ export declare type RenderToStream = (opts: RenderToStreamOptions) => Promise<RenderToStreamResult>;
381
+
382
+ /**
383
+ * Creates a server-side `document`, renders to root node to the document, then serializes the
384
+ * document to a string.
385
+ *
386
+ * @public
387
+ */
388
+ export declare const renderToStream: (jsx: JSXOutput, opts: RenderToStreamOptions) => Promise<RenderToStreamResult>;
389
+
390
+ /** @public */
391
+ export declare interface RenderToStreamOptions extends RenderOptions {
392
+ stream: StreamWriter;
393
+ streaming?: StreamingOptions;
394
+ }
395
+
396
+ /** @public */
397
+ export declare interface RenderToStreamResult extends RenderResult {
398
+ flushes: number;
399
+ size: number;
400
+ timing: {
401
+ firstFlush: number;
402
+ render: number;
403
+ snapshot: number;
404
+ };
405
+ }
406
+
407
+ /** @public */
408
+ export declare type RenderToString = (opts: RenderToStringOptions) => Promise<RenderToStringResult>;
409
+
410
+ /**
411
+ * Creates a server-side `document`, renders to root node to the document, then serializes the
412
+ * document to a string.
413
+ *
414
+ * @public
415
+ */
416
+ export declare const renderToString: (jsx: JSXOutput, opts?: RenderToStringOptions) => Promise<RenderToStringResult>;
417
+
418
+ /** @public */
419
+ export declare interface RenderToStringOptions extends RenderOptions {
420
+ }
421
+
422
+ /** @public */
423
+ export declare interface RenderToStringResult extends RenderResult {
424
+ html: string;
425
+ timing: {
426
+ firstFlush: number;
427
+ render: number;
428
+ snapshot: number;
429
+ };
430
+ }
431
+
432
+ /** @public */
433
+ declare interface ResolvedManifest_2 {
434
+ mapper: SymbolMapper;
435
+ manifest: ServerQwikManifest_2;
436
+ injections?: GlobalInjections[];
437
+ bundleGraph?: QwikBundleGraph;
438
+ }
439
+
440
+ /**
441
+ * Merges a given manifest with the built manifest and provides mappings for symbols.
442
+ *
443
+ * @public
444
+ */
445
+ export declare function resolveManifest(manifest?: Partial<QwikManifest | ResolvedManifest_2> | undefined): ResolvedManifest_2 | undefined;
446
+
447
+ /** @public */
448
+ declare interface SegmentEntryStrategy {
449
+ type: 'segment';
450
+ manual?: Record<string, string>;
451
+ }
452
+
453
+ /** @public */
454
+ export declare interface SerializeDocumentOptions {
455
+ manifest?: Partial<QwikManifest | ResolvedManifest>;
456
+ symbolMapper?: SymbolMapperFn;
457
+ debug?: boolean;
458
+ }
459
+
460
+ /**
461
+ * The manifest values that are needed for SSR.
462
+ *
463
+ * @public
464
+ */
465
+ declare type ServerQwikManifest_2 = Pick<QwikManifest_2, 'manifestHash' | 'injections' | 'bundleGraph' | 'bundleGraphAsset' | 'mapping' | 'preloader' | 'core' | 'qwikLoader'>;
466
+
467
+ /** @public */
468
+ export declare function setServerPlatform(manifest?: Partial<QwikManifest | ResolvedManifest>): Promise<void>;
469
+
470
+ /**
471
+ * A signal is a reactive value which can be read and written. When the signal is written, all tasks
472
+ * which are tracking the signal will be re-run and all components that read the signal will be
473
+ * re-rendered.
474
+ *
475
+ * Furthermore, when a signal value is passed as a prop to a component, the optimizer will
476
+ * automatically forward the signal. This means that `return <div title={signal.value}>hi</div>`
477
+ * will update the `title` attribute when the signal changes without having to re-render the
478
+ * component.
479
+ *
480
+ * @public
481
+ */
482
+ declare interface Signal<T = any> extends ReadonlySignal<T> {
483
+ value: T;
484
+ }
485
+
486
+ /** @public */
487
+ declare interface SingleEntryStrategy {
488
+ type: 'single';
489
+ manual?: Record<string, string>;
490
+ }
491
+
492
+ /** @public */
493
+ declare interface SmartEntryStrategy {
494
+ type: 'smart';
495
+ manual?: Record<string, string>;
496
+ }
497
+
498
+ /** @public */
499
+ export declare interface StreamingOptions {
500
+ inOrder?: InOrderStreaming;
501
+ }
502
+
503
+ /** @public */
504
+ declare type SymbolMapper = Record<string, readonly [symbol: string, chunk: string]>;
505
+
506
+ /**
507
+ * Auto: Prefetch all possible QRLs used by the document. Default
508
+ *
509
+ * @public
510
+ */
511
+ export declare type SymbolsToPrefetch = 'auto' | ((opts: {
512
+ manifest: ServerQwikManifest;
513
+ }) => PrefetchResource[]);
514
+
515
+ /** @public */
516
+ export declare const versions: {
517
+ readonly qwik: string;
518
+ readonly qwikDom: string;
519
+ };
520
+
521
+ export { }