-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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(material/schematics): don't drop imports in files that do not use theming APIs #22438
Merged
Conversation
This file contains 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
… theming APIs I noticed this while trying out the theming migration against the docs site. The way the `theming-api` migration is set up means that we'll drop the Material imports as soon as we see them, but that doesn't guarantee that they're actually used further down in the file. These changes rework the logic so that we drop the imports after we've migrated the symbols.
jelbourn
approved these changes
Apr 12, 2021
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
crisbeto
added a commit
to crisbeto/material2
that referenced
this pull request
Apr 30, 2021
…atic Includes the following improvements to the `themingApi` schematic: 1. No longer runs against files in the `node_modules`. This was happening by accident. 2. Remove the quotes around the values of `$mat-small` and `$mat-xsmall` since they were causing Sass syntax errors. 3. Migrates Material/CDK symbols, even if there are no imports for the old theming bundle. This allows us to handle symbols that were imported transitively. 4. Reverts the logic from angular#22438 that doesn't drop imports if there are no Material/CDK symbol usages within the file. I think that we want to do this after all, because the old import could slow down build times and we can be relatively certain that any usages have been migrated. Fixes angular#22599.
crisbeto
added a commit
to crisbeto/material2
that referenced
this pull request
May 2, 2021
…atic Includes the following improvements to the `themingApi` schematic: 1. No longer runs against files in the `node_modules`. This was happening by accident. 2. Remove the quotes around the values of `$mat-small` and `$mat-xsmall` since they were causing Sass syntax errors. 3. Migrates Material/CDK symbols, even if there are no imports for the old theming bundle. This allows us to handle symbols that were imported transitively. 4. Reverts the logic from angular#22438 that doesn't drop imports if there are no Material/CDK symbol usages within the file. I think that we want to do this after all, because the old import could slow down build times and we can be relatively certain that any usages have been migrated. Fixes angular#22599.
annieyw
pushed a commit
that referenced
this pull request
May 3, 2021
…atic (#22604) Includes the following improvements to the `themingApi` schematic: 1. No longer runs against files in the `node_modules`. This was happening by accident. 2. Remove the quotes around the values of `$mat-small` and `$mat-xsmall` since they were causing Sass syntax errors. 3. Migrates Material/CDK symbols, even if there are no imports for the old theming bundle. This allows us to handle symbols that were imported transitively. 4. Reverts the logic from #22438 that doesn't drop imports if there are no Material/CDK symbol usages within the file. I think that we want to do this after all, because the old import could slow down build times and we can be relatively certain that any usages have been migrated. Fixes #22599.
annieyw
pushed a commit
that referenced
this pull request
May 3, 2021
…atic (#22604) Includes the following improvements to the `themingApi` schematic: 1. No longer runs against files in the `node_modules`. This was happening by accident. 2. Remove the quotes around the values of `$mat-small` and `$mat-xsmall` since they were causing Sass syntax errors. 3. Migrates Material/CDK symbols, even if there are no imports for the old theming bundle. This allows us to handle symbols that were imported transitively. 4. Reverts the logic from #22438 that doesn't drop imports if there are no Material/CDK symbol usages within the file. I think that we want to do this after all, because the old import could slow down build times and we can be relatively certain that any usages have been migrated. Fixes #22599. (cherry picked from commit 94bb518)
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. |
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
cla: yes
PR author has agreed to Google's Contributor License Agreement
P2
The issue is important to a large percentage of users, with a workaround
target: major
This PR is targeted for the next major release
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.
I noticed this while trying out the theming migration against the docs site. The way the
theming-api
migration is set up means that we'll drop the Material imports as soon as we see them, but that doesn't guarantee that they're actually used further down in the file.These changes rework the logic so that we drop the imports after we've migrated the symbols.