feat: add zone configuration to typescript interface#35329
feat: add zone configuration to typescript interface#35329JiaLiPassion wants to merge 1 commit intoangular:masterfrom
Conversation
|
|
1d87c20 to
466366e
Compare
|
@mhevery, thanks for the review, I have updated the doc. |
kapunahelewong
left a comment
There was a problem hiding this comment.
Just small adjustments. Stoppping here to see if all the comments will go through.
Note: For context, last time I had too many comments and had to duplicate my work in the file itself because github wouldn't post my review.
There was a problem hiding this comment.
| * Zone.js will not monkey patch Object.defineProperty API and will not | |
| * Zone.js does not monkey patch the `Object.defineProperty` API and does not |
There was a problem hiding this comment.
| * try to modify desc.configurable to true. | |
| * try to modify desc.configurable to `true`. |
There was a problem hiding this comment.
| * Disable registerElement monkey patch. | |
| * Disable the `registerElement` monkey patch. |
There was a problem hiding this comment.
| * Only available in legacy bundle (dist/zone.js), this defineProperty module will not be | |
| * Only available in the legacy bundle (`dist/zone.js`), `this defineProperty` module is not |
There was a problem hiding this comment.
| * available in evergreen bundle (zone-evergreen.js). | |
| * available in the evergreen bundle (`zone-evergreen.js`). |
kapunahelewong
left a comment
There was a problem hiding this comment.
Just small adjustments. Stoppping here to see if all the comments will go through.
Note: For context, last time I had too many comments and had to duplicate my work in the file itself because github wouldn't post my review.
466366e to
195777c
Compare
|
@kapunahelewong , thank you for the detailed review, I have updated the PR, please review. |
195777c to
2f71a72
Compare
bac83f6 to
807f3c9
Compare
There was a problem hiding this comment.
Why is this called timers not setTimeout? What other times are we disabling?
There was a problem hiding this comment.
in this module, we disable setTimeout/setInterval/setImmediate.
There was a problem hiding this comment.
really why is registerElement not available in evergreen?
There was a problem hiding this comment.
Because registerElement is deprecated, and we now only including customElement.define monkey patch for web component.
There was a problem hiding this comment.
Same here, why is it not available in evergreen Could you add explanation to the reasoning behind it?
There was a problem hiding this comment.
Sure, I will add more doc here, the reason we don't monkey patch legacy EventTarget like APIs here because in modern browsers, the EventTarget is available, so we only need to monkey patch EventTarget, we don't need to monkey patch such as HTMLDivElement class one by one.
There was a problem hiding this comment.
Are there other timeres besides setTimeout? if not why not __Zone_disable_setTimeout?
There was a problem hiding this comment.
in nodejs, we also patch setTimeout/setInterval/setImmediate.
33b6100 to
17263e1
Compare
17263e1 to
a2e0647
Compare
a2e0647 to
1e081c4
Compare
1e081c4 to
404a2a5
Compare
|
Hi @JiaLiPassion, there was a conflict with the patch branch so I modified this PR to target master only. Can you create a follow-up PR that targets patch-only? |
|
@atscott , got it, thanks, I will create a separate PR, and will DM you for the details. |
aikithoughts
left a comment
There was a problem hiding this comment.
Edit pass for readability.
|
@JiaLiPassion Can you open a follow-up PR to address @aikidave's comments? |
|
@kara, sure, will do it now. thanks. |
| * Users can achieve this goal by defining `__zone_symbol__UNPATCHED_EVENTS = ['scroll', | ||
| * 'mousemove'];` before imporing `zone.js`. | ||
| */ | ||
| __zone_symbol__UNPATCHED_EVENTS?: boolean; |
There was a problem hiding this comment.
@JiaLiPassion __zone_symbol__UNPATCHED_EVENTS and __zone_symbol__PASSIVE_EVENTS should be a string[] instead of boolean, shouldn't?
Thanks for add types to zone.js, it's awesome 🎉
There was a problem hiding this comment.
Oh, yes, you are right, thanks for finding this issue, will create PR to resolve it.
|
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. |


PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Add all zone.js configuration to interface, so we can define those flags in
polyfills.tslike this.