-
Notifications
You must be signed in to change notification settings - Fork 6.8k
perf(material-experimental/mdc-snackbar): Use class for adapter #20087
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
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 PR description is talking about the snack bar, but this includes changes to the checkbox and radio button.
- There are some test failures that need to be resolved.
- Either everything should be squashed under
perf
commit or the PR should be renamed to includeperf(material-experimental/mdc-snackbar)
, otherwise the title will be incorrect when the caretaker squashes the commits.
@crisbeto Yikes, not sure what happened here. I'll fix this asap |
@@ -248,7 +267,8 @@ export class MatCheckbox implements AfterViewInit, OnDestroy, ControlValueAccess | |||
// Note: We don't need to set up the MDCFormFieldFoundation. Its only purpose is to manage the | |||
// ripple, which we do ourselves instead. | |||
this.tabIndex = parseInt(tabIndex) || 0; | |||
this._checkboxFoundation = new MDCCheckboxFoundation(this._checkboxAdapter); | |||
this._adapter = new CheckBoxAdapter(this); |
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.
You can remove this line
} | ||
}, | ||
}; | ||
private _radioAdapter: MDCRadioAdapter; |
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.
or this
Note: The tests on this PR are going to fail until material-components/material-components-web#6256 is in effect on the MDC side. |
…performance and decrease memory usage
e1f27b3
to
2695e01
Compare
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
We will soon be taking out our dependency on the adapters provided by MDC since they won't be supported later. Thank you for your contribution, sorry we weren't able to land this |
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. |
Updates mdc-snack-bar-container to use a class-based adapter, which improves performance, just like in:
#19980
Hopefully, test failures will be resolved after this PR is merged:
material-components/material-components-web#6256