@qwik.dev/router 2.0.0-beta.37 → 2.0.0-beta.38
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/lib/adapters/cloudflare-pages/vite/index.mjs +2 -2
- package/lib/adapters/shared/vite/index.d.ts +3 -4
- package/lib/adapters/shared/vite/index.mjs +158 -143
- package/lib/chunks/dev-preloaded-route-loader.mjs +3 -0
- package/lib/chunks/fs.mjs +6 -2
- package/lib/chunks/head.qwik.mjs +814 -93
- package/lib/chunks/request-body-limit.mjs +37 -0
- package/lib/chunks/request-path.mjs +2 -2
- package/lib/chunks/routes.mjs +47 -0
- package/lib/chunks/server-error.mjs +19 -0
- package/lib/chunks/system.mjs +2 -1
- package/lib/chunks/use-functions.qwik.mjs +1 -1
- package/lib/chunks/{worker-thread.qwik.mjs → user-response.mjs} +1030 -1746
- package/lib/chunks/worker-thread.mjs +317 -0
- package/lib/index.d.ts +80 -39
- package/lib/index.qwik.mjs +141 -80
- package/lib/middleware/azure-swa/index.mjs +13 -9
- package/lib/middleware/cloudflare-pages/index.mjs +2 -2
- package/lib/middleware/deno/index.d.ts +2 -0
- package/lib/middleware/deno/index.mjs +2 -1
- package/lib/middleware/netlify-edge/index.mjs +2 -2
- package/lib/middleware/node/index.d.ts +9 -1
- package/lib/middleware/node/index.mjs +28 -3
- package/lib/middleware/request-handler/index.d.ts +9 -10
- package/lib/middleware/request-handler/index.mjs +24 -1104
- package/lib/middleware/vercel-edge/index.mjs +2 -2
- package/lib/ssg/index.d.ts +2 -10
- package/lib/ssg/index.mjs +10 -50
- package/lib/vite/index.d.ts +8 -0
- package/lib/vite/index.mjs +404 -115
- package/package.json +4 -3
- package/lib/chunks/action-handler.mjs +0 -782
- package/lib/chunks/deepFreeze.qwik.mjs +0 -608
- package/lib/chunks/error-handler.mjs +0 -57
- package/lib/chunks/not-found-wrapper.qwik.mjs +0 -25
|
@@ -14,6 +14,8 @@ import type { ValueOrPromise } from '@qwik.dev/core';
|
|
|
14
14
|
|
|
15
15
|
/** @public */
|
|
16
16
|
export declare class AbortMessage {
|
|
17
|
+
/** Type-only brand so `Exclude<>` can drop control-flow signals from resolved loader/action data. */
|
|
18
|
+
readonly __controlFlow: true;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
/** @internal */
|
|
@@ -339,6 +341,8 @@ declare type DocumentStyle = Readonly<((Omit<QwikIntrinsicElements['style'], 'da
|
|
|
339
341
|
style?: never;
|
|
340
342
|
})>;
|
|
341
343
|
|
|
344
|
+
declare type EndpointModuleLoader = () => ValueOrPromise<RouteModule>;
|
|
345
|
+
|
|
342
346
|
/** @public */
|
|
343
347
|
export declare interface EnvGetter {
|
|
344
348
|
get(key: string): string | undefined;
|
|
@@ -349,13 +353,6 @@ declare type ErrorCodes = ClientErrorCode | ServerErrorCode;
|
|
|
349
353
|
/** @public */
|
|
350
354
|
export declare function getErrorHtml(status: number, e: any): string;
|
|
351
355
|
|
|
352
|
-
/**
|
|
353
|
-
* Return the HTML for a 404 page.
|
|
354
|
-
*
|
|
355
|
-
* @internal
|
|
356
|
-
*/
|
|
357
|
-
export declare function getNotFound(prefix: string): string;
|
|
358
|
-
|
|
359
356
|
/**
|
|
360
357
|
* HTTP Informational Status Codes Status codes in the 1xx range indicate that the server has
|
|
361
358
|
* received and is processing the request, but no response is available yet.
|
|
@@ -396,8 +393,8 @@ declare interface LoadedRoute {
|
|
|
396
393
|
$routeBundleNames$?: string[] | undefined;
|
|
397
394
|
/** Whether this route is a not-found (404) route */
|
|
398
395
|
$notFound$?: boolean;
|
|
399
|
-
/** The error
|
|
400
|
-
$errorLoader$?:
|
|
396
|
+
/** The nearest _E (error.tsx) boundary's chain to render on a thrown ServerError (in its layouts). */
|
|
397
|
+
$errorLoader$?: ModuleLoader[];
|
|
401
398
|
/** Merged array of routeLoader$ hashes from all matched nodes (layouts + page) */
|
|
402
399
|
$loaders$?: string[];
|
|
403
400
|
/** Runtime-only mapping of routeLoader$ hashes to the matched pathname used for q-loader fetches */
|
|
@@ -407,6 +404,8 @@ declare interface LoadedRoute {
|
|
|
407
404
|
/** @public */
|
|
408
405
|
export declare const mergeHeadersCookies: (headers: Headers, cookies: Cookie) => Headers;
|
|
409
406
|
|
|
407
|
+
declare type ModuleLoader = ContentModuleLoader | EndpointModuleLoader;
|
|
408
|
+
|
|
410
409
|
/** @public */
|
|
411
410
|
declare type PageModule = RouteModule & {
|
|
412
411
|
readonly default: (props: Record<string, never>) => JSXOutput;
|
|
@@ -660,7 +659,7 @@ declare const RequestEvMode: unique symbol;
|
|
|
660
659
|
declare const RequestEvRoute: unique symbol;
|
|
661
660
|
|
|
662
661
|
/** @public */
|
|
663
|
-
export declare type RequestHandler<PLATFORM = QwikRouterPlatform> = (ev: RequestEvent<PLATFORM>) => Promise<void> | void;
|
|
662
|
+
export declare type RequestHandler<PLATFORM = QwikRouterPlatform> = (ev: RequestEvent<PLATFORM>) => Promise<void | AbortMessage | ServerError> | void | AbortMessage | ServerError;
|
|
664
663
|
|
|
665
664
|
/**
|
|
666
665
|
* The request handler for QwikRouter. Called by every adapter.
|