-
Notifications
You must be signed in to change notification settings - Fork 408
Configuring Root zone #513
Comments
I don't know why zone was designed to not have a rootZoneSpec, but in my understanding, if there is a rootZoneSpec just like your PR #521, everybody can modify the rootZoneSpec so the whole system may have unstable behavior. for example, you app have 2 modules, |
I think this feature expands zone.js' use cases, like this one #422 , Also, even without this change there's the possibility of monkey patching root zone, (or even monkey patching browser api directly for that matter). In regards to going into an unpredictable state, I think different modules can modify browser API however they want. I don't think this feature provides more than what is already possible in browsers. |
yeah, I agree with you, in fact , I need such kind of feature too. I have a suggestion that should we remove rootZoneSpec from global after the rootZone has been created? In your PR, the code like this, after rootZone created, delete it from global so no other code can access it from outside expect who created it. const symbolRootZoneSpec = '__rootZoneSpec__'
var rootZone: Zone = new Zone(null, null);
if (global[symbolRootZoneSpec]) {
rootZone = <Zone>rootZone.fork(global[symbolRootZoneSpec]);
delete global[symbolRootZoneSpec];
}
+ |
@JiaLiPassion , Good call 👍 , Done. |
Sorry, but this is by design. RootZone should be indistinguishable for no zone at all. This requirement is here so that if we standardize the Zones in TC39, the browser vendors will not have to pay the cost for all of the applications. All zones must be entered explicitly. |
closes angular#513 remove symbolRootZoneSpec from global using let instead of var add missing semicolon
closes angular#513 remove symbolRootZoneSpec from global using let instead of var add missing semicolon
…lib to configure root zone
…lib to configure root zone
…lib to configure root zone
Is there a way to configure
onScheduleTask
andonInvokeTask
on the root zone?Or other interceptions for that matter?
The text was updated successfully, but these errors were encountered: