@qwik.dev/router 2.0.0-alpha.9 → 2.0.0-beta.2

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 (49) hide show
  1. package/README.md +1 -1
  2. package/lib/adapters/azure-swa/vite/index.cjs +3 -3
  3. package/lib/adapters/azure-swa/vite/index.d.ts +13 -13
  4. package/lib/adapters/bun-server/vite/index.cjs +3 -3
  5. package/lib/adapters/bun-server/vite/index.d.ts +14 -14
  6. package/lib/adapters/cloud-run/vite/index.cjs +3 -3
  7. package/lib/adapters/cloud-run/vite/index.d.ts +13 -13
  8. package/lib/adapters/cloudflare-pages/vite/index.cjs +3 -3
  9. package/lib/adapters/cloudflare-pages/vite/index.d.ts +27 -27
  10. package/lib/adapters/deno-server/vite/index.cjs +3 -3
  11. package/lib/adapters/deno-server/vite/index.d.ts +14 -14
  12. package/lib/adapters/netlify-edge/vite/index.cjs +3 -3
  13. package/lib/adapters/netlify-edge/vite/index.d.ts +44 -44
  14. package/lib/adapters/node-server/vite/index.cjs +3 -3
  15. package/lib/adapters/node-server/vite/index.d.ts +14 -14
  16. package/lib/adapters/shared/vite/index.cjs +10 -3
  17. package/lib/adapters/shared/vite/index.d.ts +114 -114
  18. package/lib/adapters/shared/vite/index.mjs +7 -0
  19. package/lib/adapters/static/vite/index.cjs +10 -3
  20. package/lib/adapters/static/vite/index.d.ts +10 -10
  21. package/lib/adapters/static/vite/index.mjs +7 -0
  22. package/lib/adapters/vercel-edge/vite/index.cjs +3 -3
  23. package/lib/adapters/vercel-edge/vite/index.d.ts +45 -45
  24. package/lib/index.d.ts +878 -810
  25. package/lib/index.qwik.cjs +110 -48
  26. package/lib/index.qwik.mjs +112 -50
  27. package/lib/middleware/aws-lambda/index.d.ts +48 -48
  28. package/lib/middleware/azure-swa/index.d.ts +28 -28
  29. package/lib/middleware/bun/index.d.ts +35 -35
  30. package/lib/middleware/cloudflare-pages/index.d.ts +35 -35
  31. package/lib/middleware/deno/index.d.ts +47 -47
  32. package/lib/middleware/firebase/index.d.ts +26 -26
  33. package/lib/middleware/netlify-edge/index.d.ts +27 -27
  34. package/lib/middleware/node/index.cjs +3 -3
  35. package/lib/middleware/node/index.d.ts +64 -64
  36. package/lib/middleware/request-handler/index.cjs +142 -73
  37. package/lib/middleware/request-handler/index.d.ts +710 -676
  38. package/lib/middleware/request-handler/index.mjs +138 -70
  39. package/lib/middleware/vercel-edge/index.d.ts +26 -26
  40. package/lib/service-worker.cjs +13 -263
  41. package/lib/service-worker.d.ts +15 -4
  42. package/lib/service-worker.mjs +13 -263
  43. package/lib/static/index.cjs +3 -3
  44. package/lib/static/index.d.ts +96 -96
  45. package/lib/static/node.cjs +3 -3
  46. package/lib/vite/index.cjs +209 -261
  47. package/lib/vite/index.d.ts +154 -154
  48. package/lib/vite/index.mjs +207 -259
  49. package/package.json +7 -7
package/README.md CHANGED
@@ -10,6 +10,6 @@ The router for [Qwik](https://qwik.dev/).
10
10
  ## Related
11
11
 
12
12
  - [Qwik](https://qwik.dev/): An open-source framework designed for best possible time to interactive, by focusing on resumability of server-side-rendering of HTML, and fine-grained lazy-loading of code.
13
- - [Partytown](https://partytown.builder.io/): Relocate resource intensive third-party scripts off of the main thread and into a web worker 🎉.
13
+ - [Partytown](https://partytown.qwik.dev/): Relocate resource intensive third-party scripts off of the main thread and into a web worker 🎉.
14
14
  - [Mitosis](https://github.com/BuilderIO/mitosis): Write components once, run everywhere. Compiles to Vue, React, Solid, Angular, Svelte, and more.
15
15
  - [Builder](https://github.com/BuilderIO/builder): Drag and drop page builder and CMS for React, Vue, Angular, and more.
@@ -28,11 +28,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
 
30
30
  // packages/qwik-router/src/adapters/azure-swa/vite/index.ts
31
- var vite_exports = {};
32
- __export(vite_exports, {
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
33
  azureSwaAdapter: () => azureSwaAdapter
34
34
  });
35
- module.exports = __toCommonJS(vite_exports);
35
+ module.exports = __toCommonJS(index_exports);
36
36
  var import_node_fs = __toESM(require("node:fs"), 1);
37
37
  var import_node_path = require("node:path");
38
38
  var import_vite = require("../../shared/vite/index.cjs");
@@ -1,13 +1,13 @@
1
- import { ServerAdapterOptions } from '../../shared/vite';
2
- import type { StaticGenerateRenderOptions } from '@qwik.dev/router/static';
3
-
4
- /** @public */
5
- export declare function azureSwaAdapter(opts?: AzureSwaAdapterOptions): any;
6
-
7
- /** @public */
8
- export declare interface AzureSwaAdapterOptions extends ServerAdapterOptions {
9
- }
10
-
11
- export { StaticGenerateRenderOptions }
12
-
13
- export { }
1
+ import { ServerAdapterOptions } from '../../shared/vite';
2
+ import type { StaticGenerateRenderOptions } from '@qwik.dev/router/static';
3
+
4
+ /** @public */
5
+ export declare function azureSwaAdapter(opts?: AzureSwaAdapterOptions): any;
6
+
7
+ /** @public */
8
+ export declare interface AzureSwaAdapterOptions extends ServerAdapterOptions {
9
+ }
10
+
11
+ export { StaticGenerateRenderOptions }
12
+
13
+ export { }
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
20
  // packages/qwik-router/src/adapters/bun-server/vite/index.ts
21
- var vite_exports = {};
22
- __export(vite_exports, {
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
23
  bunServerAdapter: () => bunServerAdapter
24
24
  });
25
- module.exports = __toCommonJS(vite_exports);
25
+ module.exports = __toCommonJS(index_exports);
26
26
  var import_vite = require("../../shared/vite/index.cjs");
27
27
  function bunServerAdapter(opts = {}) {
28
28
  const env = process == null ? void 0 : process.env;
@@ -1,14 +1,14 @@
1
- import { ServerAdapterOptions } from '../../shared/vite';
2
- import type { StaticGenerateRenderOptions } from '@qwik.dev/router/static';
3
-
4
- /** @beta */
5
- export declare function bunServerAdapter(opts?: bunServerAdapterOptions): any;
6
-
7
- /** @beta */
8
- export declare interface bunServerAdapterOptions extends ServerAdapterOptions {
9
- name?: string;
10
- }
11
-
12
- export { StaticGenerateRenderOptions }
13
-
14
- export { }
1
+ import { ServerAdapterOptions } from '../../shared/vite';
2
+ import type { StaticGenerateRenderOptions } from '@qwik.dev/router/static';
3
+
4
+ /** @beta */
5
+ export declare function bunServerAdapter(opts?: bunServerAdapterOptions): any;
6
+
7
+ /** @beta */
8
+ export declare interface bunServerAdapterOptions extends ServerAdapterOptions {
9
+ name?: string;
10
+ }
11
+
12
+ export { StaticGenerateRenderOptions }
13
+
14
+ export { }
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
20
  // packages/qwik-router/src/adapters/cloud-run/vite/index.ts
21
- var vite_exports = {};
22
- __export(vite_exports, {
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
23
  cloudRunAdapter: () => cloudRunAdapter
24
24
  });
25
- module.exports = __toCommonJS(vite_exports);
25
+ module.exports = __toCommonJS(index_exports);
26
26
  var import_vite = require("../../shared/vite/index.cjs");
27
27
  function cloudRunAdapter(opts = {}) {
28
28
  const env = process == null ? void 0 : process.env;
@@ -1,13 +1,13 @@
1
- import { ServerAdapterOptions } from '../../shared/vite';
2
- import type { StaticGenerateRenderOptions } from '@qwik.dev/router/static';
3
-
4
- /** @public */
5
- export declare function cloudRunAdapter(opts?: CloudRunAdapterOptions): any;
6
-
7
- /** @public */
8
- export declare interface CloudRunAdapterOptions extends ServerAdapterOptions {
9
- }
10
-
11
- export { StaticGenerateRenderOptions }
12
-
13
- export { }
1
+ import { ServerAdapterOptions } from '../../shared/vite';
2
+ import type { StaticGenerateRenderOptions } from '@qwik.dev/router/static';
3
+
4
+ /** @public */
5
+ export declare function cloudRunAdapter(opts?: CloudRunAdapterOptions): any;
6
+
7
+ /** @public */
8
+ export declare interface CloudRunAdapterOptions extends ServerAdapterOptions {
9
+ }
10
+
11
+ export { StaticGenerateRenderOptions }
12
+
13
+ export { }
@@ -28,11 +28,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
 
30
30
  // packages/qwik-router/src/adapters/cloudflare-pages/vite/index.ts
31
- var vite_exports = {};
32
- __export(vite_exports, {
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
33
  cloudflarePagesAdapter: () => cloudflarePagesAdapter
34
34
  });
35
- module.exports = __toCommonJS(vite_exports);
35
+ module.exports = __toCommonJS(index_exports);
36
36
  var import_node_fs = __toESM(require("node:fs"), 1);
37
37
  var import_node_path = require("node:path");
38
38
 
@@ -1,27 +1,27 @@
1
- import { ServerAdapterOptions } from '../../shared/vite';
2
- import type { StaticGenerateRenderOptions } from '@qwik.dev/router/static';
3
-
4
- /** @public */
5
- export declare function cloudflarePagesAdapter(opts?: CloudflarePagesAdapterOptions): any;
6
-
7
- /** @public */
8
- export declare interface CloudflarePagesAdapterOptions extends ServerAdapterOptions {
9
- /**
10
- * Determines if the build should generate the function invocation routes `_routes.json` file.
11
- *
12
- * https://developers.cloudflare.com/pages/platform/functions/routing/#functions-invocation-routes
13
- *
14
- * Defaults to `true`.
15
- */
16
- functionRoutes?: boolean;
17
- /**
18
- * Manually add pathnames that should be treated as static paths and not SSR. For example, when
19
- * these pathnames are requested, their response should come from a static file, rather than a
20
- * server-side rendered response.
21
- */
22
- staticPaths?: string[];
23
- }
24
-
25
- export { StaticGenerateRenderOptions }
26
-
27
- export { }
1
+ import { ServerAdapterOptions } from '../../shared/vite';
2
+ import type { StaticGenerateRenderOptions } from '@qwik.dev/router/static';
3
+
4
+ /** @public */
5
+ export declare function cloudflarePagesAdapter(opts?: CloudflarePagesAdapterOptions): any;
6
+
7
+ /** @public */
8
+ export declare interface CloudflarePagesAdapterOptions extends ServerAdapterOptions {
9
+ /**
10
+ * Determines if the build should generate the function invocation routes `_routes.json` file.
11
+ *
12
+ * https://developers.cloudflare.com/pages/platform/functions/routing/#functions-invocation-routes
13
+ *
14
+ * Defaults to `true`.
15
+ */
16
+ functionRoutes?: boolean;
17
+ /**
18
+ * Manually add pathnames that should be treated as static paths and not SSR. For example, when
19
+ * these pathnames are requested, their response should come from a static file, rather than a
20
+ * server-side rendered response.
21
+ */
22
+ staticPaths?: string[];
23
+ }
24
+
25
+ export { StaticGenerateRenderOptions }
26
+
27
+ export { }
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
20
  // packages/qwik-router/src/adapters/deno-server/vite/index.ts
21
- var vite_exports = {};
22
- __export(vite_exports, {
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
23
  denoServerAdapter: () => denoServerAdapter
24
24
  });
25
- module.exports = __toCommonJS(vite_exports);
25
+ module.exports = __toCommonJS(index_exports);
26
26
  var import_vite = require("../../shared/vite/index.cjs");
27
27
  function denoServerAdapter(opts = {}) {
28
28
  const env = process == null ? void 0 : process.env;
@@ -1,14 +1,14 @@
1
- import { ServerAdapterOptions } from '../../shared/vite';
2
- import type { StaticGenerateRenderOptions } from '@qwik.dev/router/static';
3
-
4
- /** @beta */
5
- export declare function denoServerAdapter(opts?: DenoServerAdapterOptions): any;
6
-
7
- /** @beta */
8
- export declare interface DenoServerAdapterOptions extends ServerAdapterOptions {
9
- name?: string;
10
- }
11
-
12
- export { StaticGenerateRenderOptions }
13
-
14
- export { }
1
+ import { ServerAdapterOptions } from '../../shared/vite';
2
+ import type { StaticGenerateRenderOptions } from '@qwik.dev/router/static';
3
+
4
+ /** @beta */
5
+ export declare function denoServerAdapter(opts?: DenoServerAdapterOptions): any;
6
+
7
+ /** @beta */
8
+ export declare interface DenoServerAdapterOptions extends ServerAdapterOptions {
9
+ name?: string;
10
+ }
11
+
12
+ export { StaticGenerateRenderOptions }
13
+
14
+ export { }
@@ -28,11 +28,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
 
30
30
  // packages/qwik-router/src/adapters/netlify-edge/vite/index.ts
31
- var vite_exports = {};
32
- __export(vite_exports, {
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
33
  netlifyEdgeAdapter: () => netlifyEdgeAdapter
34
34
  });
35
- module.exports = __toCommonJS(vite_exports);
35
+ module.exports = __toCommonJS(index_exports);
36
36
 
37
37
  // packages/qwik-router/src/runtime/src/qwik-router-config.ts
38
38
  var basePathname = "/";
@@ -1,44 +1,44 @@
1
- import { ServerAdapterOptions } from '../../shared/vite';
2
- import type { StaticGenerateRenderOptions } from '@qwik.dev/router/static';
3
-
4
- /** @public */
5
- export declare function netlifyEdgeAdapter(opts?: NetlifyEdgeAdapterOptions): any;
6
-
7
- /** @public */
8
- export declare interface NetlifyEdgeAdapterOptions extends ServerAdapterOptions {
9
- /**
10
- * Determines if the build should generate the edge functions declarations `manifest.json` file.
11
- *
12
- * https://docs.netlify.com/edge-functions/declarations/
13
- *
14
- * Defaults to `true`.
15
- */
16
- functionRoutes?: boolean;
17
- /**
18
- * Manually add pathnames that should be treated as static paths and not SSR. For example, when
19
- * these pathnames are requested, their response should come from a static file, rather than a
20
- * server-side rendered response.
21
- */
22
- staticPaths?: string[];
23
- /**
24
- * Manually add path pattern that should be excluded from the edge function routes that are
25
- * created by the 'manifest.json' file.
26
- *
27
- * If not specified, the following paths are excluded by default:
28
- *
29
- * - /build/*
30
- * - /favicon.ico
31
- * - /robots.txt
32
- * - /mainifest.json
33
- * - /~partytown/*
34
- * - /service-worker.js
35
- * - /sitemap.xml
36
- *
37
- * https://docs.netlify.com/edge-functions/declarations/#declare-edge-functions-in-netlify-toml
38
- */
39
- excludedPath?: string | string[];
40
- }
41
-
42
- export { StaticGenerateRenderOptions }
43
-
44
- export { }
1
+ import { ServerAdapterOptions } from '../../shared/vite';
2
+ import type { StaticGenerateRenderOptions } from '@qwik.dev/router/static';
3
+
4
+ /** @public */
5
+ export declare function netlifyEdgeAdapter(opts?: NetlifyEdgeAdapterOptions): any;
6
+
7
+ /** @public */
8
+ export declare interface NetlifyEdgeAdapterOptions extends ServerAdapterOptions {
9
+ /**
10
+ * Determines if the build should generate the edge functions declarations `manifest.json` file.
11
+ *
12
+ * https://docs.netlify.com/edge-functions/declarations/
13
+ *
14
+ * Defaults to `true`.
15
+ */
16
+ functionRoutes?: boolean;
17
+ /**
18
+ * Manually add pathnames that should be treated as static paths and not SSR. For example, when
19
+ * these pathnames are requested, their response should come from a static file, rather than a
20
+ * server-side rendered response.
21
+ */
22
+ staticPaths?: string[];
23
+ /**
24
+ * Manually add path pattern that should be excluded from the edge function routes that are
25
+ * created by the 'manifest.json' file.
26
+ *
27
+ * If not specified, the following paths are excluded by default:
28
+ *
29
+ * - /build/*
30
+ * - /favicon.ico
31
+ * - /robots.txt
32
+ * - /mainifest.json
33
+ * - /~partytown/*
34
+ * - /service-worker.js
35
+ * - /sitemap.xml
36
+ *
37
+ * https://docs.netlify.com/edge-functions/declarations/#declare-edge-functions-in-netlify-toml
38
+ */
39
+ excludedPath?: string | string[];
40
+ }
41
+
42
+ export { StaticGenerateRenderOptions }
43
+
44
+ export { }
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
20
  // packages/qwik-router/src/adapters/node-server/vite/index.ts
21
- var vite_exports = {};
22
- __export(vite_exports, {
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
23
  nodeServerAdapter: () => nodeServerAdapter
24
24
  });
25
- module.exports = __toCommonJS(vite_exports);
25
+ module.exports = __toCommonJS(index_exports);
26
26
  var import_vite = require("../../shared/vite/index.cjs");
27
27
  function nodeServerAdapter(opts = {}) {
28
28
  const env = process == null ? void 0 : process.env;
@@ -1,14 +1,14 @@
1
- import { ServerAdapterOptions } from '../../shared/vite';
2
- import type { StaticGenerateRenderOptions } from '@qwik.dev/router/static';
3
-
4
- /** @beta */
5
- export declare function nodeServerAdapter(opts?: NodeServerAdapterOptions): any;
6
-
7
- /** @beta */
8
- export declare interface NodeServerAdapterOptions extends ServerAdapterOptions {
9
- name?: string;
10
- }
11
-
12
- export { StaticGenerateRenderOptions }
13
-
14
- export { }
1
+ import { ServerAdapterOptions } from '../../shared/vite';
2
+ import type { StaticGenerateRenderOptions } from '@qwik.dev/router/static';
3
+
4
+ /** @beta */
5
+ export declare function nodeServerAdapter(opts?: NodeServerAdapterOptions): any;
6
+
7
+ /** @beta */
8
+ export declare interface NodeServerAdapterOptions extends ServerAdapterOptions {
9
+ name?: string;
10
+ }
11
+
12
+ export { StaticGenerateRenderOptions }
13
+
14
+ export { }
@@ -28,8 +28,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
 
30
30
  // packages/qwik-router/src/adapters/shared/vite/index.ts
31
- var vite_exports = {};
32
- __export(vite_exports, {
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
33
  NOT_FOUND_PATHS_ID: () => NOT_FOUND_PATHS_ID,
34
34
  RESOLVED_NOT_FOUND_PATHS_ID: () => RESOLVED_NOT_FOUND_PATHS_ID,
35
35
  RESOLVED_STATIC_PATHS_ID: () => RESOLVED_STATIC_PATHS_ID,
@@ -37,7 +37,7 @@ __export(vite_exports, {
37
37
  getParentDir: () => getParentDir,
38
38
  viteAdapter: () => viteAdapter
39
39
  });
40
- module.exports = __toCommonJS(vite_exports);
40
+ module.exports = __toCommonJS(index_exports);
41
41
  var import_node_fs2 = __toESM(require("node:fs"), 1);
42
42
  var import_node_path2 = require("node:path");
43
43
 
@@ -335,6 +335,13 @@ function viteAdapter(opts) {
335
335
  error: (message) => this.error(message)
336
336
  });
337
337
  }
338
+ this.warn(
339
+ `
340
+ ==============================================
341
+ Note: Make sure that you are serving the built files with proper cache headers.
342
+ See https://qwik.dev/docs/deployments/#cache-headers for more information.
343
+ ==============================================`
344
+ );
338
345
  }
339
346
  }
340
347
  }