-
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
bug(mdc-migration): Migrate components selectively is bugged #26426
Comments
Fixes mdc-migration to migrate only the selected components. Fixes angular#26426
I can confirm that this happens. It has resulted in me just having to do it all in one go and deal with the pain of making sure everything looks good. |
For anyone in this thread, there is one workaround that I have been using. Basically is 'patching' the mdc-migration directly on the '/node_modules' forlder, there is a quite easy way to do it. 1- Go to the file: var LEGACY_MODULES = new Set([
// "legacy-autocomplete",
// "legacy-autocomplete/testing",
"legacy-button",
"legacy-button/testing",
// "legacy-card",
// "legacy-card/testing",
// ........
]); This is just a workaround solution that you could use while this bug is not fixed. |
I confirm that have experienced the same bug |
In the case of using a custom theme file, I have noticed that it includes theme styles for all MDC components:
I wonder if it needs to be changed so that it includes only those styles that are used by the migrating components such as:
|
@bampakoa that seems more like a nice-to-have that is related to this issue. Nothing breaks when you include both all of the legacy and all of time MDC themes. That is because there is no cross-over between the two. However, selectively importing the styles of only the migrated components would save on bundle size if it isn't tree-shakable (I don't know if this is or not). |
Fixes mdc-migration to migrate only the selected components. Fixes angular#26426
Just encountered this myself. Thanks for jumping on it. |
Fixes mdc-migration to migrate only the selected components. Fixes angular#26426
Fixes mdc-migration to migrate only the selected components. Fixes angular#26426
Fixes mdc-migration to migrate only the selected components. Fixes angular#26426
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. |
Is this a regression?
The previous version in which this bug was not present was
No response
Description
When Migrating to MDC-based Angular Material Components, and doing it component by component, it should only migrate the selected components. Right now other components that are not selected are also migrated. Seems that it only happens on imports.
Take for example this ngModule code:
Right now, migrating this file selecting only the "button" migrates also the Checkbox. This should not happen.
Reproduction
Steps to reproduce:
Execute the migration for only "button" on this ngModule code:
Expected Behavior
Should migrate only selected components
Actual Behavior
Selectively migrating components is buggy and in some cases, like imports, other components are also migrated
Environment
The text was updated successfully, but these errors were encountered: