@qwik.dev/core 2.0.0-beta.30 → 2.0.0-beta.32
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/dist/backpatch/package.json +1 -1
- package/dist/build/package.json +1 -1
- package/dist/cli.mjs +215 -170
- package/dist/core-internal.d.ts +147 -29
- package/dist/core.min.mjs +2 -2
- package/dist/core.mjs +11021 -10352
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +6064 -5555
- package/dist/insights/vite/index.mjs +36 -33
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.mjs +790 -766
- package/dist/preloader.mjs +210 -112
- package/dist/qwikloader.debug.js +261 -101
- package/dist/qwikloader.js +1 -1
- package/dist/server.mjs +272 -95
- package/dist/server.prod.mjs +873 -681
- package/dist/starters/adapters/bun/src/entry.bun.ts +2 -8
- package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +2 -4
- package/dist/starters/adapters/deno/src/entry.deno.ts +2 -8
- package/dist/starters/adapters/express/src/entry.express.tsx +1 -4
- package/dist/starters/adapters/fastify/src/plugins/fastify-qwik.ts +1 -2
- package/dist/starters/adapters/node-server/src/entry.node-server.tsx +2 -4
- package/dist/testing/index.d.ts +9 -4
- package/dist/testing/index.mjs +1226 -472
- package/dist/testing/package.json +1 -1
- package/package.json +3 -3
|
@@ -12,7 +12,7 @@ import { createQwikRouter } from "@qwik.dev/router/middleware/bun";
|
|
|
12
12
|
import render from "./entry.ssr";
|
|
13
13
|
|
|
14
14
|
// Create the Qwik Router Bun middleware
|
|
15
|
-
const { router,
|
|
15
|
+
const { router, staticFile } = createQwikRouter({
|
|
16
16
|
render,
|
|
17
17
|
static: {
|
|
18
18
|
cacheControl: "public, max-age=31536000, immutable",
|
|
@@ -33,13 +33,7 @@ Bun.serve({
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
// Server-side render this request with Qwik Router
|
|
36
|
-
|
|
37
|
-
if (qwikRouterResponse) {
|
|
38
|
-
return qwikRouterResponse;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Path not found
|
|
42
|
-
return notFound(request);
|
|
36
|
+
return (await router(request))!;
|
|
43
37
|
},
|
|
44
38
|
port,
|
|
45
39
|
});
|
|
@@ -47,7 +47,7 @@ const DEFAULT_HEADERS = {
|
|
|
47
47
|
"X-XSS-Protection": "0",
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
const { router,
|
|
50
|
+
const { router, staticFile } = createQwikRouter({
|
|
51
51
|
render,
|
|
52
52
|
static: {
|
|
53
53
|
cacheControl: "public, max-age=31536000, immutable",
|
|
@@ -83,9 +83,7 @@ server.on("request", (req, res) => {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
staticFile(req, res, () => {
|
|
86
|
-
router(req, res, () => {
|
|
87
|
-
notFound(req, res, () => {});
|
|
88
|
-
});
|
|
86
|
+
router(req, res, () => {});
|
|
89
87
|
});
|
|
90
88
|
});
|
|
91
89
|
|
|
@@ -12,7 +12,7 @@ import { createQwikRouter } from "@qwik.dev/router/middleware/deno";
|
|
|
12
12
|
import render from "./entry.ssr";
|
|
13
13
|
|
|
14
14
|
// Create the Qwik Router Deno middleware
|
|
15
|
-
const { router,
|
|
15
|
+
const { router, staticFile } = createQwikRouter({
|
|
16
16
|
render,
|
|
17
17
|
static: {
|
|
18
18
|
cacheControl: "public, max-age=31536000, immutable",
|
|
@@ -32,13 +32,7 @@ Deno.serve({ port }, async (request: Request, info: any) => {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
// Server-side render this request with Qwik Router
|
|
35
|
-
|
|
36
|
-
if (qwikRouterResponse) {
|
|
37
|
-
return qwikRouterResponse;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Path not found
|
|
41
|
-
return notFound(request);
|
|
35
|
+
return (await router(request, info))!;
|
|
42
36
|
});
|
|
43
37
|
|
|
44
38
|
declare const Deno: any;
|
|
@@ -30,7 +30,7 @@ const assetsDir = join(distDir, "assets");
|
|
|
30
30
|
const PORT = process.env.PORT ?? 3000;
|
|
31
31
|
|
|
32
32
|
// Create the Qwik Router Node middleware
|
|
33
|
-
const { router
|
|
33
|
+
const { router } = createQwikRouter({
|
|
34
34
|
render,
|
|
35
35
|
// getOrigin(req) {
|
|
36
36
|
// // If deploying under a proxy, you may need to build the origin from the request headers
|
|
@@ -61,9 +61,6 @@ app.use(express.static(distDir, { redirect: false }));
|
|
|
61
61
|
// Use Qwik Router's page and endpoint request handler
|
|
62
62
|
app.use(router);
|
|
63
63
|
|
|
64
|
-
// Use Qwik Router's 404 handler
|
|
65
|
-
app.use(notFound);
|
|
66
|
-
|
|
67
64
|
// Start the express server
|
|
68
65
|
app.listen(PORT, () => {
|
|
69
66
|
/* eslint-disable */
|
|
@@ -11,7 +11,7 @@ export interface FastifyQwikOptions {
|
|
|
11
11
|
assetsDir: string;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const { router
|
|
14
|
+
const { router } = createQwikRouter({ render });
|
|
15
15
|
|
|
16
16
|
const qwikPlugin: FastifyPluginAsync<FastifyQwikOptions> = async (
|
|
17
17
|
fastify,
|
|
@@ -44,7 +44,6 @@ const qwikPlugin: FastifyPluginAsync<FastifyQwikOptions> = async (
|
|
|
44
44
|
|
|
45
45
|
fastify.setNotFoundHandler(async (request, response) => {
|
|
46
46
|
await router(request.raw, response.raw, (err) => fastify.log.error(err));
|
|
47
|
-
await notFound(request.raw, response.raw, (err) => fastify.log.error(err));
|
|
48
47
|
});
|
|
49
48
|
};
|
|
50
49
|
|
|
@@ -15,7 +15,7 @@ import render from "./entry.ssr";
|
|
|
15
15
|
const PORT = process.env.PORT ?? 3004;
|
|
16
16
|
|
|
17
17
|
// Create the Qwik Router express middleware
|
|
18
|
-
const { router,
|
|
18
|
+
const { router, staticFile } = createQwikRouter({
|
|
19
19
|
render,
|
|
20
20
|
static: {
|
|
21
21
|
cacheControl: "public, max-age=31536000, immutable",
|
|
@@ -26,9 +26,7 @@ const server = createServer();
|
|
|
26
26
|
|
|
27
27
|
server.on("request", (req, res) => {
|
|
28
28
|
staticFile(req, res, () => {
|
|
29
|
-
router(req, res, () => {
|
|
30
|
-
notFound(req, res, () => {});
|
|
31
|
-
});
|
|
29
|
+
router(req, res, () => {});
|
|
32
30
|
});
|
|
33
31
|
});
|
|
34
32
|
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -20,7 +20,9 @@ declare type AllSignalFlags = SignalFlags | WrappedSignalFlags | SerializationSi
|
|
|
20
20
|
|
|
21
21
|
declare const enum AsyncSignalFlags {
|
|
22
22
|
EAGER_CLEANUP = 32,
|
|
23
|
-
CLIENT_ONLY = 64
|
|
23
|
+
CLIENT_ONLY = 64,
|
|
24
|
+
CLEAR_ON_INVALIDATE = 128,
|
|
25
|
+
NO_POLL = 256
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
/** Class for back reference to the EffectSubscription */
|
|
@@ -48,7 +50,8 @@ declare const enum ChoreBits {
|
|
|
48
50
|
CHILDREN = 32,
|
|
49
51
|
CLEANUP = 64,
|
|
50
52
|
RECONCILE = 128,
|
|
51
|
-
|
|
53
|
+
ERROR_WRAP = 256,
|
|
54
|
+
DIRTY_MASK = 511
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
/** @internal */
|
|
@@ -179,7 +182,7 @@ export declare const createDOM: ({ html }?: {
|
|
|
179
182
|
}) => Promise<{
|
|
180
183
|
render: (jsxElement: JSXOutput) => Promise<RenderResult>;
|
|
181
184
|
screen: HTMLElement;
|
|
182
|
-
userEvent: (queryOrElement: string | Element | keyof HTMLElementTagNameMap | null, eventNameCamel: string | keyof WindowEventMap, eventPayload?: any) => Promise<
|
|
185
|
+
userEvent: (queryOrElement: string | Element | keyof HTMLElementTagNameMap | null, eventNameCamel: string | keyof WindowEventMap, eventPayload?: any) => Promise<Event | null>;
|
|
183
186
|
}>;
|
|
184
187
|
|
|
185
188
|
declare interface DescriptorBase<T = unknown, B = unknown> extends BackRef {
|
|
@@ -441,6 +444,7 @@ declare class LazyRef<TYPE = unknown> {
|
|
|
441
444
|
$ref$?: (null | ValueOrPromise<TYPE>) | undefined;
|
|
442
445
|
$container$: Container | undefined;
|
|
443
446
|
dev?: QRLDev | null | undefined;
|
|
447
|
+
qrls?: Set<any>;
|
|
444
448
|
constructor($chunk$: string | null, $symbol$: string, $symbolFn$: undefined | null | (() => Promise<Record<string, TYPE>>), $ref$?: (null | ValueOrPromise<TYPE>) | undefined, container?: Container | null);
|
|
445
449
|
/** We don't read hash very often so let's not allocate a string for every QRL */
|
|
446
450
|
get $hash$(): string;
|
|
@@ -668,6 +672,7 @@ declare type QRLInternalMethods<TYPE> = {
|
|
|
668
672
|
/** If this returns false, the function execution will be skipped */
|
|
669
673
|
beforeFn?: () => void | false): TYPE extends (...args: any) => any ? (...args: Parameters<TYPE>) => ValueOrPromise<ReturnType<TYPE> | undefined> : unknown;
|
|
670
674
|
$callFn$(withThis: unknown, ...args: QrlArgs<TYPE>): ValueOrPromise<QrlReturn<TYPE>>;
|
|
675
|
+
$setDev$(dev: QRLDev | null): void;
|
|
671
676
|
/**
|
|
672
677
|
* "with captures" - Get a new QRL for these captures, reusing the lazy ref. It's an internal
|
|
673
678
|
* method but we need to have a stable name because it gets called in user code by the optimizer,
|
|
@@ -900,7 +905,7 @@ declare interface TestPlatform extends CorePlatform {
|
|
|
900
905
|
*/
|
|
901
906
|
export declare function trigger(root: Element, queryOrElement: string | Element | keyof HTMLElementTagNameMap | null, eventName: string, eventPayload?: any, options?: {
|
|
902
907
|
waitForIdle?: boolean;
|
|
903
|
-
}): Promise<
|
|
908
|
+
}): Promise<Event | null>;
|
|
904
909
|
|
|
905
910
|
/**
|
|
906
911
|
* Type representing a value which is either resolve or a promise.
|