-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bundle solid-start/entry-client
#1034
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "solid-start/entry-client", | ||
"module": "./dist/index.jsx", | ||
"types": "./dist/index.d.ts", | ||
"type": "module", | ||
"sideEffects": false | ||
} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"noEmit": false, | ||
"emitDeclarationOnly": false, | ||
"outDir": "./dist", | ||
"types": ["../env", "solid-start/vite/plugin", "solid-start/router"], | ||
"paths": { | ||
"solid-start/islands": ["../islands"], | ||
"solid-start/server": ["../server"] | ||
} | ||
}, | ||
"include": ["./src"], | ||
"exclude": [] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import StartClient from "../entry-client/StartClient"; | ||
import StartClient from "../entry-client/src/StartClient"; | ||
|
||
StartClient(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { A as BaseA, Location, NavigateOptions, Navigator, RouteDataFunc } from "@solidjs/router"; | ||
import { JSX } from "solid-js"; | ||
import { LocationEntry, useSearchParams as useIslandsSearchParams } from "./islands/router"; | ||
export type RouteParams<T extends string> = Record<T, string>; | ||
export type RouteDataArgs<T extends keyof StartRoutes = "$"> = { | ||
data: StartRoutes[T]["data"]; | ||
params: RouteParams<StartRoutes[T]["params"]>; | ||
location: Location; | ||
navigate: Navigator; | ||
}; | ||
declare const A: typeof BaseA; | ||
declare const Routes: (props: import("@solidjs/router").RoutesProps) => JSX.Element; | ||
declare const Outlet: () => JSX.Element; | ||
declare const useNavigate: () => Navigator; | ||
declare const useSearchParams: typeof useIslandsSearchParams | (<T extends import("@solidjs/router").Params>() => [T, (params: import("@solidjs/router").SetParams, options?: Partial<NavigateOptions<unknown>> | undefined) => void]); | ||
declare global { | ||
interface Window { | ||
router: { | ||
navigate: (to: string, options?: Partial<NavigateOptions>) => Promise<boolean>; | ||
push: (to: string | URL, options: Partial<NavigateOptions>) => void; | ||
update: (body: string) => Promise<boolean>; | ||
router: EventTarget; | ||
location: () => LocationEntry; | ||
}; | ||
} | ||
interface StartRoutes { | ||
$: { | ||
params: any; | ||
data: any; | ||
}; | ||
} | ||
interface Route { | ||
"/notes/[note]": "/notes/[note]"; | ||
} | ||
} | ||
Comment on lines
+16
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file was generated from In actuality all |
||
export declare function useRouteData<T extends keyof StartRoutes>(): ReturnType<StartRoutes[T]["data"]>; | ||
export declare function useRouteData<T extends (...args: any[]) => any>(): T extends RouteDataFunc<infer _, infer R> ? R : ReturnType<T>; | ||
export { useLocation } from "./islands/useLocation"; | ||
export { A, Outlet, Routes, useNavigate, useSearchParams }; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { mount, StartClient } from "../entry-client"; | ||
import { mount, StartClient } from "../entry-client/src"; | ||
|
||
mount(() => <StartClient />, document); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cf. https://github.com/solidjs/solid/blob/main/packages/solid/html/package.json
I'm not including
main
because I believe we require Node18.... I don't know nearly enough about Node to know if that's good enough justification but we're not using a "real" bundler like Rollup. Maybe later?