From ec4381dd401f03bded652665b047b6b90f2b425f Mon Sep 17 00:00:00 2001 From: Alex Rickabaugh Date: Tue, 20 Aug 2019 10:52:31 -0700 Subject: [PATCH] feat: make the Ivy compiler the default for ngc (#32219) This commit switches the default value of the enableIvy flag to true. Applications that run ngc will now by default receive an Ivy build! This does not affect the way Bazel builds in the Angular repo work, since those are still switched based on the value of the --define=compile flag. Additionally, projects using @angular/bazel still use View Engine builds by default. Since most of the Angular repo tests are still written against View Engine (particularly because we still publish VE packages to NPM), this switch also requires lots of `enableIvy: false` flags in tsconfigs throughout the repo. Congrats to the team for reaching this milestone! PR Close #32219 --- .../upgrade-phonecat-1-typescript/tsconfig.json | 12 +++++++++--- .../upgrade-phonecat-2-hybrid/tsconfig-aot.json | 3 ++- .../upgrade-phonecat-2-hybrid/tsconfig.json | 12 +++++++++--- .../upgrade-phonecat-3-final/tsconfig.json | 12 +++++++++--- .../examples/visual-studio-2015/tsconfig.json | 7 +++++-- .../shared/boilerplate/cli/tsconfig.json | 5 ++++- aio/tsconfig.json | 5 ++++- integration/bazel-schematics/disable-ivy.js | 17 +++++++++++++++++ integration/bazel-schematics/test.sh | 2 ++ .../bazel/angular-metadata.tsconfig.json | 3 ++- integration/cli-hello-world/tsconfig.json | 5 ++++- integration/dynamic-compiler/tsconfig.json | 3 +++ integration/hello_world__closure/tsconfig.json | 3 ++- .../hello_world__systemjs_umd/src/tsconfig.json | 5 ++++- integration/i18n/tsconfig.json | 3 ++- integration/injectable-def/tsconfig-app.json | 3 +++ integration/injectable-def/tsconfig-lib1.json | 3 ++- integration/injectable-def/tsconfig-lib2.json | 3 ++- integration/ng_elements/tsconfig.json | 3 ++- integration/platform-server/tsconfig.json | 3 ++- .../angular-metadata.tsconfig.json.template | 3 +++ .../flat_module/tsconfig-build.json | 3 ++- .../ngtools_src/tsconfig-build.json | 3 ++- .../third_party_src/tsconfig-build.json | 3 ++- .../integrationtest/tsconfig-build.json | 3 ++- .../integrationtest/tsconfig-xi18n.json | 3 ++- packages/compiler-cli/src/main.ts | 5 +++-- packages/compiler-cli/src/transformers/api.ts | 5 +---- .../compiler-cli/src/transformers/program.ts | 6 +++--- packages/compiler-cli/test/extract_i18n_spec.ts | 3 +++ packages/compiler-cli/test/ngc_spec.ts | 3 +++ packages/compiler-cli/test/test_support.ts | 1 + .../google3/explicit_query_timing_rule_spec.ts | 5 ++++- .../google3/missing_injectable_rule_spec.ts | 5 ++++- ...no_template_variable_assignment_rule_spec.ts | 5 ++++- .../test/google3/renderer_to_renderer2_spec.ts | 3 ++- .../test/missing_injectable_migration_spec.ts | 3 ++- .../test/move_document_migration_spec.ts | 3 ++- .../renderer_to_renderer2_migration_spec.ts | 3 ++- .../static_queries_migration_template_spec.ts | 4 +++- .../test/static_queries_migration_usage_spec.ts | 3 ++- .../template_var_assignment_migration_spec.ts | 3 ++- ...ndecorated_classes_with_di_migration_spec.ts | 4 +++- 43 files changed, 146 insertions(+), 48 deletions(-) create mode 100644 integration/bazel-schematics/disable-ivy.js diff --git a/aio/content/examples/upgrade-phonecat-1-typescript/tsconfig.json b/aio/content/examples/upgrade-phonecat-1-typescript/tsconfig.json index 1d3d14ae785..341d5a61ccc 100644 --- a/aio/content/examples/upgrade-phonecat-1-typescript/tsconfig.json +++ b/aio/content/examples/upgrade-phonecat-1-typescript/tsconfig.json @@ -6,7 +6,10 @@ "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, - "lib": [ "es2015", "dom" ], + "lib": [ + "es2015", + "dom" + ], "noImplicitAny": true, "skipLibCheck": true, "suppressImplicitAnyIndexErrors": true @@ -16,5 +19,8 @@ "node_modules/*", "**/*-aot.ts", "aot/**/*" - ] -} + ], + "angularCompilerOptions": { + "enableIvy": false + } +} \ No newline at end of file diff --git a/aio/content/examples/upgrade-phonecat-2-hybrid/tsconfig-aot.json b/aio/content/examples/upgrade-phonecat-2-hybrid/tsconfig-aot.json index c7f1231897b..a2b95ecb34c 100644 --- a/aio/content/examples/upgrade-phonecat-2-hybrid/tsconfig-aot.json +++ b/aio/content/examples/upgrade-phonecat-2-hybrid/tsconfig-aot.json @@ -19,6 +19,7 @@ ], "angularCompilerOptions": { - "skipMetadataEmit" : true + "skipMetadataEmit" : true, + "enableIvy": false, } } diff --git a/aio/content/examples/upgrade-phonecat-2-hybrid/tsconfig.json b/aio/content/examples/upgrade-phonecat-2-hybrid/tsconfig.json index 5ee3c82f1e0..6daafd7a894 100644 --- a/aio/content/examples/upgrade-phonecat-2-hybrid/tsconfig.json +++ b/aio/content/examples/upgrade-phonecat-2-hybrid/tsconfig.json @@ -6,7 +6,10 @@ "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, - "lib": [ "es2015", "dom" ], + "lib": [ + "es2015", + "dom" + ], "noImplicitAny": true, "skipLibCheck": true, "suppressImplicitAnyIndexErrors": true @@ -15,5 +18,8 @@ "exclude": [ "node_modules/*", "**/*-aot.ts" - ] -} + ], + "angularCompilerOptions": { + "enableIvy": false + } +} \ No newline at end of file diff --git a/aio/content/examples/upgrade-phonecat-3-final/tsconfig.json b/aio/content/examples/upgrade-phonecat-3-final/tsconfig.json index 5ee3c82f1e0..6daafd7a894 100644 --- a/aio/content/examples/upgrade-phonecat-3-final/tsconfig.json +++ b/aio/content/examples/upgrade-phonecat-3-final/tsconfig.json @@ -6,7 +6,10 @@ "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, - "lib": [ "es2015", "dom" ], + "lib": [ + "es2015", + "dom" + ], "noImplicitAny": true, "skipLibCheck": true, "suppressImplicitAnyIndexErrors": true @@ -15,5 +18,8 @@ "exclude": [ "node_modules/*", "**/*-aot.ts" - ] -} + ], + "angularCompilerOptions": { + "enableIvy": false + } +} \ No newline at end of file diff --git a/aio/content/examples/visual-studio-2015/tsconfig.json b/aio/content/examples/visual-studio-2015/tsconfig.json index 2624488890f..e269ae0e3cf 100644 --- a/aio/content/examples/visual-studio-2015/tsconfig.json +++ b/aio/content/examples/visual-studio-2015/tsconfig.json @@ -13,5 +13,8 @@ "node_modules/@types" ] }, - "compileOnSave": true -} + "compileOnSave": true, + "angularCompilerOptions": { + "enableIvy": false + } +} \ No newline at end of file diff --git a/aio/tools/examples/shared/boilerplate/cli/tsconfig.json b/aio/tools/examples/shared/boilerplate/cli/tsconfig.json index 6ec9ceb1745..ce1b58ab88f 100644 --- a/aio/tools/examples/shared/boilerplate/cli/tsconfig.json +++ b/aio/tools/examples/shared/boilerplate/cli/tsconfig.json @@ -18,5 +18,8 @@ "es2018", "dom" ] - } + }, + "angularCompilerOptions": { + "enableIvy": false, + }, } diff --git a/aio/tsconfig.json b/aio/tsconfig.json index 9c7eaa54ba5..ae075f45605 100644 --- a/aio/tsconfig.json +++ b/aio/tsconfig.json @@ -32,5 +32,8 @@ "out-tsc", "scripts", "tools" - ] + ], + "angularCompilerOptions": { + "enableIvy": false, + }, } diff --git a/integration/bazel-schematics/disable-ivy.js b/integration/bazel-schematics/disable-ivy.js new file mode 100644 index 00000000000..b1b3c5b963e --- /dev/null +++ b/integration/bazel-schematics/disable-ivy.js @@ -0,0 +1,17 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +const fs = require('fs'); +const configPath = 'demo/tsconfig.json'; +const config = { + ...JSON.parse(fs.readFileSync(configPath, 'utf8')), + "angularCompilerOptions": { + "enableIvy": false, + }, +}; +fs.writeFileSync(configPath, JSON.stringify(config, null, 2)); diff --git a/integration/bazel-schematics/test.sh b/integration/bazel-schematics/test.sh index 43f007a101c..25ec1290182 100755 --- a/integration/bazel-schematics/test.sh +++ b/integration/bazel-schematics/test.sh @@ -18,6 +18,7 @@ function installLocalPackages() { yarn add "${local_packages[@]}" } + function testBazel() { # Set up bazel version @@ -25,6 +26,7 @@ function testBazel() { rm -rf demo # Create project ng new demo --collection=@angular/bazel --routing --skip-git --skip-install --style=scss + node ./disable-ivy.js cd demo installLocalPackages ng generate component widget --style=css diff --git a/integration/bazel/angular-metadata.tsconfig.json b/integration/bazel/angular-metadata.tsconfig.json index 597712893b5..f52c86c8d07 100644 --- a/integration/bazel/angular-metadata.tsconfig.json +++ b/integration/bazel/angular-metadata.tsconfig.json @@ -13,7 +13,8 @@ "moduleResolution": "node" }, "angularCompilerOptions": { - "enableSummariesForJit": true + "enableSummariesForJit": true, + "enableIvy": false }, "include": [ "node_modules/@angular/**/*" diff --git a/integration/cli-hello-world/tsconfig.json b/integration/cli-hello-world/tsconfig.json index 41d317aa0ae..0f8a4b5afd7 100644 --- a/integration/cli-hello-world/tsconfig.json +++ b/integration/cli-hello-world/tsconfig.json @@ -16,5 +16,8 @@ "es2017", "dom" ] - } + }, + "angularCompilerOptions": { + "enableIvy": false, + }, } diff --git a/integration/dynamic-compiler/tsconfig.json b/integration/dynamic-compiler/tsconfig.json index 4adfea7714c..95e86b68dbb 100644 --- a/integration/dynamic-compiler/tsconfig.json +++ b/integration/dynamic-compiler/tsconfig.json @@ -21,6 +21,9 @@ "types": [ ] }, + "angularCompilerOptions": { + "enableIvy": false, + }, "files": [ "src/main.ts", "src/lazy.module.ts" diff --git a/integration/hello_world__closure/tsconfig.json b/integration/hello_world__closure/tsconfig.json index 34cc0b9fb28..2bb95ae4e7d 100644 --- a/integration/hello_world__closure/tsconfig.json +++ b/integration/hello_world__closure/tsconfig.json @@ -2,7 +2,8 @@ "angularCompilerOptions": { "annotationsAs": "static fields", "annotateForClosureCompiler": true, - "alwaysCompileGeneratedCode": true + "alwaysCompileGeneratedCode": true, + "enableIvy": false, }, "compilerOptions": { diff --git a/integration/hello_world__systemjs_umd/src/tsconfig.json b/integration/hello_world__systemjs_umd/src/tsconfig.json index afd210825fc..056c06afbee 100644 --- a/integration/hello_world__systemjs_umd/src/tsconfig.json +++ b/integration/hello_world__systemjs_umd/src/tsconfig.json @@ -9,5 +9,8 @@ "lib": [ "es2015", "dom" ], "noImplicitAny": true, "suppressImplicitAnyIndexErrors": true - } + }, + "angularCompilerOptions": { + "enableIvy": false, + }, } \ No newline at end of file diff --git a/integration/i18n/tsconfig.json b/integration/i18n/tsconfig.json index 34cc0b9fb28..2bb95ae4e7d 100644 --- a/integration/i18n/tsconfig.json +++ b/integration/i18n/tsconfig.json @@ -2,7 +2,8 @@ "angularCompilerOptions": { "annotationsAs": "static fields", "annotateForClosureCompiler": true, - "alwaysCompileGeneratedCode": true + "alwaysCompileGeneratedCode": true, + "enableIvy": false, }, "compilerOptions": { diff --git a/integration/injectable-def/tsconfig-app.json b/integration/injectable-def/tsconfig-app.json index bb53b786642..a02bcdd20cf 100644 --- a/integration/injectable-def/tsconfig-app.json +++ b/integration/injectable-def/tsconfig-app.json @@ -10,6 +10,9 @@ "types": ["node"], "rootDir": "." }, + "angularCompilerOptions": { + "enableIvy": false, + }, "files": [ "src/app.ts", "src/main.ts" diff --git a/integration/injectable-def/tsconfig-lib1.json b/integration/injectable-def/tsconfig-lib1.json index f51660e935f..f16b96ef58b 100644 --- a/integration/injectable-def/tsconfig-lib1.json +++ b/integration/injectable-def/tsconfig-lib1.json @@ -17,6 +17,7 @@ "angularCompilerOptions": { "skipTemplateCodegen": true, "flatModuleOutFile": "index.js", - "flatModuleId": "lib1_built" + "flatModuleId": "lib1_built", + "enableIvy": false, } } \ No newline at end of file diff --git a/integration/injectable-def/tsconfig-lib2.json b/integration/injectable-def/tsconfig-lib2.json index c0bf4163953..ae3a1a72f05 100644 --- a/integration/injectable-def/tsconfig-lib2.json +++ b/integration/injectable-def/tsconfig-lib2.json @@ -17,6 +17,7 @@ "angularCompilerOptions": { "skipTemplateCodegen": true, "flatModuleId": "lib2_built", - "flatModuleOutFile": "index.js" + "flatModuleOutFile": "index.js", + "enableIvy": false, } } \ No newline at end of file diff --git a/integration/ng_elements/tsconfig.json b/integration/ng_elements/tsconfig.json index 1c3d4179beb..dd56c0135b6 100644 --- a/integration/ng_elements/tsconfig.json +++ b/integration/ng_elements/tsconfig.json @@ -2,7 +2,8 @@ "angularCompilerOptions": { "annotationsAs": "static fields", "annotateForClosureCompiler": true, - "alwaysCompileGeneratedCode": true + "alwaysCompileGeneratedCode": true, + "enableIvy": false, }, "compilerOptions": { diff --git a/integration/platform-server/tsconfig.json b/integration/platform-server/tsconfig.json index d54783edd44..003fca7b974 100644 --- a/integration/platform-server/tsconfig.json +++ b/integration/platform-server/tsconfig.json @@ -1,7 +1,8 @@ { "angularCompilerOptions": { "annotationsAs": "static fields", - "annotateForClosureCompiler": true + "annotateForClosureCompiler": true, + "enableIvy": false, }, "compilerOptions": { diff --git a/packages/bazel/src/schematics/ng-add/files/angular-metadata.tsconfig.json.template b/packages/bazel/src/schematics/ng-add/files/angular-metadata.tsconfig.json.template index c6f5bb78e66..d502e672e96 100644 --- a/packages/bazel/src/schematics/ng-add/files/angular-metadata.tsconfig.json.template +++ b/packages/bazel/src/schematics/ng-add/files/angular-metadata.tsconfig.json.template @@ -12,6 +12,9 @@ "module": "amd", "moduleResolution": "node" }, + "angularCompilerOptions": { + "enableIvy": false + }, "include": [ "node_modules/@angular/**/*" ], diff --git a/packages/compiler-cli/integrationtest/flat_module/tsconfig-build.json b/packages/compiler-cli/integrationtest/flat_module/tsconfig-build.json index 4be4a4fdfa7..99a87c7df99 100644 --- a/packages/compiler-cli/integrationtest/flat_module/tsconfig-build.json +++ b/packages/compiler-cli/integrationtest/flat_module/tsconfig-build.json @@ -2,7 +2,8 @@ "angularCompilerOptions": { "flatModuleId": "flat_module", "flatModuleOutFile": "index.js", - "skipTemplateCodegen": true + "skipTemplateCodegen": true, + "enableIvy": false }, "compilerOptions": { diff --git a/packages/compiler-cli/integrationtest/ngtools_src/tsconfig-build.json b/packages/compiler-cli/integrationtest/ngtools_src/tsconfig-build.json index 2a7c12c8bb0..bf7ec968176 100644 --- a/packages/compiler-cli/integrationtest/ngtools_src/tsconfig-build.json +++ b/packages/compiler-cli/integrationtest/ngtools_src/tsconfig-build.json @@ -1,6 +1,7 @@ { "angularCompilerOptions": { - "debug": true + "debug": true, + "enableIvy": false }, "compilerOptions": { diff --git a/packages/compiler-cli/integrationtest/third_party_src/tsconfig-build.json b/packages/compiler-cli/integrationtest/third_party_src/tsconfig-build.json index 73801e83543..aef5331e683 100644 --- a/packages/compiler-cli/integrationtest/third_party_src/tsconfig-build.json +++ b/packages/compiler-cli/integrationtest/third_party_src/tsconfig-build.json @@ -1,6 +1,7 @@ { "angularCompilerOptions": { - "skipTemplateCodegen": true + "skipTemplateCodegen": true, + "enableIvy": false }, "compilerOptions": { diff --git a/packages/compiler-cli/integrationtest/tsconfig-build.json b/packages/compiler-cli/integrationtest/tsconfig-build.json index 3e9b6559d83..50f3bfc9efe 100644 --- a/packages/compiler-cli/integrationtest/tsconfig-build.json +++ b/packages/compiler-cli/integrationtest/tsconfig-build.json @@ -4,7 +4,8 @@ "annotationsAs": "static fields", "debug": true, "enableSummariesForJit": true, - "i18nFormat": "xlf" + "i18nFormat": "xlf", + "enableIvy": false }, "compilerOptions": { diff --git a/packages/compiler-cli/integrationtest/tsconfig-xi18n.json b/packages/compiler-cli/integrationtest/tsconfig-xi18n.json index 05a7f387338..974b48da335 100644 --- a/packages/compiler-cli/integrationtest/tsconfig-xi18n.json +++ b/packages/compiler-cli/integrationtest/tsconfig-xi18n.json @@ -1,7 +1,8 @@ { "angularCompilerOptions": { "debug": true, - "enableSummariesForJit": true + "enableSummariesForJit": true, + "enableIvy": false }, "compilerOptions": { diff --git a/packages/compiler-cli/src/main.ts b/packages/compiler-cli/src/main.ts index 0212bc5c126..aad3add832a 100644 --- a/packages/compiler-cli/src/main.ts +++ b/packages/compiler-cli/src/main.ts @@ -68,7 +68,8 @@ export function mainDiagnosticsForTest( } function createEmitCallback(options: api.CompilerOptions): api.TsEmitCallback|undefined { - const transformDecorators = !options.enableIvy && options.annotationsAs !== 'decorators'; + const transformDecorators = + (options.enableIvy === false && options.annotationsAs !== 'decorators'); const transformTypesToClosure = options.annotateForClosureCompiler; if (!transformDecorators && !transformTypesToClosure) { return undefined; @@ -205,7 +206,7 @@ function reportErrorsAndExit( const errorsAndWarnings = filterErrorsAndWarnings(allDiagnostics); if (errorsAndWarnings.length) { const formatHost = getFormatDiagnosticsHost(options); - if (options && options.enableIvy === true) { + if (options && options.enableIvy !== false) { const ngDiagnostics = errorsAndWarnings.filter(api.isNgDiagnostic); const tsDiagnostics = errorsAndWarnings.filter(api.isTsDiagnostic); consoleError(replaceTsWithNgInErrors( diff --git a/packages/compiler-cli/src/transformers/api.ts b/packages/compiler-cli/src/transformers/api.ts index d17d0fd0ea3..86b77464fb3 100644 --- a/packages/compiler-cli/src/transformers/api.ts +++ b/packages/compiler-cli/src/transformers/api.ts @@ -186,10 +186,7 @@ export interface CompilerOptions extends ts.CompilerOptions { /** * Tells the compiler to generate definitions using the Render3 style code generation. - * This option defaults to `false`. - * - * Not all features are supported with this option enabled. It is only supported - * for experimentation and testing of Render3 style code generation. + * This option defaults to `true`. * * Acceptable values are as follows: * diff --git a/packages/compiler-cli/src/transformers/program.ts b/packages/compiler-cli/src/transformers/program.ts index 1f0c5f72465..8fe666a2395 100644 --- a/packages/compiler-cli/src/transformers/program.ts +++ b/packages/compiler-cli/src/transformers/program.ts @@ -142,7 +142,7 @@ class AngularCompilerProgram implements Program { } this.loweringMetadataTransform = - new LowerMetadataTransform(options.enableIvy ? R3_LOWER_FIELDS : LOWER_FIELDS); + new LowerMetadataTransform(options.enableIvy !== false ? R3_LOWER_FIELDS : LOWER_FIELDS); this.metadataCache = this.createMetadataCache([this.loweringMetadataTransform]); } @@ -262,7 +262,7 @@ class AngularCompilerProgram implements Program { emitCallback?: TsEmitCallback, mergeEmitResultsCallback?: TsMergeEmitResultsCallback, } = {}): ts.EmitResult { - if (this.options.enableIvy) { + if (this.options.enableIvy !== false) { throw new Error('Cannot run legacy compiler in ngtsc mode'); } return this._emitRender2(parameters); @@ -897,7 +897,7 @@ export function createProgram({rootNames, options, host, oldProgram}: { options: CompilerOptions, host: CompilerHost, oldProgram?: Program }): Program { - if (options.enableIvy === true) { + if (options.enableIvy !== false) { return new NgtscProgram(rootNames, options, host, oldProgram as NgtscProgram); } else { return new AngularCompilerProgram(rootNames, options, host, oldProgram); diff --git a/packages/compiler-cli/test/extract_i18n_spec.ts b/packages/compiler-cli/test/extract_i18n_spec.ts index c0f539de712..f2d4aad0468 100644 --- a/packages/compiler-cli/test/extract_i18n_spec.ts +++ b/packages/compiler-cli/test/extract_i18n_spec.ts @@ -225,6 +225,9 @@ describe('extract_i18n command line', () => { "moduleResolution": "node", "lib": ["es6", "dom"], "typeRoots": ["node_modules/@types"] + }, + "angularCompilerOptions": { + "enableIvy": false } }`); }); diff --git a/packages/compiler-cli/test/ngc_spec.ts b/packages/compiler-cli/test/ngc_spec.ts index 9d3a59974db..48bac176236 100644 --- a/packages/compiler-cli/test/ngc_spec.ts +++ b/packages/compiler-cli/test/ngc_spec.ts @@ -59,6 +59,9 @@ describe('ngc transformer command-line', () => { "moduleResolution": "node", "lib": ["es6", "dom"], "typeRoots": ["node_modules/@types"] + }, + "angularCompilerOptions": { + "enableIvy": false } }`); }); diff --git a/packages/compiler-cli/test/test_support.ts b/packages/compiler-cli/test/test_support.ts index 84d0f592ca9..98e4f4207ac 100644 --- a/packages/compiler-cli/test/test_support.ts +++ b/packages/compiler-cli/test/test_support.ts @@ -57,6 +57,7 @@ function createTestSupportFor(basePath: string) { 'newLine': ts.NewLineKind.LineFeed, 'module': ts.ModuleKind.ES2015, 'moduleResolution': ts.ModuleResolutionKind.NodeJs, + 'enableIvy': false, 'lib': Object.freeze([ path.resolve(basePath, 'node_modules/typescript/lib/lib.es6.d.ts'), ]) as string[], diff --git a/packages/core/schematics/test/google3/explicit_query_timing_rule_spec.ts b/packages/core/schematics/test/google3/explicit_query_timing_rule_spec.ts index 56686ca020c..65ebbf9c78a 100644 --- a/packages/core/schematics/test/google3/explicit_query_timing_rule_spec.ts +++ b/packages/core/schematics/test/google3/explicit_query_timing_rule_spec.ts @@ -26,7 +26,10 @@ describe('Google3 explicitQueryTiming TSLint rule', () => { tmpDir = join(process.env['TEST_TMPDIR'] !, 'google3-test'); shx.mkdir('-p', tmpDir); - writeFile('tsconfig.json', JSON.stringify({compilerOptions: {module: 'es2015'}})); + writeFile( + 'tsconfig.json', + JSON.stringify( + {compilerOptions: {module: 'es2015'}, angularCompilerOptions: {enableIvy: false}})); }); afterEach(() => shx.rm('-r', tmpDir)); diff --git a/packages/core/schematics/test/google3/missing_injectable_rule_spec.ts b/packages/core/schematics/test/google3/missing_injectable_rule_spec.ts index f5cac837304..5cc440b3311 100644 --- a/packages/core/schematics/test/google3/missing_injectable_rule_spec.ts +++ b/packages/core/schematics/test/google3/missing_injectable_rule_spec.ts @@ -21,7 +21,10 @@ describe('Google3 missing injectable tslint rule', () => { tmpDir = join(process.env['TEST_TMPDIR'] !, 'google3-test'); shx.mkdir('-p', tmpDir); - writeFile('tsconfig.json', JSON.stringify({compilerOptions: {module: 'es2015'}})); + writeFile( + 'tsconfig.json', + JSON.stringify( + {compilerOptions: {module: 'es2015'}, angularCompilerOptions: {enableIvy: false}})); }); afterEach(() => shx.rm('-r', tmpDir)); diff --git a/packages/core/schematics/test/google3/no_template_variable_assignment_rule_spec.ts b/packages/core/schematics/test/google3/no_template_variable_assignment_rule_spec.ts index e06cbd1e0d6..228432304ab 100644 --- a/packages/core/schematics/test/google3/no_template_variable_assignment_rule_spec.ts +++ b/packages/core/schematics/test/google3/no_template_variable_assignment_rule_spec.ts @@ -21,7 +21,10 @@ describe('Google3 noTemplateVariableAssignment TSLint rule', () => { tmpDir = join(process.env['TEST_TMPDIR'] !, 'google3-test'); shx.mkdir('-p', tmpDir); - writeFile('tsconfig.json', JSON.stringify({compilerOptions: {module: 'es2015'}})); + writeFile( + 'tsconfig.json', + JSON.stringify( + {compilerOptions: {module: 'es2015'}, angularCompilerOptions: {enableIvy: false}})); }); afterEach(() => shx.rm('-r', tmpDir)); diff --git a/packages/core/schematics/test/google3/renderer_to_renderer2_spec.ts b/packages/core/schematics/test/google3/renderer_to_renderer2_spec.ts index 54733c118a5..0a5924db4b1 100644 --- a/packages/core/schematics/test/google3/renderer_to_renderer2_spec.ts +++ b/packages/core/schematics/test/google3/renderer_to_renderer2_spec.ts @@ -34,7 +34,8 @@ describe('Google3 Renderer to Renderer2 TSLint rule', () => { paths: { '@angular/core': ['angular.d.ts'], } - } + }, + angularCompilerOptions: {enableIvy: false} })); }); diff --git a/packages/core/schematics/test/missing_injectable_migration_spec.ts b/packages/core/schematics/test/missing_injectable_migration_spec.ts index d53e7d562eb..d74fb88ac3a 100644 --- a/packages/core/schematics/test/missing_injectable_migration_spec.ts +++ b/packages/core/schematics/test/missing_injectable_migration_spec.ts @@ -29,7 +29,8 @@ describe('Missing injectable migration', () => { compilerOptions: { experimentalDecorators: true, lib: ['es2015'], - } + }, + angularCompilerOptions: {enableIvy: false} })); writeFile('/angular.json', JSON.stringify({ projects: {t: {architect: {build: {options: {tsConfig: './tsconfig.json'}}}}} diff --git a/packages/core/schematics/test/move_document_migration_spec.ts b/packages/core/schematics/test/move_document_migration_spec.ts index 72541586157..ccdb57cef09 100644 --- a/packages/core/schematics/test/move_document_migration_spec.ts +++ b/packages/core/schematics/test/move_document_migration_spec.ts @@ -27,7 +27,8 @@ describe('move-document migration', () => { writeFile('/tsconfig.json', JSON.stringify({ compilerOptions: { lib: ['es2015'], - } + }, + angularCompilerOptions: {enableIvy: false} })); writeFile('/angular.json', JSON.stringify({ projects: {t: {architect: {build: {options: {tsConfig: './tsconfig.json'}}}}} diff --git a/packages/core/schematics/test/renderer_to_renderer2_migration_spec.ts b/packages/core/schematics/test/renderer_to_renderer2_migration_spec.ts index 8fddee0a404..faaa49d7da6 100644 --- a/packages/core/schematics/test/renderer_to_renderer2_migration_spec.ts +++ b/packages/core/schematics/test/renderer_to_renderer2_migration_spec.ts @@ -28,7 +28,8 @@ describe('Renderer to Renderer2 migration', () => { compilerOptions: { lib: ['es2015'], strictNullChecks: true, - } + }, + angularCompilerOptions: {enableIvy: false} })); writeFile('/angular.json', JSON.stringify({ projects: {t: {architect: {build: {options: {tsConfig: './tsconfig.json'}}}}} diff --git a/packages/core/schematics/test/static_queries_migration_template_spec.ts b/packages/core/schematics/test/static_queries_migration_template_spec.ts index 89956ce4dcb..638b15186a4 100644 --- a/packages/core/schematics/test/static_queries_migration_template_spec.ts +++ b/packages/core/schematics/test/static_queries_migration_template_spec.ts @@ -30,7 +30,8 @@ describe('static-queries migration with template strategy', () => { compilerOptions: { experimentalDecorators: true, lib: ['es2015'], - } + }, + angularCompilerOptions: {enableIvy: false} })); writeFile('/angular.json', JSON.stringify({ projects: {t: {architect: {build: {options: {tsConfig: './tsconfig.json'}}}}} @@ -681,6 +682,7 @@ describe('static-queries migration with template strategy', () => { angularCompilerOptions: { flatModuleId: 'flat-module', flatModuleOutFile: 'flat-module-bundle.js', + enableIvy: false, }, files: ['index.ts'] })); diff --git a/packages/core/schematics/test/static_queries_migration_usage_spec.ts b/packages/core/schematics/test/static_queries_migration_usage_spec.ts index 02946c884dc..ffdc811efda 100644 --- a/packages/core/schematics/test/static_queries_migration_usage_spec.ts +++ b/packages/core/schematics/test/static_queries_migration_usage_spec.ts @@ -34,7 +34,8 @@ describe('static-queries migration with usage strategy', () => { writeFile('/tsconfig.json', JSON.stringify({ compilerOptions: { lib: ['es2015'], - } + }, + angularCompilerOptions: {enableIvy: false} })); writeFile('/angular.json', JSON.stringify({ projects: {t: {architect: {build: {options: {tsConfig: './tsconfig.json'}}}}} diff --git a/packages/core/schematics/test/template_var_assignment_migration_spec.ts b/packages/core/schematics/test/template_var_assignment_migration_spec.ts index c21a6666b53..d2549b19e14 100644 --- a/packages/core/schematics/test/template_var_assignment_migration_spec.ts +++ b/packages/core/schematics/test/template_var_assignment_migration_spec.ts @@ -28,7 +28,8 @@ describe('template variable assignment migration', () => { writeFile('/tsconfig.json', JSON.stringify({ compilerOptions: { lib: ['es2015'], - } + }, + angularCompilerOptions: {enableIvy: false} })); writeFile('/angular.json', JSON.stringify({ projects: {t: {architect: {build: {options: {tsConfig: './tsconfig.json'}}}}} diff --git a/packages/core/schematics/test/undecorated_classes_with_di_migration_spec.ts b/packages/core/schematics/test/undecorated_classes_with_di_migration_spec.ts index 0d090c3868b..e51b34644ad 100644 --- a/packages/core/schematics/test/undecorated_classes_with_di_migration_spec.ts +++ b/packages/core/schematics/test/undecorated_classes_with_di_migration_spec.ts @@ -31,7 +31,8 @@ describe('Undecorated classes with DI migration', () => { writeFile('/tsconfig.json', JSON.stringify({ compilerOptions: { lib: ['es2015'], - } + }, + angularCompilerOptions: {enableIvy: false} })); writeFile('/angular.json', JSON.stringify({ projects: {t: {architect: {build: {options: {tsConfig: './tsconfig.json'}}}}} @@ -1259,6 +1260,7 @@ describe('Undecorated classes with DI migration', () => { generateCodeForLibraries: false, allowEmptyCodegenFiles: true, enableSummariesForJit: true, + enableIvy: false, } }));