angular-docs-cn/packages/platform-browser/test
JiaLiPassion 5e92d649f2 feat(core): add shouldCoalesceRunChangeDetection option to coalesce change detections in the same event loop. (#39422)
Close #39348

Now `NgZone` has an option `shouldCoalesceEventChangeDetection` to coalesce
multiple event handler's change detections to one async change detection.

And there are some cases other than `event handler` have the same issues.
In #39348, the case like this.

```
// This code results in one change detection occurring per
// ngZone.run() call. This is entirely feasible, and can be a serious
// performance issue.
for (let i = 0; i < 100; i++) {
  this.ngZone.run(() => {
    // do something
  });
}
```

So such kind of case will trigger multiple change detections.
And now with Ivy, we have a new `markDirty()` API will schedule
a requestAnimationFrame to trigger change detection and also coalesce
the change detections in the same event loop, `markDirty()` API doesn't
only take care `event handler` but also all other cases `sync/macroTask/..`

So this PR add a new option to coalesce change detections for all cases.

test(core): add test case for shouldCoalesceEventChangeDetection option

Add new test cases for current `shouldCoalesceEventChangeDetection` in `ng_zone.spec`, since
currently we only have integration test for this one.

PR Close #39422
2020-11-16 08:58:50 -08:00
..
browser build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
dom feat(core): add shouldCoalesceRunChangeDetection option to coalesce change detections in the same event loop. (#39422) 2020-11-16 08:58:50 -08:00
security build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
static_assets refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
BUILD.bazel build: enable platform-browser tests on Saucelabs (#36797) 2020-04-28 15:10:27 -07:00
browser_util_spec.ts test(platform-browser): remove IE9 and IE10 checks from tests (#39090) 2020-10-13 15:51:48 -07:00
testing_public_spec.ts fix(core): ensure TestBed is not instantiated before override provider (#38717) 2020-09-22 15:03:44 -07:00