Skip to content

refactor(core): create a standalone injector during applicationBootstrap#45766

Closed
pkozlowski-opensource wants to merge 2 commits intoangular:masterfrom
pkozlowski-opensource:bootstrap_injector
Closed

refactor(core): create a standalone injector during applicationBootstrap#45766
pkozlowski-opensource wants to merge 2 commits intoangular:masterfrom
pkozlowski-opensource:bootstrap_injector

Conversation

@pkozlowski-opensource
Copy link
Member

This commit changes the injectors hierarchy created during applicationBootstrap.
From now on a standalone injector (holding all the ambient providers of a
standalone component) is create as a child of the application injector.
This change aligns injectors hierarchy for bootstrapped and dynamically
created standalone components.

This commit changes the injectors hiearchy created during applicationBootstrap.
From now on a standalone injector (holding all the ambient providers of a
standalone component) is create as a child of the application injector.
This change alligns injectors hierarchy for bootstrapped and dynamically
created standalone components.
// Collect providers from the root standalone component
// and all of its dependencies (NgModule, other standalone Components)
// and make those providers available in the DI tree.
...importProvidersFrom(rootComponent),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate question (not something we need to address in this PR): should we prevent the importProvidersFrom interface from expanding a standalone component into ambient providers?

Internally it needs to do this because of NgModules importing standalone components, but expanding a standalone component directly is not really its intended use case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely, this great follow-up task, will do it in a separate PR!

@alxhub alxhub added the area: core Issues related to the framework runtime label Apr 26, 2022
@ngbot ngbot bot added this to the Backlog milestone Apr 26, 2022
@alxhub alxhub modified the milestones: Backlog, v14-candidates Apr 26, 2022
@pkozlowski-opensource pkozlowski-opensource added the target: minor This PR is targeted for the next minor release label Apr 26, 2022
@pkozlowski-opensource pkozlowski-opensource marked this pull request as ready for review April 26, 2022 14:49
@AndrewKushnir AndrewKushnir added the action: presubmit The PR is in need of a google3 presubmit label Apr 27, 2022
@AndrewKushnir
Copy link
Contributor

Presubmit.

@AndrewKushnir AndrewKushnir removed the action: presubmit The PR is in need of a google3 presubmit label Apr 27, 2022
@pkozlowski-opensource pkozlowski-opensource added the action: merge The PR is ready for merge by the caretaker label Apr 27, 2022
@atscott
Copy link
Contributor

atscott commented Apr 27, 2022

This PR was merged into the repository by commit 2b5c2d6.

@atscott atscott closed this in 2b5c2d6 Apr 27, 2022
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants