rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

SvelteKit's router as a standalone component

Open benmccann opened this issue 5 years ago • 6 comments

Rendered

benmccann avatar Sep 16 '20 22:09 benmccann

I think this is a really important RFC for the wider community. Svelte needs a blessed routing solution that isn't bolted onto Sveltekit, especially for SPAs where Sveltekit is overkill / cumbersome.

Personally I would have loved if that router was declarative rather than file-based (I love what tinro is doing), but taking my own preferences out of it having a routing solution semi-officially supported by Svelte is a must-have and an oversight in the current ecosystem.

madeleineostoja avatar Nov 13 '21 01:11 madeleineostoja

This is desperately desperately needed. I have a standard application where there are two types of users students and teachers. Right now, because of file based routing; I have to push each of their homepages to /student and /teacher rather than at the base route /.

Using src/routes/index.svelte and then in that component using <svelte:component this="{isTeacher ? TeacherHome : StudentHome})"> as a workaround is not a good solution because then I can't take advantage of the load function for each component. Currently there is no workaround; so aliases are desperately needed. Very much looking forward to this PR.

nikkwong avatar Nov 24 '21 23:11 nikkwong

might also solve https://github.com/sveltejs/kit/pull/1130

CanRau avatar Sep 28 '22 04:09 CanRau

@axljoker03 please stop approving all the RFCs. You're spamming all the maintainers and it's a bit annoying. You can simply leave a thumbs up or down on the post to indicate an opinion

benmccann avatar Jan 05 '23 16:01 benmccann

Greetings all. May I ask about the status of this RFC, as my team is following a specific project directory structure that suits our needs and conventions but it is highly incompatible with the file-based routing. It would be super to be able to define the routes and sub-routes at each nested level of the UI layout using other approaches.

My objective is to be able to use the SSR offered by SvelteKit without the file-based router. Our backend API is not NodeJs and we would like to communicate directly with it from the frontend.

geekox86 avatar May 03 '24 12:05 geekox86