mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-16 10:33:43 +08:00
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:
parent
0420f1a0d7
commit
6cc8c26083
@ -70,7 +70,6 @@ function createIvyPlugin(
|
|||||||
fileReplacements,
|
fileReplacements,
|
||||||
jitMode: !aot,
|
jitMode: !aot,
|
||||||
emitNgModuleScope: !optimize,
|
emitNgModuleScope: !optimize,
|
||||||
suppressZoneJsIncompatibilityWarning: true,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,7 +138,6 @@ function _createAotPlugin(
|
|||||||
directTemplateLoading: true,
|
directTemplateLoading: true,
|
||||||
...options,
|
...options,
|
||||||
compilerOptions,
|
compilerOptions,
|
||||||
suppressZoneJsIncompatibilityWarning: true,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pluginOptions = _pluginOptionsOverrides(buildOptions, pluginOptions);
|
pluginOptions = _pluginOptionsOverrides(buildOptions, pluginOptions);
|
||||||
|
@ -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.
|
* `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.
|
* `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.
|
* `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
|
## 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:
|
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:
|
||||||
|
|
||||||
|
@ -252,18 +252,6 @@ export class AngularCompilerPlugin {
|
|||||||
this._platformTransformers = options.platformTransformers;
|
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) {
|
if (this._compilerOptions.strictMetadataEmit) {
|
||||||
this._warnings.push(
|
this._warnings.push(
|
||||||
`Using Angular compiler option 'strictMetadataEmit' for applications might cause undefined behavior.`,
|
`Using Angular compiler option 'strictMetadataEmit' for applications might cause undefined behavior.`,
|
||||||
|
@ -55,12 +55,4 @@ export interface AngularCompilerPluginOptions {
|
|||||||
|
|
||||||
host?: virtualFs.Host<fs.Stats>;
|
host?: virtualFs.Host<fs.Stats>;
|
||||||
platformTransformers?: ts.TransformerFactory<ts.SourceFile>[];
|
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;
|
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,6 @@ export interface AngularPluginOptions {
|
|||||||
directTemplateLoading: boolean;
|
directTemplateLoading: boolean;
|
||||||
emitClassMetadata: boolean;
|
emitClassMetadata: boolean;
|
||||||
emitNgModuleScope: boolean;
|
emitNgModuleScope: boolean;
|
||||||
suppressZoneJsIncompatibilityWarning: boolean;
|
|
||||||
jitMode: boolean;
|
jitMode: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,7 +104,6 @@ export class AngularWebpackPlugin {
|
|||||||
substitutions: {},
|
substitutions: {},
|
||||||
directTemplateLoading: true,
|
directTemplateLoading: true,
|
||||||
tsconfig: 'tsconfig.json',
|
tsconfig: 'tsconfig.json',
|
||||||
suppressZoneJsIncompatibilityWarning: false,
|
|
||||||
...options,
|
...options,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -379,19 +377,6 @@ export class AngularWebpackPlugin {
|
|||||||
compilerOptions.annotationsAs = 'decorators';
|
compilerOptions.annotationsAs = 'decorators';
|
||||||
compilerOptions.enableResourceInlining = false;
|
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 };
|
return { compilerOptions, rootNames, errors };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user