-
Notifications
You must be signed in to change notification settings - Fork 27k
fix(core): properly remove imports in the afterRender phase migration #56524
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): properly remove imports in the afterRender phase migration #56524
Conversation
packages/core/schematics/migrations/after-render-phase/migration.ts
Outdated
Show resolved
Hide resolved
Before this commit, the migration was removing the `AfterRenderPhase` enum from the imports but not the comma, resulting in invalid code:
ts
```
import { , Directive, afterRender } from '@angular/core';
```
This commit fixes this by using `updateNamedImports` and `replaceNode` instead of `removeNode`.
After:
ts
```
import { Directive, afterRender } from '@angular/core';
```
2a9dcd9 to
7c7ba66
Compare
JoostK
left a comment
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'm not a core code owner so probably my approval isn't sufficient, but LGTM and thanks for the fix!
|
Joost's review is certainly sufficient (regardless of the group), so marking this PR as merge ready 😄 Thanks for the fix! |
|
This PR was merged into the repository by commit 03a2acd. 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 policy. This action has been performed automatically by a bot. |
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?
Before this commit, the migration was removing the
AfterRenderPhaseenum from the imports but not the comma, resulting in invalid code:ts
What is the new behavior?
This commit fixes this by using
updateNamedImportsandreplaceNodeinstead ofremoveNode.After:
ts
Does this PR introduce a breaking change?
Other information