Skip to content
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(router): Routed components never inherit RouterOutlet `Environm… #54265

Conversation

atscott
Copy link
Contributor

@atscott atscott commented Feb 5, 2024

…entInjector`

This commit ensures components in the route config predictably always get their providers from the hierarchy available to routes rather than sometimes being dependent on where they are inserted.

fixes #53369

BREAKING CHANGE: Providers available to the routed components always come from the injector heirarchy of the routes and never inherit from the RouterOutlet. This means that providers available only to the component that defines the RouterOutlet will no longer be available to route components in any circumstances. This was already the case whenever routes defined providers, either through lazy loading an NgModule or through explicit providers on the route config.

@atscott atscott added area: router target: major This PR is targeted for the next major release action: global presubmit The PR is in need of a google3 global presubmit labels Feb 5, 2024
@ngbot ngbot bot modified the milestone: Backlog Feb 5, 2024
@angular-robot angular-robot bot added the detected: breaking change PR contains a commit with a breaking change label Feb 5, 2024
@atscott atscott requested a review from alxhub February 5, 2024 18:45
@atscott atscott force-pushed the routeComponentsNeverInheritOutletEnvironment branch from a70befd to 887ff89 Compare February 5, 2024 20:11
Copy link
Contributor

@jessicajaniuk jessicajaniuk left a comment

Choose a reason for hiding this comment

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

reviewed-for: public-api

@atscott atscott force-pushed the routeComponentsNeverInheritOutletEnvironment branch from bc7afc6 to 79a901c Compare February 5, 2024 23:37
Copy link
Member

@pkozlowski-opensource pkozlowski-opensource left a comment

Choose a reason for hiding this comment

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

LGTM

Reviewed-for: public-api

…entInjector`

This commit ensures components in the route config predictably always
get their providers from the hierarchy available to routes rather than
sometimes being dependent on where they are inserted.

fixes angular#53369

BREAKING CHANGE: Providers available to the routed components always
come from the injector heirarchy of the routes and never inherit from
the `RouterOutlet`. This means that providers available only to the
component that defines the `RouterOutlet` will no longer be available to
route components in any circumstances. This was already the case
whenever routes defined providers, either through lazy loading an
`NgModule` or through explicit `providers` on the route config.
@atscott atscott force-pushed the routeComponentsNeverInheritOutletEnvironment branch from 79a901c to 217f37a Compare February 20, 2024 19:15
@atscott
Copy link
Contributor Author

atscott commented Mar 7, 2024

@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Mar 7, 2024
@atscott
Copy link
Contributor Author

atscott commented Mar 7, 2024

caretaker note: Will need to patch this change to tracking_router_outlet when sycning cl/608676576

@atscott atscott added merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed action: global presubmit The PR is in need of a google3 global presubmit labels Mar 7, 2024
@atscott
Copy link
Contributor Author

atscott commented Mar 14, 2024

This PR was merged into the repository by commit da906fd.

@atscott atscott closed this in da906fd Mar 14, 2024
alxhub added a commit to alxhub/angular that referenced this pull request Mar 15, 2024
…EnvironmentInjector` (angular#54265)"

This reverts commit da906fd.

This change causes some test failures in google3.
@atscott atscott reopened this Mar 15, 2024
@atscott atscott added requires: TGP This PR requires a passing TGP before merging is allowed and removed action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels Mar 15, 2024
alxhub added a commit that referenced this pull request Mar 15, 2024
…EnvironmentInjector` (#54265)" (#54895)

This reverts commit da906fd.

This change causes some test failures in google3.

PR Close #54895
@atscott atscott added action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels Mar 25, 2024
@atscott
Copy link
Contributor Author

atscott commented Mar 25, 2024

caretaker note: Please merge and sync on its own (and patch the tracking outlet from cl/608676576)

@atscott
Copy link
Contributor Author

atscott commented Apr 1, 2024

This PR was merged into the repository by commit 3839cfb.

@atscott atscott closed this in 3839cfb Apr 1, 2024
ilirbeqirii pushed a commit to ilirbeqirii/angular that referenced this pull request Apr 6, 2024
…EnvironmentInjector` (angular#54265)" (angular#54895)

This reverts commit da906fd.

This change causes some test failures in google3.

PR Close angular#54895
ilirbeqirii pushed a commit to ilirbeqirii/angular that referenced this pull request Apr 6, 2024
…entInjector` (angular#54265)

This commit ensures components in the route config predictably always
get their providers from the hierarchy available to routes rather than
sometimes being dependent on where they are inserted.

fixes angular#53369

BREAKING CHANGE: Providers available to the routed components always
come from the injector heirarchy of the routes and never inherit from
the `RouterOutlet`. This means that providers available only to the
component that defines the `RouterOutlet` will no longer be available to
route components in any circumstances. This was already the case
whenever routes defined providers, either through lazy loading an
`NgModule` or through explicit `providers` on the route config.

PR Close angular#54265
@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 2, 2024
@pullapprove pullapprove bot removed the requires: TGP This PR requires a passing TGP before merging is allowed label May 2, 2024
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: router detected: breaking change PR contains a commit with a breaking change merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Standalone injectors do not seem to be completely isolated
3 participants