-
Notifications
You must be signed in to change notification settings - Fork 6.8k
perf(mdc-chips): Use class for MDC adapter #19981
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
This change replaces the private adapter wth an adapter class object which should hopefully reduce memory usage.
Makes the adapter into a class in MatChipSet and MatChipListbox to hopefully improve memory usage.
Updates chip adapter into a class object to reduce memory usage
@@ -373,6 +389,11 @@ export class MatChip extends _MatChipMixinBase implements AfterContentInit, Afte | |||
this._chipFoundation.destroy(); | |||
} | |||
|
|||
/** Returns the directionality */ | |||
getDir() { |
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.
just make _dir
public instead (leave the underscore in the name)
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 got another comment saying to use a method unless it's readonly in a separate PR:
#19985 (comment)
Perhaps the best way is to append an underscore so the method name is _getDir() ?
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.
Update: exposed _dir and made it readonly
perf(chip-set, chip-listbox) make adapter into a class
perf(chips): replace private adapter object with adapter class object
…ir as public readonly, resolve requests for changes on PR
Code looks good, but there's some lint and test failures |
Closing due to inactivity |
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. |
Convert the adapters in chips, chip-set, chip-listbox, mat-chipset to class objects to hopefully reduce memory usage.
Test failures hopefully should be resolved after this PR is merged:
material-components/material-components-web#6256