The most recent update to 0.9.0 (in google3 cl/240639288 already rolled-back) broke one of the google3 apps. They have an "unusual" setup where they run Angular with zone.js in a service worker context. Zone.js 0.9.0 breaks in the serviceworker because property-descriptor-legacy.ts:56 directly references XmlHttpRequest[1], which is not available in service workers.
They use "self['__Zone_disable_XHR'] = true" to disable zone's other usages of XHR's and actually use the noop stub for Zone once bootstrapped:
Before re-landing 0.9.0 in google3, let's ensure that we avoid executing that code in service workers.
I'll also follow up with them about why they even load zone.js when then stub it out with noop during bootstrap, but we should still try to avoid breaking them.
The most recent update to 0.9.0 (in google3 cl/240639288 already rolled-back) broke one of the google3 apps. They have an "unusual" setup where they run Angular with zone.js in a service worker context. Zone.js 0.9.0 breaks in the serviceworker because property-descriptor-legacy.ts:56 directly references XmlHttpRequest[1], which is not available in service workers.
They use "self['__Zone_disable_XHR'] = true" to disable zone's other usages of XHR's and actually use the noop stub for Zone once bootstrapped:
Before re-landing 0.9.0 in google3, let's ensure that we avoid executing that code in service workers.
I'll also follow up with them about why they even load zone.js when then stub it out with
noop
during bootstrap, but we should still try to avoid breaking them.[1] https://github.com/angular/zone.js/blob/31d31ceead4a8dfd0b747f1912f98f61c89dceff/lib/browser/property-descriptor-legacy.ts#L45