Skip to content

Commit

Permalink
feat(core): import AsyncStackTaggingZone if available
Browse files Browse the repository at this point in the history
Import `AsyncStackTaggingZoneSpec` if the user imported
`zone.js/plugins/async-stack-tagging` bundle. So the user can
use `console.trace` to output the `async task` information more
clearly.
  • Loading branch information
JiaLiPassion committed Jul 4, 2022
1 parent 628d802 commit 06dd4ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions goldens/size-tracking/integration-payloads.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cli-hello-world": {
"uncompressed": {
"runtime": 1083,
"main": 125325,
"main": 125830,
"polyfills": 33824
}
},
Expand All @@ -19,14 +19,14 @@
"cli-hello-world-ivy-compat": {
"uncompressed": {
"runtime": 1102,
"main": 132311,
"main": 132816,
"polyfills": 33957
}
},
"cli-hello-world-ivy-i18n": {
"uncompressed": {
"runtime": 926,
"main": 124982,
"main": 125487,
"polyfills": 35252
}
},
Expand Down Expand Up @@ -55,7 +55,7 @@
"standalone-bootstrap": {
"uncompressed": {
"runtime": 1090,
"main": 83013,
"main": 83515,
"polyfills": 33945
}
},
Expand Down
5 changes: 5 additions & 0 deletions packages/core/src/zone/ng_zone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ export class NgZone {

self._outer = self._inner = Zone.current;

if ((Zone as any)['AsyncStackTaggingZoneSpec']) {
const AsyncStackTaggingZoneSpec = (Zone as any)['AsyncStackTaggingZoneSpec'];
self._inner = self._inner.fork(new AsyncStackTaggingZoneSpec('Angular'));
}

if ((Zone as any)['TaskTrackingZoneSpec']) {
self._inner = self._inner.fork(new ((Zone as any)['TaskTrackingZoneSpec'] as any));
}
Expand Down

0 comments on commit 06dd4ec

Please sign in to comment.