Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove InjectFlags #60318

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

Closed
wants to merge 3 commits into from
Closed

Conversation

crisbeto
Copy link
Member

These changes remove the InjectFlags itself, as well as all the public API signatures that accepted it. I've included an automated migration from InjectFlags to the object literal.

Note that we still have internal usages of InjectFlags which will take more refactoring, but they've been replaced with the InternalInjectFlags which have the advantage of being a const enum.

BREAKING CHANGE:

  • InjectFlags has been removed.
  • inject no longer accepts InjectFlags.
  • Injector.get no longer accepts InjectFlags.
  • EnvironmentInjector.get no longer accepts InjectFlags.
  • TestBed.get no longer accepts InjectFlags.
  • TestBed.inject no longer accepts InjectFlags.

Adds an automated migration that will switch users from the deprecated `InjectFlags` API to its non-deprecated equivalent.
@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: major This PR is targeted for the next major release labels Mar 11, 2025
@crisbeto crisbeto added this to the v20 candidates milestone Mar 11, 2025
@ngbot ngbot bot modified the milestone: v20 candidates Mar 11, 2025
@angular-robot angular-robot bot added detected: breaking change PR contains a commit with a breaking change detected: feature PR contains a feature commit area: core Issues related to the framework runtime labels Mar 11, 2025
@ngbot ngbot bot added this to the Backlog milestone Mar 11, 2025
Removes the deprecated `InjectFlags` symbol from the `@angular/core` public API, as well as all the places that accept it. The previous commit includes an automated migration to switch over to the new way of passing in flags.

BREAKING CHANGE:
* `InjectFlags` has been removed.
* `inject` no longer accepts `InjectFlags`.
* `Injector.get` no longer accepts `InjectFlags`.
* `EnvironmentInjector.get` no longer accepts `InjectFlags`.
* `TestBed.get` no longer accepts `InjectFlags`.
* `TestBed.inject` no longer accepts `InjectFlags`.
Replaces all the places where we use `InjectFlags` internally with the `InternalInjectFlags` which has the benefit of being a `const` enum and allowing us to consolidate the flags and object literal eventually.
@crisbeto crisbeto force-pushed the inject-flags-removal branch from bfd6e88 to 7f165be Compare March 11, 2025 08:26
@crisbeto
Copy link
Member Author

Passing TGP, aside from one unrelated failure.

@crisbeto crisbeto marked this pull request as ready for review March 11, 2025 12:07
Copy link
Contributor

@thePunderWoman thePunderWoman 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: fw-general, public-api

@pullapprove pullapprove bot requested a review from mmalerba March 11, 2025 14:21
Copy link
Contributor

@AndrewKushnir AndrewKushnir 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

@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Mar 11, 2025
Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

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

LGTM on the migration code. Nice work

@AndrewKushnir
Copy link
Contributor

This PR was merged into the repository by commit 8be6e38.

The changes were merged into the following branches: main

AndrewKushnir pushed a commit that referenced this pull request Mar 11, 2025
Removes the deprecated `InjectFlags` symbol from the `@angular/core` public API, as well as all the places that accept it. The previous commit includes an automated migration to switch over to the new way of passing in flags.

BREAKING CHANGE:
* `InjectFlags` has been removed.
* `inject` no longer accepts `InjectFlags`.
* `Injector.get` no longer accepts `InjectFlags`.
* `EnvironmentInjector.get` no longer accepts `InjectFlags`.
* `TestBed.get` no longer accepts `InjectFlags`.
* `TestBed.inject` no longer accepts `InjectFlags`.

PR Close #60318
AndrewKushnir pushed a commit that referenced this pull request Mar 11, 2025
Replaces all the places where we use `InjectFlags` internally with the `InternalInjectFlags` which has the benefit of being a `const` enum and allowing us to consolidate the flags and object literal eventually.

PR Close #60318
@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 Apr 11, 2025
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 detected: breaking change PR contains a commit with a breaking change detected: feature PR contains a feature commit target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants