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

refactor(material/button): simplify host bindings #30630

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

crisbeto
Copy link
Member

Following up on #30626 (comment), these changes move the button's shared host bindings into the base class and turn some classes that are added manually into host bindings.

The previous approach was only necessary with ViewEngine, because it wasn't doing inheritance of host bindings correctly and wasn't merging classes. These are no longer issues in Ivy.

Finally, these changes allow us to take advantage of an upcoming framework feature: angular/angular#60267

Following up on angular#30626 (comment), these changes move the button's shared host bindings into the base class and turn some classes that are added manually into host bindings.

The previous approach was only necessary with ViewEngine, because it wasn't doing inheritance of host bindings correctly and wasn't merging classes. These are no longer issues in Ivy.

Finally, these changes allow us to take advantage of an upcoming framework feature: angular/angular#60267
@crisbeto crisbeto added the target: major This PR is targeted for the next major release label Mar 14, 2025
@crisbeto crisbeto requested a review from andrewseguin March 14, 2025 07:48
@crisbeto crisbeto requested a review from a team as a code owner March 14, 2025 07:48
@crisbeto crisbeto requested review from wagnermaciel and removed request for a team March 14, 2025 07:48
{
"argument": 0,
"properties": {
"!host": "\\[class\\]"
Copy link
Member Author

Choose a reason for hiding this comment

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

Context for this lint check is that [class] bindings in ViewEngine would clobber static classes. This isn't the case with Ivy and we actually had a binding like this for a while in the MAT_BUTTON_HOST constant, the lint rule just wasn't picking it up.

@crisbeto crisbeto removed the request for review from wagnermaciel March 17, 2025 05:56
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Mar 17, 2025
@crisbeto crisbeto merged commit b088604 into angular:main Mar 17, 2025
22 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: material/button target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants