Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

feat(core): fix #1024, #513, #995, add a helper lib to configure root zone #1027

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JiaLiPassion
Copy link
Collaborator

fix #1024, #513, #995
Add a help lib to configure root zone. It is a monkey-patch to zone (some kind of hack). And it is a lib need to be loaded by user themselves, so zone public API will not be damaged.

  • this is not a public api or formal feature of zone.js
  • it will not be included in future tc39 proposal,
  • and it is not by design, it is just a helper method to let you customize rootZone for some test and suppose to change in the future, please use it on your own risk

@mhevery , please review the idea is ok or not, I know it is not correct according to the design of Zone, but there a some use cases that user want to do that, so with or without this lib, user can still monkey-patch Zone to customize root zone, so I just provide the helper tool for them. thank you.

@mhevery
Copy link
Contributor

mhevery commented Mar 14, 2018

Not sure how I feel about this. Let me think about it...

@mleibman
Copy link
Contributor

FWIW, we ended up needing to customize a root zone in in GCP Console, but we currently do it via monkey-patching.

For us, it bridges the gap in the Zone.js API where interception is based purely on the current zone, but zone configuration is fairly static. For Angular, it captures the 'outer' zone at start up, so any code calling NgZone.runOutsideAngular() would fall back to that and escape the interceptors added on by forking the 'inner' Angular zone.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Could not intercept requestAnimationFrame from Google Maps
4 participants