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

Remove most remaining usages of TypeScript mixins #28048

Merged
merged 16 commits into from
Nov 6, 2023

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Nov 3, 2023

These changes remove all the remaining usages of mixinColor, mixinDisabled, mixinDisableRipple and mixinTabindex in favor of using input transforms and host bindings. There are still some usages of mixinErrorState and mixinInitialized that have to be migrated separately.

I've made this refactor, because:

  1. We need to switch away from mixinColor, because it uses direct DOM manipulation. This is problematic for future hydration and SSR efforts.
  2. Mixins add a lot of boilerplate, increase the prototype chain and can be difficult to reason about. mixinDisabled, mixinDisableRipple and mixinTabindex were only used for input coercion which can be replaced with input transforms.

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent merge: preserve commits When the PR is merged, a rebase and merge should be performed target: rc This PR is targeted for the next release-candidate labels Nov 3, 2023
@crisbeto crisbeto marked this pull request as ready for review November 3, 2023 06:45
@crisbeto crisbeto force-pushed the remaining-mixins branch 2 times, most recently from a902f24 to 2c2e657 Compare November 3, 2023 10:37
@josephperrott josephperrott removed their request for review November 3, 2023 14:54
Copy link
Contributor

@mmalerba mmalerba left a comment

Choose a reason for hiding this comment

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

We should consider deprecating and removing these mixins in the future

@crisbeto crisbeto force-pushed the remaining-mixins branch 2 times, most recently from ddbf094 to 0b4310f Compare November 3, 2023 18:01
Reworks the chips to use input transforms instead of mixins.
Reworks the select to use input transforms instead of mixins.
Reworks the expansion panel to use input transforms instead of mixins.
Reworks the CDK tree to use input transforms instead of getters and setters.
Reworks the Material tree to use input transforms instead of mixins.
Reworks the radio button to use input transforms instead of mixins.
Reworks the tabs to use input transforms instead of mixins.
Reworks the slider to use input transforms instead of mixins.
Reworks the sort header to use input transforms instead of mixins.
Reworks the datepicker to use input transforms instead of mixins.
Reworks the paginator to use input transforms instead of mixins.
Reworks the toolbar to use input transforms instead of mixins.
Reworks the icon to use input transforms instead of mixins.
Reworks the stepper to use input transforms instead of mixins.
Reworks the progress spinner to use input transforms instead of mixins.
Reworks the progress bar to use input transforms instead of mixins.
@crisbeto crisbeto self-assigned this Nov 3, 2023
@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release and removed target: rc This PR is targeted for the next release-candidate labels Nov 3, 2023
@crisbeto crisbeto merged commit b27ec4b into angular:main Nov 6, 2023
28 checks passed
@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 Dec 7, 2023
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 merge: preserve commits When the PR is merged, a rebase and merge should be performed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants