-
Notifications
You must be signed in to change notification settings - Fork 27.4k
perf($interpolate/$compile): port optimization from dart #6598
perf($interpolate/$compile): port optimization from dart #6598
Conversation
It any one expression changes then the listener function fires Port of dart-archive/angular.dart@a3c31ce
Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.
If you need to make changes to your pull request, you can update the commit with Thanks again for your help! |
if (fns.parts) { | ||
fns = fns.parts; | ||
if (fns.expressions) { | ||
fns = fns.expressions; |
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.
@juliemr would this change also affect protractor? how do you introspect interpolations in protractor?
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.
This should not require a change in Protractor. Protractor currently uses the element's data
function and gets data('$binding').exp
, which has not changed in this PR from what I see.
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.
thanks!
As per #6776, I'd like to weigh in and suggest the |
@valtron we'd like to avoid overloading the |
BREAKING CHANGE: the function returned by $interpolate no longer has a `.parts` array set on it. It has been replaced by two arrays: * `.expressions`, an array of the expressions in the interpolated text. The expressions are parsed with $parse, with an extra layer converting them to strings when computed * `.separators`, an array of strings representing the separations between interpolations in the text. This array is **always** 1 item longer than the `.expressions` array for easy merging with it
landed as #7158 |
Motivated by #4556 (comment)
More info about the optimization can be found in that PR.
Brief description:
This PR makes that given text like:
{{a}} text {{b}}
Instead of computing the whole string on each digest for dirty-checking,
We watch each expression individually, and only concatenate stuff when something changes.
To accomplish this, we use
$scope.$watchSet
. It has been implemented in AngularDart, but has been removed recently in favor of the change_detection libEdit: Travis tests are failing because npm failed? I'll try to have travis run again tomorrow