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

Mdc migration #232

Merged
merged 55 commits into from
Mar 19, 2023
Merged

Mdc migration #232

merged 55 commits into from
Mar 19, 2023

Conversation

PowerKiKi
Copy link
Member

No description provided.

PowerKiKi and others added 19 commits February 1, 2023 19:18
Via `ng generate @angular/material:mdc-migration`
Especially `mat-icon-button` will crash at runtime if used in
combination with any other `mat-*button`.

That also means that out of the box we cannot have a raised
`mat-icon-button`. So we reproduce the result by applying the new custom
classes such as `icon-button-circle-accent` for icon with color, or
alternatively the existing class `mat-elevation-z4` for an icon without
color.
`matLine` was mis-used, and its equivalent `matListItemLine` is not what
 we want in most cases. Instead, we usually need `matListItemTitle`,
 except that it is not even mandatory to specify it.
Tab stretching is a terrible UX where words float in the middle of
nowhere, making it extremely hard to understand their purpose in best
case scenario.

In the worst case scenario, then the second/third tab name will
accidentally align with the blocks contained in the first (selected) tab.
So the second/third tab name will actually look like they are the title
of the first tab content 🤮

Also, the fact that we lost the very fine line underlining the whole tab
group really makes the situation worse, but I guess we can at least live
that absence.
PowerKiKi and others added 24 commits March 2, 2023 16:01
It's mostly the same as the default Material, with the only exception of
 button's letter-spacing
We lose the possibility to set a label, but that was never used at all.
And instead we gain a much easier interoperability with `<mat-icon>`
special layouting done by Angular Material.

In most cases `[size]` probably should not be used anymore, since
Angular Material will do the work for us. But we keep it for corner
cases.
This would show no icon at all
`satisfies` rejects extra properties, which tends to be good thing for
us, especially when we write some kind of configuration value. Eg:

```diff
- {a: 1, extraProp: 2} as Config; // incorrectly compiles
+ {a: 1, extraProp: 2} satisfies Config; // correctly error at compile time
```

Also, `as` is also too permissive and might accept totally wrong type in
 some cases, such as:

```diff
- condition: {equal: {value: true}} as ProductFilterGroupCondition,
+ condition: {equal: {value: true}} satisfies ProductFilterGroupConditionIsActive,
```
We use the standard `align="end"` instead of custom mechanic. This
should be de default of Angular Component, but it is not yet, see
angular/components#13620
@PowerKiKi PowerKiKi merged commit bdd6a21 into master Mar 19, 2023
@PowerKiKi PowerKiKi deleted the mdc-migration branch March 19, 2023 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants