-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Rename Switch trait #1107
Comments
@hgzimmerman Also, I think it would make much more sense to name the #[derive(Switch, Debug)]
pub enum AppRoute {
#[at = "/profile/{id}"]
Profile(u32),
#[at = "/forum{*:rest}"]
Forum(ForumRoute),
#[at = "/"]
Index,
}
#[derive(Switch, Debug)]
pub enum ForumRoute {
#[at = "/{subforum}/{thread_slug}"]
SubForumAndThread{subforum: String, thread_slug: String}
#[at = "/{subforum}"]
SubForum{subforum: String}
} Because links/buttons route |
Other frameworks use essentially two parts for their router:
1. Route Matcher: // React
<Switch>
<Route path="/about">
<About />
</Route>
</Switch>
// Vue
const router = new VueRouter({
routes: [
{ path: '/about', component: About }
]
})
// Angular
const appRoutes: Routes = [
{
path: "about",
component: AboutComponent
}, React does use a parent 2. Navigational Component: <!-- Vue -->
<router-link to="/about">About</router-link>
<!-- React Router -->
<Link to="/about">About</Link>
Why I think I am perfectly happy with the My suggestions
|
Description
While
Switch
is an ok name for what it does, I think something along the lines ofRoutable
would be more appropriate.I don't intend to make this change for 8.0, but would like to create this issue so that interested parties can prepare their codebase for this change.
This change will come in 3 pieces.
The text was updated successfully, but these errors were encountered: