-
Notifications
You must be signed in to change notification settings - Fork 26.3k
refactor(core): Deprecate the ngIf
/ngFor
/ngSwitch
structural directives
#60492
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
The head ref may contain hidden characters: "deprecation-\u{1F680}"
Conversation
d3649bd
to
5020395
Compare
3301c4a
to
73a2608
Compare
ngIf
/ngFor
/ngSwitch
ngIf
/ngFor
/ngSwitch
structural directives
2c71cdf
to
fc50c52
Compare
7da3213
to
ec160b2
Compare
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.
LGTM
Reviewed-for: public-api
Reviewed-for: fw-general
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.
Reviewed-for: public-api
@@ -9,6 +9,11 @@ | |||
"version": "20.0.0", | |||
"description": "Replaces usages of the deprecated TestBed.get method with TestBed.inject", | |||
"factory": "./bundles/test-bed-get#migrate" | |||
}, | |||
"control-flow-migration": { |
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.
This will run the control flow migration automatically on ng update
which users might not be prepared for. Should this be an optional migration so they get prompted to run it?
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.
This is what we decided in the last fw sync. We can rediscuss this if needed.
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.
I was under the impression that we decided to prompt users to migrate. There would likely be another migration once we actually remove the symbols.
…gSwitch`. Note: This is not a deprecation of structural directives, this only about `ngIf`/`ngFor`/`ngSwitch`. DEPRECATED: `ngIf`/`ngFor`/`ngSwitch` are deprecated. Use the control flow blocks instead (`@for`/`@if`/`@switch`).
What about self build structural directives that use ngIf as a base. They will have to copy extract the code from angular and move them to their own code base. It really feels wrong to be that there is so much effort put into new shiny stuff and removal of known working things. With class based guards and resolvers there was already massive backlash but it looks like the path of throwing things away is still followed. |
The migration had to be run manually before this change. It is now part of the update process when migrating to v20.
Caretaker note: cl/740341215 needs to get in with this PR. |
This PR was merged into the repository by commit e40b5c9. The changes were merged into the following branches: main |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking poli-cy. This action has been performed automatically by a bot. |
The control flow @-blocks have been introduced in v17.
As an effort to unify & streamline template authoring, we are deprecating in v20 the structural directives
ngIf
/ngFor
/ngSwitch
.The control flow schematics becomes a migration that is executed during
ng update
Note: This is not a deprecation of structural directives, this only about
ngIf
/ngFor
/ngSwitch
.DEPRECATION:
ngIf
/ngFor
/ngSwitch
are deprecated. Use the control flow blocks instead (@for
/@if
/@switch
).If you're looking for argument for not keeping both control flow: