-
Notifications
You must be signed in to change notification settings - Fork 6.8k
perf(list-base): convert list-base adapter to class object #19983
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
Converts list-base adapter to class object to hopefully reduce memory usage
@andrewseguin @jelbourn should we adopt this style for all of the MDC adapters? We still need an instance per instance of the component, but at least all of the methods live on a single instance of the prototype this way |
I think the object literal pattern is used by MDC internally too. Should we sync up with them? |
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.
Yeah, we should probably bring it up with the MDC team, they might want to make the same change
LGTM
@@ -57,6 +57,46 @@ const RIPPLE_ANIMATION_CONFIG: RippleAnimationConfig = { | |||
exitDuration: numbers.FG_DEACTIVATION_MS, | |||
}; | |||
|
|||
/** Singleton check box adapter. */ | |||
class CheckBoxAdapter implements MDCCheckboxAdapter { |
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.
I would put the adapter classes in a separate file (each)
1f77a5b
to
73fc0b1
Compare
Fix linting issues and convert adapter method style to class methods
73fc0b1
to
3ff078d
Compare
@ngwattcos Would you like to continue with this PR? If so, can you rebase it? |
Our strategy going forward with adapters is changing soon that will make this PR obsolete |
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. |
Converts list-base adapter to class object to hopefully memory usage and increase performance
Test failures hopefully should be resolved after this PR is merged:
material-components/material-components-web#6256