Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix(zone.js): enable monkey patching of the `queueMicrotask()… #50529

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/zone.js/karma-build.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ module.exports = function(config) {
config.files.push('build/test/test_fake_polyfill.js');
config.files.push('build/lib/zone.js');
config.files.push('build/lib/common/promise.js');
config.files.push('build/lib/common/queue-microtask.js');
config.files.push('build/test/main.js');
};
9 changes: 9 additions & 0 deletions packages/zone.js/lib/browser/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ Zone.__load_patch('legacy', (global: any) => {
}
});

Zone.__load_patch('queueMicrotask', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
api.patchMethod(global, 'queueMicrotask', delegate => {
return function(self: any, args: any[]) {
Zone.current.scheduleMicroTask('queueMicrotask', args[0]);
}
});
});


Zone.__load_patch('timers', (global: any) => {
const set = 'set';
const clear = 'clear';
Expand Down
1 change: 0 additions & 1 deletion packages/zone.js/lib/browser/rollup-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ import '../zone';
import '../common/promise';
import '../common/to-string';
import './api-util';
import '../common/queue-microtask';
19 changes: 0 additions & 19 deletions packages/zone.js/lib/common/queue-microtask.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/zone.js/lib/node/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import './node_util';
import './events';
import './fs';
import '../common/queue-microtask';

import {findEventTasks} from '../common/events';
import {patchTimer} from '../common/timers';
Expand Down
4 changes: 2 additions & 2 deletions packages/zone.js/lib/zone.configurations.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@ interface ZoneGlobalConfigurations {

/**
*
* Disable the monkey patching of the `queueMicrotask()` API.
* Disable the monkey patching of the browser's `queueMicrotask()` API.
*
* By default, `zone.js` monkey patches the `queueMicrotask()` API
* By default, `zone.js` monkey patches the browser's `queueMicrotask()` API
* to ensure that `queueMicrotask()` callback is invoked in the same zone as zone used to invoke
* `queueMicrotask()`. And also the callback is running as `microTask` like
* `Promise.prototype.then()`.
Expand Down
1 change: 0 additions & 1 deletion packages/zone.js/test/browser-zone-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ if (typeof window !== 'undefined') {
(window as any)[zoneSymbol('fakeAsyncAutoFakeAsyncWhenClockPatched')] = true;
}
import '../lib/common/to-string';
import '../lib/common/queue-microtask';
import '../lib/browser/api-util';
import '../lib/browser/browser-legacy';
import '../lib/browser/browser';
Expand Down
1 change: 1 addition & 0 deletions packages/zone.js/test/browser_entry_point.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ import './mocha-patch.spec';
import './jasmine-patch.spec';
import './browser/messageport.spec';
import './extra/cordova.spec';
import './browser/queue-microtask.spec';
1 change: 0 additions & 1 deletion packages/zone.js/test/common_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import './common/zone.spec';
import './common/task.spec';
import './common/util.spec';
import './common/Promise.spec';
import './common/queue-microtask.spec';
import './common/fetch.spec';
import './common/Error.spec';
import './common/setInterval.spec';
Expand Down
1 change: 0 additions & 1 deletion packages/zone.js/test/node_error_entry_point.init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import './test_fake_polyfill';
// Setup tests for Zone without microtask support
import '../lib/zone';
import '../lib/common/promise';
import '../lib/common/queue-microtask';
import '../lib/common/to-string';
import './test-env-setup-jasmine';
import './wtf_mock';
Expand Down