Use lightweight token for tab group and select trigger#19728
Merged
devversion merged 4 commits intoangular:lightweight-token-optimizationsfrom Jun 23, 2020
Merged
Conversation
719ae28 to
befe0ca
Compare
The Angular Material tab group currently always retains `MatTabContent` and `MatTabLabel`. These are optional features of the tabs module and should only be retained when needed. To achieve this, we use lightweight tokens instead of the actual implementations when querying for a lazy content or label. This signifies an improvement of ~500b in the common case, and an increase (due to the lightweight tokens being provided) in the advanced case of ~140b. Related to angular#19576.
befe0ca to
41e3844
Compare
The select size test has slightly shifted already due to the recent Angular update. We are updating the golden here so that we can see the lightweight token effect in the followed commit for select.
The Angular Material always retains the `MatSelectTrigger` class. This is not ideal as this is an optional part of the select. The class itself is not large enough to contribute to any noticeable size impact, even with Ivy where factories/definitions are directly attached, but for the sake of completeness, and because custom triggers are assumed to be uncommon, a lightweight token is used for a small micro-optimization in the common case. Related to angular#19576.
41e3844 to
1d70b9c
Compare
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the last set of changes for lightweight tokens. I would consider the one for the select trigger a micro-optimization and I don't feel too confident about it, but I it's low-effort to use it there as a custom select trigger is used rarely (compared to using the standard one) I assume.