kitql icon indicating copy to clipboard operation
kitql copied to clipboard

Feat: do not type search parameters globally in `vite-plugin-kit-routes`

Open kran6a opened this issue 5 months ago • 1 comments

It is easier to maintain if we keep parameters definition on the route themselves rather than as a global config.

They can be typed on +page.ts files via the config export. It would also allow configuring a search param on a layout and have all child routes inherit it. Note that you can do export type config rather than export config and that you can export a type and a variable with the same name simultaneously so exporting a type should not cause problems for anyone already using export config.

Aditionally, I think we should also type the hash part of the url and that search parameters and route parameters should not be passed in the same object as you can't have a route like /config/[tab]?tab=1, which may seem like an odd route despite being a valid one, but that would require a breaking change.

kran6a avatar Sep 27 '24 22:09 kran6a