refactor(compiler): remove support for TypeScript 3.9 (#39313)

This commit removes TypeScript 3.9 support.

BREAKING CHANGE:

TypeScript 3.9 is no longer supported, please upgrade to TypeScript 4.0.

PR Close #39313
This commit is contained in:
Andrew Kushnir 2020-10-16 17:48:44 -07:00
parent 41c2228d49
commit f5a3e44e9d
3 changed files with 11 additions and 6 deletions

View File

@ -28,7 +28,7 @@
"@angular/compiler-cli": "0.0.0-PLACEHOLDER",
"@bazel/typescript": ">=1.0.0",
"terser": "^4.3.1",
"typescript": ">=3.9 <4.1",
"typescript": ">=4.0 <4.1",
"rollup": ">=1.20.0",
"rollup-plugin-commonjs": ">=9.0.0",
"rollup-plugin-node-resolve": ">=4.2.0",

View File

@ -29,7 +29,7 @@
},
"peerDependencies": {
"@angular/compiler": "0.0.0-PLACEHOLDER",
"typescript": ">=3.9 <4.1"
"typescript": ">=4.0 <4.1"
},
"engines": {
"node": ">=10.0"

View File

@ -11,13 +11,19 @@ import {compareVersions} from './diagnostics/typescript_version';
/**
* Minimum supported TypeScript version
* supported typescript version v, v >= MIN_TS_VERSION
*
* Note: this check is disabled in g3, search for
* `angularCompilerOptions.disableTypeScriptVersionCheck` config param value in g3.
*/
const MIN_TS_VERSION = '3.9.2';
const MIN_TS_VERSION = '4.0.0';
/**
* Supremum of supported TypeScript versions
* supported typescript version v, v < MAX_TS_VERSION
* MAX_TS_VERSION is not considered as a supported TypeScript version
*
* Note: this check is disabled in g3, search for
* `angularCompilerOptions.disableTypeScriptVersionCheck` config param value in g3.
*/
const MAX_TS_VERSION = '4.1.0';
@ -36,9 +42,8 @@ export function restoreTypeScriptVersionForTesting(): void {
}
/**
* Checks whether a given version [minVersion, maxVersion[
* An error will be thrown if the following statements are simultaneously true:
* - the given version [minVersion, maxVersion[,
* Checks whether a given version [minVersion, maxVersion[.
* An error will be thrown when the given version [minVersion, maxVersion[.
*
* @param version The version on which the check will be performed
* @param minVersion The lower bound version. A valid version needs to be greater than minVersion