@qwik.dev/core 2.0.0-beta.31 → 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.
@@ -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, notFound, staticFile } = createQwikRouter({
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
- const qwikRouterResponse = await router(request);
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, notFound, staticFile } = createQwikRouter({
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, notFound, staticFile } = createQwikRouter({
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
- const qwikRouterResponse = await router(request, info);
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, notFound } = createQwikRouter({
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, notFound } = createQwikRouter({ render });
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, notFound, staticFile } = createQwikRouter({
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
 
@@ -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 */
@@ -180,7 +182,7 @@ export declare const createDOM: ({ html }?: {
180
182
  }) => Promise<{
181
183
  render: (jsxElement: JSXOutput) => Promise<RenderResult>;
182
184
  screen: HTMLElement;
183
- userEvent: (queryOrElement: string | Element | keyof HTMLElementTagNameMap | null, eventNameCamel: string | keyof WindowEventMap, eventPayload?: any) => Promise<void>;
185
+ userEvent: (queryOrElement: string | Element | keyof HTMLElementTagNameMap | null, eventNameCamel: string | keyof WindowEventMap, eventPayload?: any) => Promise<Event | null>;
184
186
  }>;
185
187
 
186
188
  declare interface DescriptorBase<T = unknown, B = unknown> extends BackRef {
@@ -903,7 +905,7 @@ declare interface TestPlatform extends CorePlatform {
903
905
  */
904
906
  export declare function trigger(root: Element, queryOrElement: string | Element | keyof HTMLElementTagNameMap | null, eventName: string, eventPayload?: any, options?: {
905
907
  waitForIdle?: boolean;
906
- }): Promise<void>;
908
+ }): Promise<Event | null>;
907
909
 
908
910
  /**
909
911
  * Type representing a value which is either resolve or a promise.