Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Conversation

@feichao
Copy link

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

@googlebot
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.

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

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@googlebotgooglebot 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
@ThomasBurleson
Copy link
Contributor

@feichao - lgtm, thx.

@clshortfuse
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.

@ThomasBurlesonThomasBurleson modified the milestones: 1.1.6, 1.1.5Aug 3, 2017
@SplaktarSplaktar changed the title fix(progressCircular): requestAnimationFrame is still running when us…fix(progressCircular): rAF is still running when using ng-show or ng-hideNov 18, 2017
@Splaktar
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.

@clshortfuse
Copy link
Contributor

clshortfuse commented Nov 20, 2017

@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

@angularangular deleted a comment from googlebotNov 21, 2017
@angularangular deleted a comment from googlebotNov 21, 2017
@Splaktar
Copy link
Contributor

Splaktar commented Nov 21, 2017

@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.

@SplaktarSplaktar 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
@SplaktarSplaktar modified the milestones: 1.1.6, 1.1.7Jan 17, 2018
@Splaktar
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.

@SplaktarSplaktar modified the milestones: 1.1.7, - BacklogJan 30, 2018
@SplaktarSplaktar 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 freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yesPR author has signed Google's CLA: https://opensource.google.com/docs/cla/in progressMainly for in progress PRs, but may be used for issues that require multiple PRsneeds: unit testsThis PR needs unit tests to cover the changes being proposedtype: performanceThis issue is related to performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@feichao@googlebot@ThomasBurleson@clshortfuse@Splaktar