-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Add support for parameterized routing. Refs #59, #91 #142
Conversation
This solution is duplicating |
I don't agree. It is meant to be a complement to the pages folder. pages is for static routes, whereas routes is for dynamic routing. If an app has no need for dynamic routing, then this directory can be ignored, maintaining an extremely minimal implementation. |
@nkzawa Yes I agree providing an external for detailed customizations. But we can also give some basic support in the framework IMHO. |
@nkzawa I would be ok with that approach as long as plugins could hook into the existing rendering and transpiling. |
I'm looking forward to hoping this PR will be merged to our repo. I need to custom route to do something like: |
@hoangzinh I think the maintainers are going a different direction. |
@dstreet ah I see |
Considering #291 (comment), I suggest you start looking into transforming this into an API like:
Users of this approach will have to use Then you can extend This will give you the great expressiveness and ease-of-use, without us having to bloat the core :) |
Pulls routes from
next.config.js
:Routes defined this way are resolved to the
routes
directory rather thanpages
to avoid conflicts and ensure existing functionality remains intact. Additionally, a parameters map is passed to each of the components viactx
.