refactor(@ngtools/webpack): remove suppressZoneJsIncompatibilityWarning option

BREAKING CHANGE

`suppressZoneJsIncompatibilityWarning` option has been removed. If you are using this plugin directly and `async/await` in ES2017 make sure you downlevel the async syntax using Babel.

See: https://github.com/angular/zone.js/pull/1140 for more information.
This commit is contained in:
Alan Agius 2021-03-15 17:52:20 +01:00
parent 0420f1a0d7
commit 6cc8c26083
5 changed files with 0 additions and 40 deletions

View File

@ -70,7 +70,6 @@ function createIvyPlugin(
fileReplacements,
jitMode: !aot,
emitNgModuleScope: !optimize,
suppressZoneJsIncompatibilityWarning: true,
});
}
@ -139,7 +138,6 @@ function _createAotPlugin(
directTemplateLoading: true,
...options,
compilerOptions,
suppressZoneJsIncompatibilityWarning: true,
};
pluginOptions = _pluginOptionsOverrides(buildOptions, pluginOptions);

View File

@ -63,9 +63,6 @@ The loader works with webpack plugin to compile your TypeScript. It's important
* `i18nOutFile`. Optional and only used for View Engine compilations. The name of the file to write extractions to.
* `i18nOutFormat`. Optional and only used for View Engine compilations. The format of the localization file where extractions will be written to.
* `locale`. Optional and only used for View Engine compilations. Locale to use for i18n.
* `suppressZoneJsIncompatibilityWarning`. Optional, defaults to `false`. A Zone.js incompatibility warning is shown when the compilation target is ES2017+. Zone.js does not support native async/await in ES2017+. These blocks are not intercepted by zone.js and will not triggering change detection.
See https://github.com/angular/zone.js/pull/1140 for more information.
## Features
The benefits and ability of using [`@ngtools/webpack`](https://www.npmjs.com/~ngtools) standalone from the Angular CLI as presented in [Stephen Fluin's Angular CLI talk](https://youtu.be/uBRK6cTr4Vk?t=6m45s) at Angular Connect 2016:

View File

@ -252,18 +252,6 @@ export class AngularCompilerPlugin {
this._platformTransformers = options.platformTransformers;
}
if (
!this.options.suppressZoneJsIncompatibilityWarning &&
this._compilerOptions.target !== undefined &&
this._compilerOptions.target >= ts.ScriptTarget.ES2017
) {
this._warnings.push(
'Zone.js does not support native async/await in ES2017+.\n' +
'These blocks are not intercepted by zone.js and will not triggering change detection.\n' +
'See: https://github.com/angular/zone.js/pull/1140 for more information.',
);
}
if (this._compilerOptions.strictMetadataEmit) {
this._warnings.push(
`Using Angular compiler option 'strictMetadataEmit' for applications might cause undefined behavior.`,

View File

@ -55,12 +55,4 @@ export interface AngularCompilerPluginOptions {
host?: virtualFs.Host<fs.Stats>;
platformTransformers?: ts.TransformerFactory<ts.SourceFile>[];
/**
* Suppress Zone.js incompatibility warning when using ES2017+.
* Zone.js does not support native async/await in ES2017+.
* These blocks are not intercepted by zone.js and will not triggering change detection.
* @see https://github.com/angular/zone.js/pull/1140
*/
suppressZoneJsIncompatibilityWarning?: boolean;
}

View File

@ -44,7 +44,6 @@ export interface AngularPluginOptions {
directTemplateLoading: boolean;
emitClassMetadata: boolean;
emitNgModuleScope: boolean;
suppressZoneJsIncompatibilityWarning: boolean;
jitMode: boolean;
}
@ -105,7 +104,6 @@ export class AngularWebpackPlugin {
substitutions: {},
directTemplateLoading: true,
tsconfig: 'tsconfig.json',
suppressZoneJsIncompatibilityWarning: false,
...options,
};
}
@ -379,19 +377,6 @@ export class AngularWebpackPlugin {
compilerOptions.annotationsAs = 'decorators';
compilerOptions.enableResourceInlining = false;
if (
!this.pluginOptions.suppressZoneJsIncompatibilityWarning &&
compilerOptions.target &&
compilerOptions.target >= ts.ScriptTarget.ES2017
) {
addWarning(
compilation,
'Zone.js does not support native async/await in ES2017+.\n' +
'These blocks are not intercepted by zone.js and will not triggering change detection.\n' +
'See: https://github.com/angular/zone.js/pull/1140 for more information.',
);
}
return { compilerOptions, rootNames, errors };
}