-
-
Notifications
You must be signed in to change notification settings - Fork 930
Closed
Labels
Area: CoreFor anything dealing with Mithril core itselfFor anything dealing with Mithril core itselfType: Breaking ChangeFor any feature request or suggestion that could reasonably break existing codeFor any feature request or suggestion that could reasonably break existing codeType: EnhancementFor any feature request or suggestion that isn't a bug fixFor any feature request or suggestion that isn't a bug fix
Milestone
Description
Mithril version:
Browser and OS:
Project:
Is this something you're interested in implementing yourself? Very.
Description
Change the routes in the router to just be "route": (attrs) => vnode
functions.
// Current
m.route(elem, "/", {
"/": Home,
"/foo/:id": FooView,
})
// Proposed
m.route(elem, "/", {
"/": () => m(Home),
"/foo": ({id}) => m(FooView, {id}),
})
This would also entail making m.route.SKIP
work with the render function, so we can retain that core functionality.
Why
Simplifies our router API greatly. Together with a built-in Async
component, this covers the full API for route resolvers in a way that's just generally more flexible and pluggable for users. It's also simpler to implement.
Possible Implementation
Open Questions
skyghis, StephanHoyer, boazblake, danloomer and foxdonutpatryk-kawalarz and ycadaner-merkos302
Metadata
Metadata
Assignees
Labels
Area: CoreFor anything dealing with Mithril core itselfFor anything dealing with Mithril core itselfType: Breaking ChangeFor any feature request or suggestion that could reasonably break existing codeFor any feature request or suggestion that could reasonably break existing codeType: EnhancementFor any feature request or suggestion that isn't a bug fixFor any feature request or suggestion that isn't a bug fix
Type
Projects
Status
Completed/Declined