refactor(core): Async tagging zone dev#47416
refactor(core): Async tagging zone dev#47416JiaLiPassion wants to merge 1 commit intoangular:mainfrom
Conversation
4e239cf to
a1e0e54
Compare
a1e0e54 to
43cb391
Compare
There was a problem hiding this comment.
Overall LGTM.
One implementation nit is to consider doing this in one commit so this change is very clearly a move from zone.js to @angular/core, instead of a delete and add across two commits.
Two trade offs are being made here which I want to be explicit about:
- Moving
AsyncStackTaggingZoneSpecinto@angular/coremeans that other users of Zone can't get this debugging benefit.zone.jsis experimental I think and not recommended or widely used outside of Angular, so maybe we're just ok with that. - This change presents a required runtime dependency on Zone.js in Angular dev builds, which might cause trouble with users who run Angular without Zones.
AsyncStackTaggingZoneSpecwill always be tree shaken in prod mode, so it's not an issue there, but in dev mode it will be retained.- Technically
@angular/corealready has a required peer dep onzone.jsaccording topackage.json, but that's easy to ignore. With this change, I think it would be a hard error to not have azone.jspeer dep. - Do we understand the runtime impact of importing
AsyncStackTaggingZoneSpecwithout the rest ofzone.js? - If the runtime impact is a problem, then in google3 I think we'd need a patch to tree shake
AsyncStackTaggingZoneSpecusage out for zoneless use cases. I'm less certain of our options in the CLI without moving the import topolyfills.tsorenvironments.ts.
As long as we are ok with 1. and can make sure zoneless apps work in a reasonable fashion for 2., then I'm good with this change.
|
@dgp1130 , thank you for the review, I will make this PR into a single commit.
|
8c9510a to
64e08ba
Compare
dgp1130
left a comment
There was a problem hiding this comment.
SGTM @JiaLiPassion, thanks for clarifying the runtime impact for Zoneless users.
64e08ba to
1c349a6
Compare
There was a problem hiding this comment.
@JiaLiPassion thanks for addressing the feedback! Just left a tiny comment about the any type.
There was a problem hiding this comment.
@AndrewKushnir , thank you, forget this one, just updated and remove this any.
1. Remove `zone-async-tagging` implementation from zone.js and move the implementation to `@angular/core`, so `@angular/core` can import this package more easily for better treeshaking. 2. Add `async tagging zone` implemenation into `@angular/core` package. So we don't need to get the `AsyncStackTaggingZoneSpec` from `global` instance, we can import the `class` directly for better treeshaking. 3. Only load this ZoneSpec when `ngDevMode` is `true`.
1c349a6 to
ae0fabe
Compare
pkozlowski-opensource
left a comment
There was a problem hiding this comment.
LGTM
Reviewed-for: size-tracking
alxhub
left a comment
There was a problem hiding this comment.
Reviewed-for: global-approvers
|
This PR was merged into the repository by commit 8637253. |
) 1. Remove `zone-async-tagging` implementation from zone.js and move the implementation to `@angular/core`, so `@angular/core` can import this package more easily for better treeshaking. 2. Add `async tagging zone` implemenation into `@angular/core` package. So we don't need to get the `AsyncStackTaggingZoneSpec` from `global` instance, we can import the `class` directly for better treeshaking. 3. Only load this ZoneSpec when `ngDevMode` is `true`. PR Close angular#47416
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
zone-async-taggingimplementation from zone.js and move theimplementation to
@angular/core, so@angular/corecan import thispackage more easily for better treeshaking.
async tagging zoneimplemenation into@angular/corepackage.So we don't need to get the
AsyncStackTaggingZoneSpecfromglobalinstance, we can import the
classdirectly for better treeshaking.ngDevModeistrue.