File system based routing
Specific Demand
Similar to NextJS, SvelteKit and many other JS based frameworks: it would be nice to have file based routing to aid DX, this could be opt-in as some would prefer to have the existing implementation of a router.
This would be a great addition to the ecosystem, but I don't think it belongs in the main Dioxus router library. File based routing is typically part of a more opinionated metaframework. It should be possible to implement this with the existing router. Something like this could definitely be interesting in a Dioxus metaframework (like https://github.com/ahecha-co/ahecha).
Since this is more relevant to Tokamak, could we reopen this and move it to the https://github.com/DioxusLabs/tokamak repo, thanks.
Since I closed this PR, dioxus-fullstack was created which is much more like a metaframework. This could fit in that crate.
Would love for someone to champion this
Since I closed this PR, dioxus-fullstack was created which is much more like a metaframework. This could fit in that crate.
Not sure if dioxin fullstack has its own roadmap / milestone, perhaps this can be tracked with that in mind?
Would love for someone to champion this
I'm not sure if file based routing would be a good fit with the type safe router we currently have. The current router uses an enum to represent routes. We need type information for that enum to determine how to parse the route. We also need a type for the route to make links typesafe.
It isn't clear:
- What would route definitions look like with types. How are layouts defined (files with specific names + component names)?
- How typed routes should be derived from the routes
- If it worth giving up a lot of transparency for slightly easier routes once you know the file based syntax
I think file system based routes would give up a lot of transparency about the structure of the Route enum which would make it more difficult to work with.
Not sure if dioxin fullstack has its own roadmap / milestone, perhaps this can be tracked with that in mind?
Dioxus fullstack is tracked with the dioxus roadmap here.