Skip to content

Commit 19e6d9c

Browse files
JiaLiPassionthePunderWoman
authored andcommitted
feat(core): import AsyncStackTaggingZone if available (#46693)
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. PR Close #46693
1 parent 848a009 commit 19e6d9c

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

goldens/size-tracking/aio-payloads.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"aio-local": {
1313
"uncompressed": {
1414
"runtime": 4325,
15-
"main": 459842,
15+
"main": 460353,
1616
"polyfills": 33922,
1717
"styles": 73640,
1818
"light-theme": 78276,

goldens/size-tracking/integration-payloads.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cli-hello-world": {
33
"uncompressed": {
44
"runtime": 1083,
5-
"main": 125325,
5+
"main": 125830,
66
"polyfills": 33824
77
}
88
},
@@ -19,14 +19,14 @@
1919
"cli-hello-world-ivy-compat": {
2020
"uncompressed": {
2121
"runtime": 1102,
22-
"main": 132311,
22+
"main": 132816,
2323
"polyfills": 33957
2424
}
2525
},
2626
"cli-hello-world-ivy-i18n": {
2727
"uncompressed": {
2828
"runtime": 926,
29-
"main": 124982,
29+
"main": 125487,
3030
"polyfills": 35252
3131
}
3232
},
@@ -55,7 +55,7 @@
5555
"standalone-bootstrap": {
5656
"uncompressed": {
5757
"runtime": 1090,
58-
"main": 83013,
58+
"main": 83515,
5959
"polyfills": 33945
6060
}
6161
},

packages/core/src/zone/ng_zone.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ export class NgZone {
138138

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

141+
if ((Zone as any)['AsyncStackTaggingZoneSpec']) {
142+
const AsyncStackTaggingZoneSpec = (Zone as any)['AsyncStackTaggingZoneSpec'];
143+
self._inner = self._inner.fork(new AsyncStackTaggingZoneSpec('Angular'));
144+
}
145+
141146
if ((Zone as any)['TaskTrackingZoneSpec']) {
142147
self._inner = self._inner.fork(new ((Zone as any)['TaskTrackingZoneSpec'] as any));
143148
}

0 commit comments

Comments
 (0)