This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Commit fd4f011
perf($compile): do not use deepWatch in literal one-way bindings
Avoiding deep watchers for array/object literals will improve watcher
performance of all literals passed as one-way bindings, especially those
containing references to large/complex objects.
BREAKING CHANGE:
Previously when a literal value was passed into a directive/component via
one-way binding it would be watched with a deep watcher.
For example, for `<my-component input="[a]">`, a new instance of the array
would be passed into the directive/component (and trigger $onChanges) not
only if `a` changed but also if any sub property of `a` changed such as
`a.b` or `a.b.c.d.e` etc.
This also means a new but equal value for `a` would NOT trigger such a
change.
Now literal values use an input-based watch similar to other directive/component
one-way bindings. In this context inputs are the non-constant parts of the
literal. In the example above the input would be `a`. Changes are only
triggered when the inputs to the literal change.
Closes #153011 parent 7084dec commit fd4f011
2 files changed
+77
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3523 | 3523 | | |
3524 | 3524 | | |
3525 | 3525 | | |
3526 | | - | |
| 3526 | + | |
3527 | 3527 | | |
3528 | 3528 | | |
3529 | 3529 | | |
3530 | 3530 | | |
3531 | 3531 | | |
3532 | 3532 | | |
3533 | | - | |
| 3533 | + | |
3534 | 3534 | | |
3535 | 3535 | | |
3536 | 3536 | | |
3537 | 3537 | | |
3538 | 3538 | | |
3539 | 3539 | | |
3540 | | - | |
| 3540 | + | |
3541 | 3541 | | |
3542 | 3542 | | |
3543 | 3543 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4306 | 4306 | | |
4307 | 4307 | | |
4308 | 4308 | | |
| 4309 | + | |
| 4310 | + | |
| 4311 | + | |
| 4312 | + | |
| 4313 | + | |
| 4314 | + | |
| 4315 | + | |
| 4316 | + | |
| 4317 | + | |
| 4318 | + | |
| 4319 | + | |
| 4320 | + | |
| 4321 | + | |
| 4322 | + | |
| 4323 | + | |
| 4324 | + | |
| 4325 | + | |
| 4326 | + | |
| 4327 | + | |
| 4328 | + | |
| 4329 | + | |
| 4330 | + | |
| 4331 | + | |
| 4332 | + | |
| 4333 | + | |
| 4334 | + | |
| 4335 | + | |
| 4336 | + | |
| 4337 | + | |
| 4338 | + | |
| 4339 | + | |
| 4340 | + | |
| 4341 | + | |
| 4342 | + | |
| 4343 | + | |
| 4344 | + | |
| 4345 | + | |
| 4346 | + | |
| 4347 | + | |
| 4348 | + | |
| 4349 | + | |
| 4350 | + | |
| 4351 | + | |
| 4352 | + | |
| 4353 | + | |
| 4354 | + | |
| 4355 | + | |
| 4356 | + | |
| 4357 | + | |
| 4358 | + | |
| 4359 | + | |
| 4360 | + | |
| 4361 | + | |
| 4362 | + | |
| 4363 | + | |
| 4364 | + | |
| 4365 | + | |
| 4366 | + | |
| 4367 | + | |
| 4368 | + | |
| 4369 | + | |
| 4370 | + | |
| 4371 | + | |
| 4372 | + | |
| 4373 | + | |
| 4374 | + | |
| 4375 | + | |
| 4376 | + | |
| 4377 | + | |
| 4378 | + | |
| 4379 | + | |
| 4380 | + | |
4309 | 4381 | | |
4310 | 4382 | | |
4311 | 4383 | | |
| |||
5832 | 5904 | | |
5833 | 5905 | | |
5834 | 5906 | | |
5835 | | - | |
| 5907 | + | |
5836 | 5908 | | |
5837 | 5909 | | |
5838 | 5910 | | |
| |||
5846 | 5918 | | |
5847 | 5919 | | |
5848 | 5920 | | |
5849 | | - | |
| 5921 | + | |
5850 | 5922 | | |
5851 | 5923 | | |
5852 | 5924 | | |
| |||
0 commit comments