Conversation
… tracker Updates the `ChangeTracker` to integrate the changes from angular#57110.
Makes a few optimizations in the utilities we use for dealing with imports in migrations. I didn't end up using these in the inject migration, but they should still come in handy. Includes: 1. Exiting `isReferenceToImport` early when the node being checked is an identifier and it doesn't match the identifier of the import. This saves us some type checker calls. 2. Adds the ability to pass a single string to `getImportSpecifiers`. This saves us unnecessary arrays and for loops.
The `inject` migration can leave some unused imports behind when it removes decorators like `@Inject`. These changes add some logic to remove them.
devversion
approved these changes
Jul 29, 2024
Contributor
|
This PR was merged into the repository by commit ba0df30. The changes were merged into the following branches: main |
dylhunn
pushed a commit
that referenced
this pull request
Jul 29, 2024
Makes a few optimizations in the utilities we use for dealing with imports in migrations. I didn't end up using these in the inject migration, but they should still come in handy. Includes: 1. Exiting `isReferenceToImport` early when the node being checked is an identifier and it doesn't match the identifier of the import. This saves us some type checker calls. 2. Adds the ability to pass a single string to `getImportSpecifiers`. This saves us unnecessary arrays and for loops. PR Close #57179
dylhunn
pushed a commit
that referenced
this pull request
Jul 29, 2024
The `inject` migration can leave some unused imports behind when it removes decorators like `@Inject`. These changes add some logic to remove them. PR Close #57179
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates some migration utilities and adds logic to drop unused imports in the
injectmigration. Made up of the following changes:refactor(migrations): add the ability to remove imports in the change tracker
Updates the
ChangeTrackerto integrate the changes from #57110.refactor(migrations): optimize some of the import utilities
Makes a few optimizations in the utilities we use for dealing with imports in migrations. I didn't end up using these in the inject migration, but they should still come in handy. Includes:
isReferenceToImportearly when the node being checked is an identifier and it doesn't match the identifier of the import. This saves us some type checker calls.getImportSpecifiers. This saves us unnecessary arrays and for loops.fix(migrations): remove unused imports in inject migration
The
injectmigration can leave some unused imports behind when it removes decorators like@Inject. These changes add some logic to remove them.