fix(material/schematics): don't drop prebuilt imports in theming API migration#22698
Conversation
…migration Currently the theming API migration drops any imports starting with `~@angular/material/`, assuming that they're Sass APIs. This can result in prebuilt style imports being removed by mistake. These changes add a regex based on which we'll exclude some imports from the migration. Fixes angular#22697.
Splaktar
left a comment
There was a problem hiding this comment.
Thank you for the quick PR on this!
| `@import '~@angular/material/prebuilt-themes/indigo-pink.css';`, | ||
| `@import '~@angular/cdk/overlay-prebuilt.css';`, |
There was a problem hiding this comment.
It should be possible to migrate these to the following
| `@import '~@angular/material/prebuilt-themes/indigo-pink.css';`, | |
| `@import '~@angular/cdk/overlay-prebuilt.css';`, | |
| `@use '@angular/material/prebuilt-themes/indigo-pink.css';`, | |
| `@use '@angular/cdk/overlay-prebuilt.css';`, |
Or is that something that you are depending upon the sass-migrator to do?
There was a problem hiding this comment.
I believe that imports of .css files are still supposed to go through @import.
There was a problem hiding this comment.
I thought that too at first, but found that they work fine with @use as long as the deprecated sass-loader feature of using ~ is not used.
If you've seen an official statement from the Sass team to the otherwise, please do let me know.
|
I'm not seeing any migrations/automatic updates happening when updating from 11 to 12 and I can't see any information anywhere as to when an update comes with a migration or not. Is there a list somewhere? There's no mention of it in the release notes for example. I don't know if I should just manually go through my SCSS and update the references or if it should be automatic. The release notes just seem to suggest re-reading the theming docs and doing it yourself:
|
|
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. |
Currently the theming API migration drops any imports starting with
~@angular/material/, assuming that they're Sass APIs. This can result in prebuilt style imports being removed by mistake.These changes add a regex based on which we'll exclude some imports from the migration.
Fixes #22697.