|
1 | 1 | import type { JSX } from "solid-js"; |
2 | | -import { manifest } from "solid-start:server-manifest"; |
3 | | -import { createRoutes } from "../../router"; |
| 2 | + |
4 | 3 | import { createHandler as createBaseHandler } from "../index"; |
5 | 4 | import { getClientEntryCssTags } from "../server-manifest"; |
6 | | -import { FetchEvent, HandlerOptions, PageEvent } from "../types"; |
| 5 | +import type { FetchEvent, HandlerOptions, PageEvent } from "../types"; |
7 | 6 |
|
8 | 7 | /** |
9 | 8 | * |
10 | 9 | * Read more: https://docs.solidjs.com/solid-start/reference/server/create-handler |
11 | 10 | */ |
12 | 11 | export function createHandler( |
13 | 12 | fn: (context: PageEvent) => JSX.Element, |
14 | | - options?: HandlerOptions | ((context: PageEvent) => HandlerOptions) |
| 13 | + options?: HandlerOptions | ((context: PageEvent) => HandlerOptions), |
15 | 14 | ) { |
16 | 15 | return createBaseHandler(fn, options); |
17 | 16 | } |
18 | 17 |
|
19 | 18 | export async function createPageEvent(ctx: FetchEvent) { |
20 | 19 | const pageEvent: PageEvent = Object.assign(ctx, { |
21 | | - manifest: manifest.routes, |
22 | | - assets: [ |
23 | | - ...(await getClientEntryCssTags()) |
24 | | - // not needed anymore? |
25 | | - // ...(import.meta.env.DEV |
26 | | - // ? await clientManifest.inputs[import.meta.env.START_APP]!.assets() |
27 | | - // : []), |
28 | | - // ...(import.meta.env.START_ISLANDS |
29 | | - // ? (await serverManifest.inputs[serverManifest.handler]!.assets()).filter( |
30 | | - // s => (s as any).attrs.rel !== "modulepreload" |
31 | | - // ) |
32 | | - // : []) |
33 | | - ], |
34 | | - // router: { |
35 | | - // // submission: initFromFlash(ctx) as any |
36 | | - // }, |
37 | | - routes: createRoutes(), |
38 | | - // // prevUrl: prevPath || "", |
39 | | - // // mutation: mutation, |
40 | | - // // $type: FETCH_EVENT, |
| 20 | + manifest: {}, |
| 21 | + assets: [...getClientEntryCssTags()], |
| 22 | + routes: [], |
41 | 23 | complete: false, |
42 | | - $islands: new Set<string>() |
| 24 | + $islands: new Set<string>(), |
43 | 25 | }); |
44 | 26 |
|
45 | 27 | return pageEvent; |
|
0 commit comments