镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

refactor: provide and use light-weight token for button-toggle group - #19591

Merged
devversion merged 2 commits into
angular:lightweight-token-optimizationsfrom
devversion:wip/light-weight-tokens-2
Jun 17, 2020
Merged

devversion merged 2 commits into
angular:lightweight-token-optimizationsfrom
devversion:wip/light-weight-tokens-2

Conversation

@devversion

Copy link
Copy Markdown
Member

The MatButtonToggleGroup component is not always used in applications. e.g.
it's an optional part, and standalone button toggles are totally valid.

Currently though, we always reference the MatButtonToggleGroup component
directly as a value, and it will be retained in applications regardless
of the usage.

We can improve this by providing a light-weight injection token for
the button-toggle group that we can then use DI injection to avoid
full retention of the class.

This obviously was already an issue in View Engine too, but it became
significantly worse in Ivy as factories are now directly attached to
the component class.

Related to: #19576.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jun 10, 2020
@devversion
devversion force-pushed the wip/light-weight-tokens-2 branch from ad2ad28 to ffd2301 Compare June 10, 2020 13:33
@devversion devversion added merge: preserve commits When the PR is merged, a rebase and merge should be performed target: patch This PR is targeted for the next patch release labels Jun 10, 2020
@devversion
devversion marked this pull request as ready for review June 10, 2020 13:48
@devversion
devversion requested a review from jelbourn as a code owner June 10, 2020 13:48
@devversion
devversion requested a review from a team June 10, 2020 13:48

@crisbeto crisbeto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@crisbeto crisbeto added the lgtm label Jun 10, 2020

@jelbourn jelbourn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, just needs rebase

@devversion
devversion force-pushed the wip/light-weight-tokens-2 branch from ffd2301 to 1173164 Compare June 12, 2020 08:15
@devversion devversion added action: merge The PR is ready for merge by the caretaker needs rebase labels Jun 12, 2020
@devversion
devversion force-pushed the wip/light-weight-tokens-2 branch from 1173164 to 8b9c2b9 Compare June 15, 2020 08:52
@devversion devversion added P2 The issue is important to a large percentage of users, with a workaround and removed needs rebase labels Jun 15, 2020
@devversion
devversion removed the request for review from a team June 15, 2020 11:26
@devversion
devversion force-pushed the wip/light-weight-tokens-2 branch from 8b9c2b9 to 3d576cd Compare June 16, 2020 19:26
The `MatButtonToggleGroup` component is not always used in applications. e.g.
it's an optional part, and standalone button toggles are totally valid.

Currently though, we always reference the `MatButtonToggleGroup` component
directly as a value, and it will be retained in applications regardless
of the usage.

We can improve this by providing a light-weight injection token for
the button-toggle group that we can then use DI injection to avoid
full retention of the class.

This obviously was already an issue in View Engine too, but it became
significantly worse in Ivy as factories are now directly attached to
the component class.

Related to: angular#19576.
@devversion
devversion force-pushed the wip/light-weight-tokens-2 branch from 3d576cd to ddd3aa9 Compare June 17, 2020 17:11
@devversion
devversion requested a review from mmalerba as a code owner June 17, 2020 17:11
@devversion
devversion changed the base branch from master to lightweight-token-optimizations June 17, 2020 17:11
@devversion
devversion merged commit 12610d7 into angular:lightweight-token-optimizations Jun 17, 2020
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 Jul 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement merge: preserve commits When the PR is merged, a rebase and merge should be performed P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants