Uh oh!
There was an error while loading. Please reload this page.
(WIP)(core): add scoped zone.js support - #1126
Conversation
mhevery
commented
Sep 17, 2018
Hi @JiaLiPassion and thank you for this PR. I am a little confused about this PR. My understanding is that it is not clear to me how this is different from being called in the If there are differences in how the The flag Any insight on this would be appreciated. |
collinstevens
commented
Oct 30, 2018
@JiaLiPassion Is there a reason why this was closed? Is there another fix covering this somewhere? I'm coming over from angular/angular#24185. |
Add scoped
zone.jssupport.The purpose of this PR is the same as this one #1073.
To allow
zone.jsonly run inside ascope. So inAngular Elements, we can letzone.jsonly work insideAngular Elementswithout impacting outside world.monkey patchevery async APIs beforezone.runremove monkey patchafterzone.run.This can work but have a performance impact, although
repatchandremove patchis onlyassign references, but theamountof the async APIs is a lot (espesiallyonProperty), so there will be some performance loss.zone.run, set a flagI am in the zone.zone.run, set a flagI am outside of zone.And we still
monkey patchall async APIs (but only once), it will look like this.For example,
setTimeout.So we will wrap the
async API, if currently, we are not inzone, we will justuse the
native APIs.So we don't have any performance loss when call
zone.run.@mhevery, @robwormald, please review this idea is ok or not, I am adding test cases to make sure all
APIscan work in both mode.If this idea is OK, we only need to do a simple
setupto letAngular Elementssupportscoped zonelike this.That's all, please review, thank you.