-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
feat(@nestjs/core): Add RouterModule to the core #3489
Conversation
if (prefix) { | ||
path = prefix + this.validateRoutePath(path); | ||
// Override the metadata with the new path | ||
Reflect.defineMetadata(PATH_METADATA, path, metatype); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think doing this would solve all integration issues with any other packages that depend on routes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for example the swagger integration issues and also this issue nestjsx/nest-router#5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very uncommon but still: what if I have the same controller used in 2 modules? In this case, I'd override the metadata twice.
Pull Request Test Coverage Report for Build 16552
💛 - Coveralls |
Any news? 👍 |
Let me know if there's anything we can do to help @shekohex! |
Hi @kamilmysliwiec The issue here with |
Actually, this doesn't look that bad ;) |
Is this PR going to be merged as part of 7.0.0 release? 🚀 |
Hi @kamilmysliwiec |
Hey, any progress on this? 👀 |
Would love to have this feature! |
Any news? |
Hey all, anyone is interested to take over this PR? |
@shekohex @kamilmysliwiec In Angular, I used to pass the custom data object where I define the route (in router module). Then in guard, I can have access to that data. (e.g. But here (as described) we should define a custom decorator and decorate the controller's method with it, then in guard, we can have access to the decorator's value (to check whether the API is decorated with that decorator or not) |
@kamilmysliwiec Would you please consider this for versioning? (Actually the discussion started from here) |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #255 , #389 and #1438
What is the new behavior?
For a long time ago (almost 2 years) I created and maintained the nest-router package as a 3rd party package.
Over that time, we gained a lot of feedback and fixed a lot of issues (especially integration with other packages like @nestjs/swagger for example).
And now, we think it's time to add this package as a module into the nestjs core, and Hopefully it would be useful in a lot of use cases, for example:
...and the list goes on.
Does this PR introduce a breaking change?
Other information