feat(zone.js): move MutationObserver/FileReader to different module (#31657)
Separate `EventTarget`, `FileReader`, `MutationObserver` and `IntersectionObserver` patches into different module. So the user can disable those modules separately. PR Close #31657
This commit is contained in:

committed by
Misko Hevery

parent
6e2db228af
commit
253337dc0a
@ -12,7 +12,7 @@
|
||||
|
||||
import {findEventTasks} from '../common/events';
|
||||
import {patchTimer} from '../common/timers';
|
||||
import {patchClass, patchMethod, patchPrototype, scheduleMacroTaskWithCurrentZone, ZONE_SYMBOL_ADD_EVENT_LISTENER, ZONE_SYMBOL_REMOVE_EVENT_LISTENER, zoneSymbol} from '../common/utils';
|
||||
import {patchClass, patchMethod, patchPrototype, scheduleMacroTaskWithCurrentZone, ZONE_SYMBOL_ADD_EVENT_LISTENER, ZONE_SYMBOL_REMOVE_EVENT_LISTENER, zoneSymbol,} from '../common/utils';
|
||||
|
||||
import {patchCustomElements} from './custom-elements';
|
||||
import {eventTargetPatch, patchEvent} from './event-target';
|
||||
@ -59,9 +59,18 @@ Zone.__load_patch('EventTarget', (global: any, Zone: ZoneType, api: _ZonePrivate
|
||||
if (XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype) {
|
||||
api.patchEventTarget(global, [XMLHttpRequestEventTarget.prototype]);
|
||||
}
|
||||
});
|
||||
|
||||
Zone.__load_patch('MutationObserver', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
|
||||
patchClass('MutationObserver');
|
||||
patchClass('WebKitMutationObserver');
|
||||
});
|
||||
|
||||
Zone.__load_patch('IntersectionObserver', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
|
||||
patchClass('IntersectionObserver');
|
||||
});
|
||||
|
||||
Zone.__load_patch('FileReader', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
|
||||
patchClass('FileReader');
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user