Skip to content

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

Closed
wants to merge 1 commit into from

Conversation

ngwattcos
Copy link
Contributor

@ngwattcos ngwattcos commented Jul 24, 2020

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

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jul 24, 2020
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

  1. The PR description is talking about the snack bar, but this includes changes to the checkbox and radio button.
  2. There are some test failures that need to be resolved.
  3. Either everything should be squashed under perf commit or the PR should be renamed to include perf(material-experimental/mdc-snackbar), otherwise the title will be incorrect when the caretaker squashes the commits.

@ngwattcos
Copy link
Contributor Author

@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);
Copy link
Collaborator

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;
Copy link
Collaborator

Choose a reason for hiding this comment

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

or this

@kseamon
Copy link
Collaborator

kseamon commented Jul 27, 2020

Note: The tests on this PR are going to fail until material-components/material-components-web#6256 is in effect on the MDC side.

@ngwattcos ngwattcos force-pushed the optimize-snack-bar branch from e1f27b3 to 2695e01 Compare July 27, 2020 17:22
@mmalerba mmalerba changed the title Optimize snack bar perf(material-experimental/mdc-snackbar): Use class for adapter Jul 27, 2020
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.

LGTM

@mmalerba mmalerba added lgtm action: merge The PR is ready for merge by the caretaker and removed action: merge The PR is ready for merge by the caretaker lgtm labels Jul 27, 2020
@andrewseguin andrewseguin removed the cla: yes PR author has agreed to Google's Contributor License Agreement label Dec 28, 2021
@andrewseguin
Copy link
Contributor

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

@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 May 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants