Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

fix(progressCircular): rAF is still running when using ng-show or ng-hide #10745

Open
feichao wants to merge 1 commit into angular:master
base: master
Choose a base branch
Loading
from feichao:master

Conversation

@feichao
Copy link

@feichao feichao commented Jun 16, 2017

fix(progressCircular): requestAnimationFrame is still running when using ng-show or ng-hide #10668

Splaktar and r-k-b reacted with thumbs up emoji
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@googlebot googlebot added the cla: no PR author needs to sign Google's CLA: https://opensource.google.com/docs/cla/ label Jun 16, 2017
Copy link
Author

feichao commented Jun 16, 2017

I signed it!

Copy link

CLAs look good, thanks!

@googlebot googlebot added cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ and removed cla: no PR author needs to sign Google's CLA: https://opensource.google.com/docs/cla/ labels Jun 16, 2017
Copy link
Contributor

@feichao - lgtm, thx.

Copy link
Contributor

Looks rather expensive to evaluate DOM attributes on every Angular tick. MutationObserver would give better performance.

Also, using ng-if instead of ng-show would solve the underlying issue, so a recommendation could be added in the documentation. Another alternative would be to only use the watcher if ng-show or ng-hide are being used.

@Splaktar Splaktar changed the title (削除) fix(progressCircular): requestAnimationFrame is still running when us... (削除ここまで) (追記) fix(progressCircular): rAF is still running when using ng-show or ng-hide (追記ここまで) Nov 18, 2017
Copy link
Contributor

@clshortfuse any ideas on how to use the watcher only when ng-show or ng-hide are being used?

@feichao can you please add some tests for this?
For example: Verify that the md-mode-indeterminate is applied after the element is displayed via toggling ng-show and verify that the md-mode-indeterminate is removed after the element is hidden via toggling ng-hide.

Copy link
Contributor

clshortfuse commented Nov 20, 2017
edited
Loading

@Splaktar Sure, you can use a MutationObserver to watch for the ng-show or ng-hide class. If the value exists then a watcher should be created to handle its computed value.

You can see a similar implementation created with md-visible with md-tooltip in #7822

Splaktar reacted with thumbs up emoji

@angular angular deleted a comment from googlebot Nov 21, 2017
@angular angular deleted a comment from googlebot Nov 21, 2017
Copy link
Contributor

Splaktar commented Nov 21, 2017
edited
Loading

@feichao Thank you very much for your contribution! Can you please update your implementation to only apply the watcher when ng-show or ng-hide are present as described in #10745 (comment)?

Since this whole PR is about performance, it would be best to use this more optimally performing approach.

@Splaktar Splaktar added needs: tests type: performance This issue is related to performance in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs and removed in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs needs: work labels Nov 21, 2017
@Splaktar Splaktar modified the milestones: 1.1.6, 1.1.7 Jan 17, 2018
Copy link
Contributor

We'll need to make sure that the MutationObserver has a fallback since we'll need to do something else on IE10.

@Splaktar Splaktar modified the milestones: 1.1.7, - Backlog Jan 30, 2018
@Splaktar Splaktar added needs: unit tests This PR needs unit tests to cover the changes being proposed and removed needs: tests labels Mar 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@clshortfuse clshortfuse Awaiting requested review from clshortfuse

Assignees

No one assigned

Labels

cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs needs: unit tests This PR needs unit tests to cover the changes being proposed type: performance This issue is related to performance

Projects

None yet

Milestone

- Backlog

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /