-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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(common): support empty @Inject()
on constructor-based injection
#13428
Conversation
Pull Request Test Coverage Report for Build d48faa69-328d-42fb-966e-6301bdeed1a3Details
💛 - Coveralls |
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.
Hi ! I'm not sure to understand, what this will produce as a result ? Will Nest take providers list as ref to auto-fill empty @Inject()
calls to avoid errors ?
Edit: Just rephrasing to be clear.
nestjs will infer the provider token using parameter's metadata. Prior to this, such metadata is always ignored when using I don't know how to explain it more because I didn't follow if you're talking about the transpiled JS code or the runtime behavior. Here's a video about the reflection on nestjs: https://youtu.be/jo-1EUxMmxc?si=ZvRQ8-6lac6Se3cS&t=779 |
Sorry, yes i was talking about the runtime behavior. |
regarding that, it will behave just like property-based injection. For them, the |
Ok, i understand the motivations, thanks for your reply ! |
any timeline for this to be merged? |
lgtm |
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: closes #13426
What is the new behavior?
We can use
@Inject()
(ie., no token supplied) on constructor-based injections. It works just like property-based injectionDoes this PR introduce a breaking change?