@qwik.dev/core 0.0.0 → 2.0.0-alpha.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/LICENSE +22 -0
- package/bindings/qwik.linux-x64-gnu.node +0 -0
- package/bindings/qwik.wasm.cjs +484 -0
- package/bindings/qwik.wasm.mjs +477 -0
- package/bindings/qwik_wasm_bg.wasm +0 -0
- package/build.d.ts +2 -0
- package/dist/build/index.cjs +35 -0
- package/dist/build/index.cjs.map +7 -0
- package/dist/build/index.d.ts +22 -0
- package/dist/build/index.dev.cjs +37 -0
- package/dist/build/index.dev.cjs.map +7 -0
- package/dist/build/index.dev.mjs +12 -0
- package/dist/build/index.dev.mjs.map +7 -0
- package/dist/build/index.mjs +12 -0
- package/dist/build/index.mjs.map +7 -0
- package/dist/build/index.prod.cjs +37 -0
- package/dist/build/index.prod.cjs.map +7 -0
- package/dist/build/index.prod.mjs +12 -0
- package/dist/build/index.prod.mjs.map +7 -0
- package/dist/build/package.json +8 -0
- package/dist/cli.cjs +4890 -0
- package/dist/core-internal.d.ts +3895 -0
- package/dist/core.cjs +10923 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.min.mjs +1 -0
- package/dist/core.mjs +10819 -0
- package/dist/core.mjs.map +1 -0
- package/dist/core.prod.cjs +5181 -0
- package/dist/core.prod.mjs +6025 -0
- package/dist/index.d.ts +2 -0
- package/dist/insights/index.d.ts +1 -0
- package/dist/insights/index.qwik.cjs +751 -0
- package/dist/insights/index.qwik.mjs +751 -0
- package/dist/insights/insights.d.ts +59 -0
- package/dist/insights/vite/index.cjs +82 -0
- package/dist/insights/vite/index.d.ts +1 -0
- package/dist/insights/vite/index.mjs +55 -0
- package/dist/insights/vite/insights-plugin.d.ts +10 -0
- package/dist/jsx-runtime/index.d.ts +2 -0
- package/dist/jsx-runtime.d.ts +2 -0
- package/dist/loader/index.cjs +4 -0
- package/dist/loader/index.d.ts +2 -0
- package/dist/loader/index.mjs +3 -0
- package/dist/loader/package.json +8 -0
- package/dist/optimizer.cjs +9145 -0
- package/dist/optimizer.d.ts +707 -0
- package/dist/optimizer.mjs +9709 -0
- package/dist/prefetch/index.cjs +4 -0
- package/dist/prefetch/index.d.ts +2 -0
- package/dist/prefetch/index.mjs +3 -0
- package/dist/prefetch/package.json +8 -0
- package/dist/qwik-prefetch.debug.js +244 -0
- package/dist/qwik-prefetch.js +1 -0
- package/dist/qwikloader.debug.js +228 -0
- package/dist/qwikloader.js +3 -0
- package/dist/server-modules.d.ts +38 -0
- package/dist/server.cjs +8942 -0
- package/dist/server.d.ts +404 -0
- package/dist/server.mjs +8877 -0
- package/dist/starters/adapters/aws-lambda/.eslintignore +2 -0
- package/dist/starters/adapters/aws-lambda/.prettierignore +2 -0
- package/dist/starters/adapters/aws-lambda/adapters/aws-lambda/vite.config.mts +21 -0
- package/dist/starters/adapters/aws-lambda/gitignore +2 -0
- package/dist/starters/adapters/aws-lambda/package.json +23 -0
- package/dist/starters/adapters/aws-lambda/serverless.yml +31 -0
- package/dist/starters/adapters/aws-lambda/src/entry_aws-lambda.tsx +32 -0
- package/dist/starters/adapters/azure-swa/README.md +13 -0
- package/dist/starters/adapters/azure-swa/adapters/azure-swa/vite.config.mts +23 -0
- package/dist/starters/adapters/azure-swa/azure-functions/host.json +20 -0
- package/dist/starters/adapters/azure-swa/gitignore +3 -0
- package/dist/starters/adapters/azure-swa/package.json +28 -0
- package/dist/starters/adapters/azure-swa/public/staticwebapp.config.json +23 -0
- package/dist/starters/adapters/azure-swa/src/entry.azure-swa.tsx +22 -0
- package/dist/starters/adapters/azure-swa/swa-cli.config.json +11 -0
- package/dist/starters/adapters/bun/README.md +9 -0
- package/dist/starters/adapters/bun/adapters/bun/vite.config.mts +28 -0
- package/dist/starters/adapters/bun/package.json +27 -0
- package/dist/starters/adapters/bun/src/entry.bun.ts +46 -0
- package/dist/starters/adapters/cloud-run/Dockerfile +24 -0
- package/dist/starters/adapters/cloud-run/README.md +7 -0
- package/dist/starters/adapters/cloud-run/adapters/cloud-run/vite.config.mts +15 -0
- package/dist/starters/adapters/cloud-run/package.json +24 -0
- package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +96 -0
- package/dist/starters/adapters/cloudflare-pages/README.md +46 -0
- package/dist/starters/adapters/cloudflare-pages/adapters/cloudflare-pages/vite.config.mts +15 -0
- package/dist/starters/adapters/cloudflare-pages/gitignore +2 -0
- package/dist/starters/adapters/cloudflare-pages/package.json +28 -0
- package/dist/starters/adapters/cloudflare-pages/public/_headers +9 -0
- package/dist/starters/adapters/cloudflare-pages/public/_redirects +1 -0
- package/dist/starters/adapters/cloudflare-pages/src/entry.cloudflare-pages.tsx +24 -0
- package/dist/starters/adapters/deno/README.md +9 -0
- package/dist/starters/adapters/deno/adapters/deno/vite.config.mts +23 -0
- package/dist/starters/adapters/deno/package.json +24 -0
- package/dist/starters/adapters/deno/src/entry.deno.ts +45 -0
- package/dist/starters/adapters/express/README.md +9 -0
- package/dist/starters/adapters/express/adapters/express/vite.config.mts +15 -0
- package/dist/starters/adapters/express/package.json +33 -0
- package/dist/starters/adapters/express/src/entry.express.tsx +70 -0
- package/dist/starters/adapters/fastify/README.md +9 -0
- package/dist/starters/adapters/fastify/adapters/fastify/vite.config.mts +15 -0
- package/dist/starters/adapters/fastify/package.json +33 -0
- package/dist/starters/adapters/fastify/src/entry.fastify.tsx +48 -0
- package/dist/starters/adapters/fastify/src/plugins/fastify-qwik.ts +42 -0
- package/dist/starters/adapters/firebase/.eslintignore +1 -0
- package/dist/starters/adapters/firebase/.prettierignore +1 -0
- package/dist/starters/adapters/firebase/adapters/firebase/vite.config.mts +21 -0
- package/dist/starters/adapters/firebase/firebase.json +24 -0
- package/dist/starters/adapters/firebase/functions/.gitkeep +0 -0
- package/dist/starters/adapters/firebase/functions/index.js +5 -0
- package/dist/starters/adapters/firebase/functions/package.json +25 -0
- package/dist/starters/adapters/firebase/gitignore +3 -0
- package/dist/starters/adapters/firebase/package.json +24 -0
- package/dist/starters/adapters/firebase/src/entry-firebase.tsx +22 -0
- package/dist/starters/adapters/netlify-edge/README.md +64 -0
- package/dist/starters/adapters/netlify-edge/adapters/netlify-edge/vite.config.mts +16 -0
- package/dist/starters/adapters/netlify-edge/gitignore +2 -0
- package/dist/starters/adapters/netlify-edge/netlify.toml +3 -0
- package/dist/starters/adapters/netlify-edge/package.json +29 -0
- package/dist/starters/adapters/netlify-edge/public/_headers +2 -0
- package/dist/starters/adapters/netlify-edge/src/entry.netlify-edge.tsx +22 -0
- package/dist/starters/adapters/node-server/README.md +12 -0
- package/dist/starters/adapters/node-server/adapters/node-server/vite.config.mts +15 -0
- package/dist/starters/adapters/node-server/package.json +23 -0
- package/dist/starters/adapters/node-server/src/entry.node-server.tsx +39 -0
- package/dist/starters/adapters/static/README.md +5 -0
- package/dist/starters/adapters/static/adapters/static/vite.config.mts +19 -0
- package/dist/starters/adapters/static/package.json +19 -0
- package/dist/starters/adapters/vercel-edge/README.md +43 -0
- package/dist/starters/adapters/vercel-edge/adapters/vercel-edge/vite.config.mts +16 -0
- package/dist/starters/adapters/vercel-edge/gitignore +2 -0
- package/dist/starters/adapters/vercel-edge/package.json +28 -0
- package/dist/starters/adapters/vercel-edge/src/entry.vercel-edge.tsx +22 -0
- package/dist/starters/adapters/vercel-edge/vercel.json +22 -0
- package/dist/starters/features/auth/package.json +20 -0
- package/dist/starters/features/auth/src/routes/plugin@auth.ts +8 -0
- package/dist/starters/features/bootstrap/package.json +33 -0
- package/dist/starters/features/bootstrap/src/components/bootstrap/alert.tsx +8 -0
- package/dist/starters/features/bootstrap/src/components/bootstrap/button.tsx +8 -0
- package/dist/starters/features/bootstrap/src/components/bootstrap/index.ts +4 -0
- package/dist/starters/features/bootstrap/src/components/bootstrap/navbar.tsx +44 -0
- package/dist/starters/features/bootstrap/src/components/bootstrap/spinner.tsx +13 -0
- package/dist/starters/features/bootstrap/src/constants/data.ts +10 -0
- package/dist/starters/features/bootstrap/src/models/bootstrap.ts +8 -0
- package/dist/starters/features/bootstrap/src/routes/bootstrap/alerts/index.tsx +28 -0
- package/dist/starters/features/bootstrap/src/routes/bootstrap/buttons/index.tsx +32 -0
- package/dist/starters/features/bootstrap/src/routes/bootstrap/index.tsx +32 -0
- package/dist/starters/features/bootstrap/src/routes/bootstrap/layout.tsx +36 -0
- package/dist/starters/features/bootstrap/src/routes/bootstrap/spinners/index.tsx +45 -0
- package/dist/starters/features/builder.io/README.md +15 -0
- package/dist/starters/features/builder.io/package.json +27 -0
- package/dist/starters/features/builder.io/src/components/builder-registry.ts +25 -0
- package/dist/starters/features/builder.io/src/components/counter/counter.module.css +23 -0
- package/dist/starters/features/builder.io/src/components/counter/counter.tsx +81 -0
- package/dist/starters/features/builder.io/src/components/gauge/gauge.module.css +27 -0
- package/dist/starters/features/builder.io/src/components/gauge/index.tsx +38 -0
- package/dist/starters/features/builder.io/src/routes/[...index]/index.tsx +44 -0
- package/dist/starters/features/cypress/cypress/fixtures/example.json +5 -0
- package/dist/starters/features/cypress/cypress/support/commands.ts +37 -0
- package/dist/starters/features/cypress/cypress/support/component-index.html +12 -0
- package/dist/starters/features/cypress/cypress/support/component.ts +42 -0
- package/dist/starters/features/cypress/cypress/tsconfig.cy.json +17 -0
- package/dist/starters/features/cypress/cypress.config.ts +10 -0
- package/dist/starters/features/cypress/cypress.d.ts +14 -0
- package/dist/starters/features/cypress/package.json +28 -0
- package/dist/starters/features/cypress/src/components/example/example.cy.tsx +18 -0
- package/dist/starters/features/cypress/src/components/example/example.tsx +17 -0
- package/dist/starters/features/drizzle/drizzle/db/.gitkeep +0 -0
- package/dist/starters/features/drizzle/drizzle/migrations/.gitkeep +0 -0
- package/dist/starters/features/drizzle/drizzle/schema.ts +24 -0
- package/dist/starters/features/drizzle/drizzle.config.ts +9 -0
- package/dist/starters/features/drizzle/package.json +41 -0
- package/dist/starters/features/drizzle/src/routes/create/index.tsx +42 -0
- package/dist/starters/features/drizzle/src/routes/users/[userId]/index.tsx +36 -0
- package/dist/starters/features/drizzle/src/routes/users/index.tsx +30 -0
- package/dist/starters/features/leaflet-map/package.json +30 -0
- package/dist/starters/features/leaflet-map/src/components/leaflet-map/index.tsx +60 -0
- package/dist/starters/features/leaflet-map/src/helpers/boundary-box.tsx +6 -0
- package/dist/starters/features/leaflet-map/src/models/location.ts +9 -0
- package/dist/starters/features/leaflet-map/src/models/map.ts +7 -0
- package/dist/starters/features/leaflet-map/src/routes/basic-map/index.tsx +25 -0
- package/dist/starters/features/localize/package.json +37 -0
- package/dist/starters/features/localize/src/entry.ssr.tsx +32 -0
- package/dist/starters/features/localize/src/locales/message.en.json +8 -0
- package/dist/starters/features/localize/src/locales/message.it.json +8 -0
- package/dist/starters/features/localize/src/routes/[locale]/i18n-utils.ts +94 -0
- package/dist/starters/features/localize/src/routes/[locale]/index.tsx +52 -0
- package/dist/starters/features/localize/src/routes/[locale]/layout.tsx +12 -0
- package/dist/starters/features/orama/package.json +23 -0
- package/dist/starters/features/orama/src/orama/index.ts +41 -0
- package/dist/starters/features/orama/src/routes/orama/index.tsx +110 -0
- package/dist/starters/features/pandacss/.eslintignore +3 -0
- package/dist/starters/features/pandacss/.prettierignore +2 -0
- package/dist/starters/features/pandacss/gitignore +2 -0
- package/dist/starters/features/pandacss/package.json +31 -0
- package/dist/starters/features/pandacss/panda.config.ts +22 -0
- package/dist/starters/features/pandacss/postcss.config.js +5 -0
- package/dist/starters/features/pandacss/src/global.css +5 -0
- package/dist/starters/features/pandacss/src/routes/pandacss/index.tsx +18 -0
- package/dist/starters/features/partytown/package.json +41 -0
- package/dist/starters/features/partytown/src/components/partytown/partytown.tsx +19 -0
- package/dist/starters/features/playwright/package.json +18 -0
- package/dist/starters/features/playwright/playwright-report/index.html +22024 -0
- package/dist/starters/features/playwright/playwright.config.ts +40 -0
- package/dist/starters/features/playwright/tests/example.spec.ts +14 -0
- package/dist/starters/features/postcss/.vscode/settings.json +3 -0
- package/dist/starters/features/postcss/package.json +17 -0
- package/dist/starters/features/postcss/postcss.config.js +11 -0
- package/dist/starters/features/prisma/package.json +35 -0
- package/dist/starters/features/prisma/prisma/schema.prisma +17 -0
- package/dist/starters/features/prisma/src/routes/create/index.tsx +42 -0
- package/dist/starters/features/prisma/src/routes/users/[userId]/index.tsx +31 -0
- package/dist/starters/features/prisma/src/routes/users/index.tsx +27 -0
- package/dist/starters/features/react/package.json +41 -0
- package/dist/starters/features/react/src/integrations/react/mui.tsx +60 -0
- package/dist/starters/features/react/src/routes/react/index.tsx +45 -0
- package/dist/starters/features/storybook/.storybook/main.ts +22 -0
- package/dist/starters/features/storybook/.storybook/preview-head.html +3 -0
- package/dist/starters/features/storybook/.storybook/preview.tsx +19 -0
- package/dist/starters/features/storybook/.storybook/tsconfig.json +24 -0
- package/dist/starters/features/storybook/package.json +25 -0
- package/dist/starters/features/storybook/src/components/button/button.stories.tsx +17 -0
- package/dist/starters/features/storybook/src/components/button/button.tsx +27 -0
- package/dist/starters/features/styled-vanilla-extract/package.json +28 -0
- package/dist/starters/features/styled-vanilla-extract/src/routes/styled-flower/flower.css.ts +83 -0
- package/dist/starters/features/styled-vanilla-extract/src/routes/styled-flower/index.tsx +75 -0
- package/dist/starters/features/tailwind/.prettierrc.js +3 -0
- package/dist/starters/features/tailwind/.vscode/settings.json +3 -0
- package/dist/starters/features/tailwind/package.json +18 -0
- package/dist/starters/features/tailwind/postcss.config.cjs +6 -0
- package/dist/starters/features/tailwind/src/global.css +7 -0
- package/dist/starters/features/tailwind/tailwind.config.js +8 -0
- package/dist/starters/features/turso/.env.local +2 -0
- package/dist/starters/features/turso/package.json +30 -0
- package/dist/starters/features/turso/src/utils/turso.ts +21 -0
- package/dist/starters/features/vitest/package.json +20 -0
- package/dist/starters/features/vitest/src/components/example/example.spec.tsx +32 -0
- package/dist/starters/features/vitest/src/components/example/example.tsx +17 -0
- package/dist/templates/barrel/component/index.tsx.template +13 -0
- package/dist/templates/barrel/markdown/index.md.template +5 -0
- package/dist/templates/barrel/mdx/index.mdx.template +5 -0
- package/dist/templates/barrel/route/index.tsx.template +9 -0
- package/dist/templates/qwik/component/[slug].tsx.template +13 -0
- package/dist/templates/qwik/markdown/index.md.template +5 -0
- package/dist/templates/qwik/mdx/index.mdx.template +5 -0
- package/dist/templates/qwik/route/index.tsx.template +9 -0
- package/dist/testing/index.cjs +32425 -0
- package/dist/testing/index.d.ts +140 -0
- package/dist/testing/index.mjs +32389 -0
- package/dist/testing/package.json +9 -0
- package/jsx-dev-runtime.d.ts +2 -0
- package/jsx-runtime.d.ts +2 -0
- package/loader.d.ts +2 -0
- package/optimizer.d.ts +2 -0
- package/package.json +20 -12
- package/public.d.ts +68 -0
- package/qwik-cli.cjs +4 -0
- package/server.d.ts +15 -0
- package/testing.d.ts +2 -0
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
/// <reference path="./server-modules.d.ts" />
|
|
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 { }
|