Skip to content
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

perf(focus-monitor): avoid triggering change detection if there are no subscribers to stream #14964

Merged
merged 1 commit into from
Feb 1, 2019

Conversation

crisbeto
Copy link
Member

Currently we have an NgZone.run call on each focus and blur event of a monitored element in order to bring its subscribers into the NgZone, however this means that we're also triggering change detection to any consumers that aren't subscribed to changes (e.g. mat-button only cares about the classes being applied). These changes move around some logic so that the NgZone.run is only hit if somebody has subscribed to the observable.

…o subscribers to stream

Currently we have an `NgZone.run` call on each `focus` and `blur` event of a monitored event in order to bring its subscribers into the `NgZone`, however this means that we're also triggering change detection to any consumers that aren't subscribed to changes (e.g. `mat-button` only cares about the classes being applied). These changes move around some logic so that the `NgZone.run` is only hit if somebody has subscribed to the observable.
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Jan 25, 2019
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jan 25, 2019
@mmalerba mmalerba added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Jan 25, 2019
@mmalerba mmalerba merged commit 085bbb7 into angular:master Feb 1, 2019
mmalerba added a commit that referenced this pull request Feb 4, 2019
…re are no subscribers to stream (#14964)"

This reverts commit 085bbb7.
mmalerba added a commit that referenced this pull request Feb 4, 2019
…re are no subscribers to stream" (#15076)

* Revert "fix(radio): unable to click to select button if text is marked (#14967)"

This reverts commit 5846038.

* Revert "perf(focus-monitor): avoid triggering change detection if there are no subscribers to stream (#14964)"

This reverts commit 085bbb7.
mmalerba pushed a commit that referenced this pull request Feb 4, 2019
…o subscribers to stream (#14964)

Currently we have an `NgZone.run` call on each `focus` and `blur` event of a monitored element in order to bring its subscribers into the `NgZone`, however this means that we're also triggering change detection to any consumers that aren't subscribed to changes (e.g. `mat-button` only cares about the classes being applied). These changes move around some logic so that the `NgZone.run` is only hit if somebody has subscribed to the observable.
mmalerba added a commit that referenced this pull request Feb 4, 2019
…re are no subscribers to stream" (#15076)

* Revert "fix(radio): unable to click to select button if text is marked (#14967)"

This reverts commit 5846038.

* Revert "perf(focus-monitor): avoid triggering change detection if there are no subscribers to stream (#14964)"

This reverts commit 085bbb7.
@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 Sep 10, 2019
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 target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants