284123c6ba
Close #36839. This is a known issue of zone.js, ``` (window as any)[(Zone as any).__symbol__('setTimeout')](() => { let log = ''; button.addEventListener('click', () => { Zone.current.scheduleMicroTask('test', () => log += 'microtask;'); log += 'click;'; }); button.click(); expect(log).toEqual('click;microtask;'); done(); }); ``` Since in this case, we use native `setTimeout` which is not a ZoneTask, so zone.js consider the button click handler as the top Task then drain the microTaskQueue after the click at once, which is not correct(too early). This case was an edge case and not reported by the users, until we have the new option ngZoneEventCoalescing, since the event coalescing will happen in native requestAnimationFrame, so it will not be a ZoneTask, and zone.js will consider any Task happen in the change detection stage as the top task, and if there are any microTasks(such as Promise.then) happen in the process, it may be drained earlier than it should be, so to prevent this situation, we need to schedule a fake event task and run the change detection check in this fake event task, so the Task happen in the change detection stage will not be considered as top ZoneTask. PR Close #36841 |
||
---|---|---|
.circleci | ||
.devcontainer | ||
.github | ||
.ng-dev | ||
.vscode | ||
.yarn | ||
aio | ||
dev-infra | ||
docs | ||
goldens | ||
integration | ||
modules | ||
packages | ||
scripts | ||
third_party | ||
tools | ||
.bazelignore | ||
.bazelrc | ||
.bazelversion | ||
.clang-format | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.mailmap | ||
.nvmrc | ||
.pullapprove.yml | ||
.yarnrc | ||
BUILD.bazel | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
README.md | ||
WORKSPACE | ||
browser-providers.conf.js | ||
gulpfile.js | ||
karma-js.conf.js | ||
package.json | ||
shims_for_IE.js | ||
test-events.js | ||
test-main.js | ||
tslint.json | ||
yarn.lock | ||
yarn.lock.readme.md |
README.md
Angular
Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages.
Quickstart
Changelog
Learn about the latest improvements.
Want to help?
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.