@qwik.dev/router 2.0.0-beta.5 → 2.0.0-beta.7
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/adapters/static/vite.d.ts +1 -1
- package/lib/adapters/azure-swa/vite/index.d.ts +2 -2
- package/lib/adapters/bun-server/vite/index.d.ts +2 -2
- package/lib/adapters/cloud-run/vite/index.d.ts +2 -2
- package/lib/adapters/cloudflare-pages/vite/index.d.ts +2 -2
- package/lib/adapters/deno-server/vite/index.d.ts +2 -2
- package/lib/adapters/netlify-edge/vite/index.cjs +1 -0
- package/lib/adapters/netlify-edge/vite/index.d.ts +2 -2
- package/lib/adapters/netlify-edge/vite/index.mjs +1 -0
- package/lib/adapters/node-server/vite/index.d.ts +2 -2
- package/lib/adapters/shared/vite/index.cjs +88 -128
- package/lib/adapters/shared/vite/index.d.ts +9 -15
- package/lib/adapters/shared/vite/index.mjs +88 -124
- package/lib/adapters/{static → ssg}/vite/index.cjs +95 -124
- package/lib/adapters/ssg/vite/index.d.ts +13 -0
- package/lib/adapters/{static → ssg}/vite/index.mjs +93 -123
- package/lib/adapters/vercel-edge/vite/index.d.ts +2 -2
- package/lib/index.d.ts +161 -48
- package/lib/index.qwik.cjs +86 -23
- package/lib/index.qwik.mjs +88 -25
- package/lib/middleware/aws-lambda/index.d.ts +3 -2
- package/lib/middleware/aws-lambda/index.mjs +2 -4
- package/lib/middleware/azure-swa/index.mjs +6 -6
- package/lib/middleware/bun/index.mjs +4 -6
- package/lib/middleware/cloudflare-pages/index.mjs +4 -6
- package/lib/middleware/deno/index.mjs +8 -7
- package/lib/middleware/firebase/index.mjs +1 -3
- package/lib/middleware/netlify-edge/index.mjs +7 -6
- package/lib/middleware/node/index.cjs +4 -8
- package/lib/middleware/node/index.mjs +7 -7
- package/lib/middleware/request-handler/index.cjs +331 -268
- package/lib/middleware/request-handler/index.d.ts +56 -49
- package/lib/middleware/request-handler/index.mjs +335 -264
- package/lib/middleware/vercel-edge/index.mjs +7 -6
- package/lib/modules.d.ts +4 -12
- package/lib/{static → ssg}/deno.mjs +1 -1
- package/lib/{static → ssg}/index.cjs +1 -1
- package/lib/{static → ssg}/index.d.ts +17 -17
- package/lib/{static → ssg}/index.mjs +1 -1
- package/lib/{static → ssg}/node.cjs +16 -16
- package/lib/{static → ssg}/node.mjs +15 -15
- package/lib/vite/index.cjs +10260 -10437
- package/lib/vite/index.mjs +8220 -8387
- package/modules.d.ts +4 -12
- package/package.json +19 -8
- package/ssg.d.ts +2 -0
- package/static.d.ts +1 -1
- package/lib/adapters/static/vite/index.d.ts +0 -10
- package/middleware/request-handler/generated/not-found-paths.ts +0 -7
- package/middleware/request-handler/generated/static-paths.ts +0 -35
|
@@ -215,10 +215,7 @@ declare interface DocumentHeadProps extends RouteLocation {
|
|
|
215
215
|
declare interface DocumentHeadValue<FrontMatter extends Record<string, any> = Record<string, unknown>> {
|
|
216
216
|
/** Sets `document.title`. */
|
|
217
217
|
readonly title?: string;
|
|
218
|
-
/**
|
|
219
|
-
* Used to manually set meta tags in the head. Additionally, the `data` property could be used to
|
|
220
|
-
* set arbitrary data which the `<head>` component could later use to generate `<meta>` tags.
|
|
221
|
-
*/
|
|
218
|
+
/** Used to manually set meta tags in the head. */
|
|
222
219
|
readonly meta?: readonly DocumentMeta[];
|
|
223
220
|
/** Used to manually append `<link>` elements to the `<head>`. */
|
|
224
221
|
readonly links?: readonly DocumentLink[];
|
|
@@ -235,50 +232,48 @@ declare interface DocumentHeadValue<FrontMatter extends Record<string, any> = Re
|
|
|
235
232
|
}
|
|
236
233
|
|
|
237
234
|
/** @public */
|
|
238
|
-
declare
|
|
239
|
-
as?: string;
|
|
240
|
-
crossorigin?: string;
|
|
241
|
-
disabled?: boolean;
|
|
242
|
-
href?: string;
|
|
243
|
-
hreflang?: string;
|
|
244
|
-
id?: string;
|
|
245
|
-
imagesizes?: string;
|
|
246
|
-
imagesrcset?: string;
|
|
247
|
-
integrity?: string;
|
|
248
|
-
media?: string;
|
|
249
|
-
prefetch?: string;
|
|
250
|
-
referrerpolicy?: string;
|
|
251
|
-
rel?: string;
|
|
252
|
-
sizes?: string;
|
|
253
|
-
title?: string;
|
|
254
|
-
type?: string;
|
|
255
|
-
key?: string;
|
|
256
|
-
}
|
|
235
|
+
declare type DocumentLink = QwikIntrinsicElements['link'];
|
|
257
236
|
|
|
258
237
|
/** @public */
|
|
259
|
-
declare
|
|
260
|
-
readonly content?: string;
|
|
261
|
-
readonly httpEquiv?: string;
|
|
262
|
-
readonly name?: string;
|
|
263
|
-
readonly property?: string;
|
|
264
|
-
readonly key?: string;
|
|
265
|
-
readonly itemprop?: string;
|
|
266
|
-
readonly media?: string;
|
|
267
|
-
}
|
|
238
|
+
declare type DocumentMeta = QwikIntrinsicElements['meta'];
|
|
268
239
|
|
|
269
|
-
/** @
|
|
270
|
-
declare
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
240
|
+
/** @public */
|
|
241
|
+
declare type DocumentScript = ((Omit<QwikIntrinsicElements['script'], 'dangerouslySetInnerHTML'> & {
|
|
242
|
+
props?: never;
|
|
243
|
+
}) | {
|
|
244
|
+
key?: string;
|
|
245
|
+
/**
|
|
246
|
+
* The props of the script element. @deprecated Prefer setting the properties directly instead
|
|
247
|
+
* of using this property.
|
|
248
|
+
*/
|
|
249
|
+
props: Readonly<QwikIntrinsicElements['script']>;
|
|
250
|
+
}) & ({
|
|
251
|
+
/** The inline script content. */
|
|
252
|
+
script?: string;
|
|
253
|
+
dangerouslySetInnerHTML?: never;
|
|
254
|
+
} | {
|
|
255
|
+
dangerouslySetInnerHTML?: string;
|
|
256
|
+
script?: never;
|
|
257
|
+
});
|
|
275
258
|
|
|
276
259
|
/** @public */
|
|
277
|
-
declare
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
260
|
+
declare type DocumentStyle = Readonly<((Omit<QwikIntrinsicElements['style'], 'dangerouslySetInnerHTML'> & {
|
|
261
|
+
props?: never;
|
|
262
|
+
}) | {
|
|
263
|
+
key?: string;
|
|
264
|
+
/**
|
|
265
|
+
* The props of the style element. @deprecated Prefer setting the properties directly
|
|
266
|
+
* instead of using this property.
|
|
267
|
+
*/
|
|
268
|
+
props: Readonly<QwikIntrinsicElements['style']>;
|
|
269
|
+
}) & ({
|
|
270
|
+
/** The inline style content. */
|
|
271
|
+
style?: string;
|
|
272
|
+
dangerouslySetInnerHTML?: never;
|
|
273
|
+
} | {
|
|
274
|
+
dangerouslySetInnerHTML?: string;
|
|
275
|
+
style?: never;
|
|
276
|
+
})>;
|
|
282
277
|
|
|
283
278
|
/** @public */
|
|
284
279
|
export declare interface EnvGetter {
|
|
@@ -290,12 +285,26 @@ declare type ErrorCodes = ClientErrorCode | ServerErrorCode;
|
|
|
290
285
|
/** @public */
|
|
291
286
|
export declare function getErrorHtml(status: number, e: any): string;
|
|
292
287
|
|
|
288
|
+
/**
|
|
289
|
+
* Return the HTML for a 404 page.
|
|
290
|
+
*
|
|
291
|
+
* @internal
|
|
292
|
+
*/
|
|
293
|
+
export declare function getNotFound(prefix: string): string;
|
|
294
|
+
|
|
293
295
|
/**
|
|
294
296
|
* HTTP Informational Status Codes Status codes in the 1xx range indicate that the server has
|
|
295
297
|
* received and is processing the request, but no response is available yet.
|
|
296
298
|
*/
|
|
297
299
|
declare type InformationalCode = 100 | 101 | 102 | 103;
|
|
298
300
|
|
|
301
|
+
/**
|
|
302
|
+
* Decide whether a given request path is a static path, for optimizing file access.
|
|
303
|
+
*
|
|
304
|
+
* @internal
|
|
305
|
+
*/
|
|
306
|
+
export declare function isStaticPath(method: string, url: URL): boolean;
|
|
307
|
+
|
|
299
308
|
declare interface LayoutModule extends RouteModule {
|
|
300
309
|
readonly default: unknown;
|
|
301
310
|
readonly head?: ContentModuleHead;
|
|
@@ -533,7 +542,6 @@ declare interface RequestEventInternal extends RequestEvent, RequestEventLoader
|
|
|
533
542
|
[RequestEvLoaders]: Record<string, ValueOrPromise<unknown> | undefined>;
|
|
534
543
|
[RequestEvLoaderSerializationStrategyMap]: Map<string, SerializationStrategy>;
|
|
535
544
|
[RequestEvMode]: ServerRequestMode;
|
|
536
|
-
[RequestEvTrailingSlash]: boolean;
|
|
537
545
|
[RequestEvRoute]: LoadedRoute | null;
|
|
538
546
|
[RequestEvQwikSerializer]: QwikSerializer;
|
|
539
547
|
/**
|
|
@@ -571,8 +579,6 @@ declare const RequestEvRoute: unique symbol;
|
|
|
571
579
|
/** @internal */
|
|
572
580
|
export declare const RequestEvShareQData = "qData";
|
|
573
581
|
|
|
574
|
-
declare const RequestEvTrailingSlash: unique symbol;
|
|
575
|
-
|
|
576
582
|
/** @public */
|
|
577
583
|
export declare type RequestHandler<PLATFORM = QwikRouterPlatform> = (ev: RequestEvent<PLATFORM>) => Promise<void> | void;
|
|
578
584
|
|
|
@@ -645,20 +651,21 @@ declare type ServerErrorCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 5
|
|
|
645
651
|
/** @public */
|
|
646
652
|
export declare interface ServerRenderOptions extends RenderOptions {
|
|
647
653
|
render: Render;
|
|
648
|
-
/** @deprecated
|
|
654
|
+
/** @deprecated Not used */
|
|
649
655
|
qwikCityPlan?: QwikCityPlan;
|
|
656
|
+
/** @deprecated Not used */
|
|
650
657
|
qwikRouterConfig?: QwikRouterConfig;
|
|
651
658
|
/**
|
|
652
659
|
* Protection against cross-site request forgery (CSRF) attacks.
|
|
653
660
|
*
|
|
654
661
|
* When `true`, for every incoming POST, PUT, PATCH, or DELETE form submissions, the request
|
|
655
|
-
* origin is checked to match the server's origin.
|
|
662
|
+
* origin is checked to match the server's origin. `lax-proto` is for SSL-terminating proxies
|
|
656
663
|
*
|
|
657
664
|
* Be careful when disabling this option as it may lead to CSRF attacks.
|
|
658
665
|
*
|
|
659
666
|
* Defaults to `true`.
|
|
660
667
|
*/
|
|
661
|
-
checkOrigin?: boolean;
|
|
668
|
+
checkOrigin?: boolean | 'lax-proto';
|
|
662
669
|
}
|
|
663
670
|
|
|
664
671
|
/**
|