-
Notifications
You must be signed in to change notification settings - Fork 6.8k
docs: add an MDC migration guide #25543
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
Conversation
|
||
Depending on the size and complexity of your app, you may want to migrate a single component (or | ||
small group of components) at a time, rather than all at once. | ||
TODO(wagnermaciel): Add details on this: script params, which components need to move together |
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.
The only group of components that need to be migrated together are autocomplete, form-field, input, and select (https://github.com/angular/components/blob/main/src/material/schematics/ng-generate/mdc-migration/index.ts#L21)
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.
I see, and what happens if I do ng generate @angular/material:mdc-migration --component input
? Does that migrate the whole group or do they have to do ng generate @angular/material:mdc-migration --component input,form-field,autocomplete,select
?
identified. | ||
|
||
```ts | ||
// TODO(wagnermaciel): Do we have a common format for all TODOs the script adds? |
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.
For styles, its "TODO: The following rule targets internal classes of COMPONENT_NAME that may no longer apply for the MDC version". (https://github.com/angular/components/blob/main/src/material/schematics/ng-generate/mdc-migration/rules/style-migrator.ts#L183)
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.
Styles are the only places we add these todos
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.
We should change it to generate a more searchable TODO, e.g. TODO(MDC):
. I'm surprised there's no TODO for templates that use chips-list, are we able to figure out what new version of chips to change them to?
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.
Yep! It was tricky but we got it working
|
||
Depending on the size and complexity of your app, you may want to migrate a single component (or | ||
small group of components) at a time, rather than all at once. | ||
TODO(wagnermaciel): Add details on this: script params, which components need to move together |
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.
The 3 params are the tsconfig, the directory that will be migrated, and the list of the components (https://github.com/angular/components/blob/main/src/material/schematics/ng-generate/mdc-migration/schema.json).
Right now the integration test's command looks like this:
ng generate @angular/material:mdc-migration --components all --tsconfig tsconfig.app.json (https://github.com/angular/components/blob/main/integration/mdc-migration/migration-test.bzl#L34)
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.
It'd be good to add an example of migrating specific components as well
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.
What happens if I don't specify any of the params and just do ng generate @angular/material:mdc-migration
do they default to something? does it prompt me?
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.
I'm 99% sure it does prompt you but @amysorto would know for certain
5ae81ae
to
455af0b
Compare
There's still lots of work to be done on this guide, but I'm marking the PR as ready because I'd like to do an initial review and get this in. Then we can divy up the detailed changes section and have everyone contribute improvements |
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.
hopping into a meeting, will continue reviewing afterwards
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 on this iteration- we can make tweaks once this is in
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. |
No description provided.