From fa048948be75c30dafebda69efbeb81776460500 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Tue, 16 Mar 2021 20:54:30 +0100 Subject: [PATCH] feat(core): drop support for TypeScript 4.0 and 4.1 (#41158) Drops support for TypeScript 4.0 and 4.1 across the repo. The typings check for 4.1 was kept in order to ensure that we don't break g3. PR Close #41158 --- integration/BUILD.bazel | 6 -- integration/typings_test_ts40/include-all.ts | 69 ------------------- integration/typings_test_ts40/package.json | 28 -------- integration/typings_test_ts40/tsconfig.json | 26 ------- packages/bazel/package.json | 2 +- packages/compiler-cli/package.json | 2 +- .../compiler-cli/src/typescript_support.ts | 2 +- 7 files changed, 3 insertions(+), 132 deletions(-) delete mode 100644 integration/typings_test_ts40/include-all.ts delete mode 100644 integration/typings_test_ts40/package.json delete mode 100644 integration/typings_test_ts40/tsconfig.json diff --git a/integration/BUILD.bazel b/integration/BUILD.bazel index 744fa88bf8..11e68f4040 100644 --- a/integration/BUILD.bazel +++ b/integration/BUILD.bazel @@ -85,12 +85,6 @@ INTEGRATION_TESTS = { "service-worker-schema": {}, "side-effects": {"tags": ["no-ivy-aot"]}, "terser": {}, - "typings_test_ts40": { - # Special case for `typings_test_ts40` test as we want to pin - # `typescript` at version 4.0.x for that test and not link to the - # root @npm//typescript package. - "pinned_npm_packages": ["typescript"], - }, "typings_test_ts41": { # Special case for `typings_test_ts41` test as we want to pin # `typescript` at version 4.1.x for that test and not link to the diff --git a/integration/typings_test_ts40/include-all.ts b/integration/typings_test_ts40/include-all.ts deleted file mode 100644 index 86b57f2789..0000000000 --- a/integration/typings_test_ts40/include-all.ts +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @license - * Copyright Google LLC 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 - */ - - - -import * as animations from '@angular/animations'; -import * as animationsBrowser from '@angular/animations/browser'; -import * as animationsBrowserTesting from '@angular/animations/browser/testing'; -import * as common from '@angular/common'; -import * as commonHttp from '@angular/common/http'; -import * as commonTesting from '@angular/common/testing'; -import * as commonHttpTesting from '@angular/common/testing'; -import * as compiler from '@angular/compiler'; -import * as compilerTesting from '@angular/compiler/testing'; -import * as core from '@angular/core'; -import * as coreTesting from '@angular/core/testing'; -import * as elements from '@angular/elements'; -import * as forms from '@angular/forms'; -import * as platformBrowser from '@angular/platform-browser'; -import * as platformBrowserDynamic from '@angular/platform-browser-dynamic'; -import * as platformBrowserDynamicTesting from '@angular/platform-browser-dynamic/testing'; -import * as platformBrowserAnimations from '@angular/platform-browser/animations'; -import * as platformBrowserTesting from '@angular/platform-browser/testing'; -import * as platformServer from '@angular/platform-server'; -import * as platformServerInit from '@angular/platform-server/init'; -import * as platformServerTesting from '@angular/platform-server/testing'; -import * as router from '@angular/router'; -import * as routerTesting from '@angular/router/testing'; -import * as routerUpgrade from '@angular/router/upgrade'; -import * as serviceWorker from '@angular/service-worker'; -import * as upgrade from '@angular/upgrade'; -import * as upgradeStatic from '@angular/upgrade/static'; -import * as upgradeTesting from '@angular/upgrade/static/testing'; - -export default { - animations, - animationsBrowser, - animationsBrowserTesting, - common, - commonTesting, - commonHttp, - commonHttpTesting, - compiler, - compilerTesting, - core, - coreTesting, - elements, - forms, - platformBrowser, - platformBrowserTesting, - platformBrowserDynamic, - platformBrowserDynamicTesting, - platformBrowserAnimations, - platformServer, - platformServerInit, - platformServerTesting, - router, - routerTesting, - routerUpgrade, - serviceWorker, - upgrade, - upgradeStatic, - upgradeTesting, -}; diff --git a/integration/typings_test_ts40/package.json b/integration/typings_test_ts40/package.json deleted file mode 100644 index c4a666ee33..0000000000 --- a/integration/typings_test_ts40/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "angular-integration", - "description": "Assert that users with TypeScript 4.0 can type-check an Angular application", - "version": "0.0.0", - "license": "MIT", - "dependencies": { - "@angular/animations": "file:../../dist/packages-dist/animations", - "@angular/common": "file:../../dist/packages-dist/common", - "@angular/compiler": "file:../../dist/packages-dist/compiler", - "@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli", - "@angular/core": "file:../../dist/packages-dist/core", - "@angular/elements": "file:../../dist/packages-dist/elements", - "@angular/forms": "file:../../dist/packages-dist/forms", - "@angular/platform-browser": "file:../../dist/packages-dist/platform-browser", - "@angular/platform-browser-dynamic": "file:../../dist/packages-dist/platform-browser-dynamic", - "@angular/platform-server": "file:../../dist/packages-dist/platform-server", - "@angular/router": "file:../../dist/packages-dist/router", - "@angular/service-worker": "file:../../dist/packages-dist/service-worker", - "@angular/upgrade": "file:../../dist/packages-dist/upgrade", - "@types/jasmine": "file:../../node_modules/@types/jasmine", - "rxjs": "file:../../node_modules/rxjs", - "typescript": "4.0.2", - "zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz" - }, - "scripts": { - "test": "tsc" - } -} diff --git a/integration/typings_test_ts40/tsconfig.json b/integration/typings_test_ts40/tsconfig.json deleted file mode 100644 index 30e25c2209..0000000000 --- a/integration/typings_test_ts40/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "compilerOptions": { - "forceConsistentCasingInFileNames": true, - "strict": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "experimentalDecorators": true, - "module": "commonjs", - "moduleResolution": "node", - "outDir": "./dist/out-tsc", - "rootDir": ".", - "target": "es5", - "lib": [ - "es5", - "dom", - "es2015.collection", - "es2015.iterable", - "es2015.promise" - ], - "types": [], - }, - "files": [ - "include-all.ts", - "node_modules/@types/jasmine/index.d.ts" - ] -} diff --git a/packages/bazel/package.json b/packages/bazel/package.json index 8d0a16d029..a709591910 100644 --- a/packages/bazel/package.json +++ b/packages/bazel/package.json @@ -28,7 +28,7 @@ "@angular/compiler-cli": "0.0.0-PLACEHOLDER", "@bazel/typescript": ">=1.0.0", "terser": "^4.3.1", - "typescript": ">=4.0 <4.3", + "typescript": ">=4.2.3 <4.3", "rollup": ">=1.20.0", "rollup-plugin-commonjs": ">=9.0.0", "rollup-plugin-node-resolve": ">=4.2.0", diff --git a/packages/compiler-cli/package.json b/packages/compiler-cli/package.json index 8ab09b6578..00600424d9 100644 --- a/packages/compiler-cli/package.json +++ b/packages/compiler-cli/package.json @@ -29,7 +29,7 @@ }, "peerDependencies": { "@angular/compiler": "0.0.0-PLACEHOLDER", - "typescript": ">=4.0 <4.3" + "typescript": ">=4.2.3 <4.3" }, "engines": { "node": ">=10.0" diff --git a/packages/compiler-cli/src/typescript_support.ts b/packages/compiler-cli/src/typescript_support.ts index ca41c33081..ec058be8d7 100644 --- a/packages/compiler-cli/src/typescript_support.ts +++ b/packages/compiler-cli/src/typescript_support.ts @@ -15,7 +15,7 @@ import {compareVersions} from './diagnostics/typescript_version'; * Note: this check is disabled in g3, search for * `angularCompilerOptions.disableTypeScriptVersionCheck` config param value in g3. */ -const MIN_TS_VERSION = '4.0.0'; +const MIN_TS_VERSION = '4.2.3'; /** * Supremum of supported TypeScript versions