Skip to content
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
merged 1 commit into from
Apr 12, 2021

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Apr 8, 2021

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.

… 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.
@crisbeto crisbeto added P2 The issue is important to a large percentage of users, with a workaround merge safe target: major This PR is targeted for the next major release labels Apr 8, 2021
@crisbeto crisbeto requested review from jelbourn and devversion April 8, 2021 19:27
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Apr 8, 2021
@crisbeto crisbeto added this to the 12.0.0 milestone Apr 10, 2021
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

lgtm

@jelbourn jelbourn added the action: merge The PR is ready for merge by the caretaker label Apr 12, 2021
@mmalerba mmalerba merged commit d030a87 into angular:master Apr 12, 2021
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)
@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 May 13, 2021
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants