-
Notifications
You must be signed in to change notification settings - Fork 27.4k
perf(ngStyleDirective): use $watchCollection #15947
Conversation
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
1 similar comment
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
👍 for waiting until #15905 is resolved. |
Interestingly, there's no test for normal literal bindings:
|
29e6e9a
to
4340662
Compare
I think this can go into 1.7 now @gkalpak? |
Note: this will break cases where people are relying on a value being an object and automatically invoking |
4340662
to
8184f1d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed "offline", this is good-to-go for 1.7 (with the breaking change notice) 👍
8184f1d
to
a41cacf
Compare
Since we are simply watching a flat object collection it is more performant to use $watchCollection than a deepWatch... BREAKING CHANGE: Previously the use of deep watch by ng-style would trigger styles to be re-applied when nested state changed. Now only changes to direct properties of the watched object will trigger changes. Closes angular#15947
I've updated the commit message with a "BREAKING CHANGE" message and changed the "Closes #" to this PR. Look good? |
a41cacf
to
b5b798b
Compare
Should there be a test for the case that is described in the BC notice? |
A test verifying that styles don't get re-applied when an object sub-property changes? Could... |
Just because we are setting an expectation for this behavior |
I've added a test. The other option is verifying that |
LGTM |
Since we are simply watching a flat object collection it is more performant to use $watchCollection than a deepWatch... BREAKING CHANGE: Previously the use of deep watch by ng-style would trigger styles to be re-applied when nested state changed. Now only changes to direct properties of the watched object will trigger changes. Closes angular#15947
c25ee8d
to
3acfe2c
Compare
3acfe2c
to
f736f94
Compare
Since we are simply watching a flat object collection it is more performant to use $watchCollection than a deepWatch... BREAKING CHANGE: Previously the use of deep watch by ng-style would trigger styles to be re-applied when nested state changed. Now only changes to direct properties of the watched object will trigger changes. Closes #15947
nice |
A tiny change with potentially big gains 😃 |
This re-commits 4c8d8ad which was reverted (with tests added). This is possible now because of 189461f, although note that change is currently causing #15905 so maybe we should hold off on merging this one for now?
FYI @gdi2290