-
-
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
fix(core): dependencies not resolving for transient lazy providers #13804
base: master
Are you sure you want to change the base?
fix(core): dependencies not resolving for transient lazy providers #13804
Conversation
Pull Request Test Coverage Report for Build ed614f3a-8fae-4c99-8c8e-2e6bfea98225Details
💛 - 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.
Left a couple questions on this PR. This is my first look on this repo so I hope it does not cause any issues!
Thanks and keep up the good work!
|
||
sayHello() { | ||
this.counter++; | ||
return 'Hi! Counter is ' + this.counter; |
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.
question: Is this function here only for debugging purposes or is it actively used? If it is used why not provide a more meaningful message?
Thanks!
const { TransientLazyModule } = await import('./transient.module'); | ||
const moduleRef = await this.lazyLoadModule.load(() => TransientLazyModule); | ||
|
||
const { TransientService } = await import('./transient.service'); |
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.
question: Would it make sense to use Promise.all() or Promise.allSettled() for awaiting these imports in parallel for a slight perf boost?
Thanks!
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 #13761
When a lazy module resolver a lazy provider marked as transient the singleton dependencies are recreated for the new requests in same context.
What is the new behavior?
Skipping creation of new providers if they are marked as transient and have annotation in the score of module.
Does this PR introduce a breaking change?
Other information