Skip to content

Commit fbd7361

Browse files
authored
build: drop support for TypeScript 4.4 and 4.5 (#24627)
Removes our tests and compatibility code for TypeScript less than 4.6.
1 parent 9371606 commit fbd7361

File tree

4 files changed

+6
-30
lines changed

4 files changed

+6
-30
lines changed

integration/ts-compat/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ write_file(
1313
# List of TypeScript packages that we want to run the compatibility test against.
1414
# The list contains NPM module names that resolve to the desired TypeScript version.
1515
typescript_version_packages = [
16-
"typescript-4.4",
17-
"typescript-4.5",
1816
"typescript",
1917
]
2018

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,6 @@
216216
"tslint": "^6.1.3",
217217
"tsutils": "^3.21.0",
218218
"typescript": "~4.6.2",
219-
"typescript-4.4": "npm:[email protected]",
220-
"typescript-4.5": "npm:[email protected]",
221219
"vrsource-tslint-rules": "6.0.0",
222220
"yaml": "^1.10.2",
223221
"yargs": "^17.3.1",

src/material/schematics/ng-update/migrations/hammer-gestures-v9/import-manager.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ interface AnalyzedImport {
3939
/** Checks whether an analyzed import has the given import flag set. */
4040
const hasFlag = (data: AnalyzedImport, flag: ImportState) => (data.state & flag) !== 0;
4141

42-
/** Parsed version of TypeScript that can be used for comparisons. */
43-
const PARSED_TS_VERSION = parseFloat(ts.versionMajorMinor);
44-
4542
/**
4643
* Import manager that can be used to add or remove TypeScript imports within source
4744
* files. The manager ensures that multiple transformations are applied properly
@@ -349,7 +346,7 @@ export class ImportManager {
349346
if (importData.specifiers) {
350347
const namedBindings = importData.node.importClause!.namedBindings as ts.NamedImports;
351348
const importSpecifiers = importData.specifiers.map(s =>
352-
createImportSpecifier(s.propertyName, s.name),
349+
ts.factory.createImportSpecifier(false, s.propertyName, s.name),
353350
);
354351
const updatedBindings = ts.factory.updateNamedImports(namedBindings, importSpecifiers);
355352

@@ -527,14 +524,3 @@ export class ImportManager {
527524
return commentRanges[commentRanges.length - 1]!.end;
528525
}
529526
}
530-
531-
// TODO(crisbeto): backwards-compatibility layer that allows us to support both TS 4.4 and 4.5.
532-
// Should be removed once we don't have to support 4.4 anymore.
533-
function createImportSpecifier(
534-
propertyName: ts.Identifier | undefined,
535-
name: ts.Identifier,
536-
): ts.ImportSpecifier {
537-
return PARSED_TS_VERSION > 4.4
538-
? ts.factory.createImportSpecifier(false, propertyName, name)
539-
: (ts.createImportSpecifier as any)(propertyName, name);
540-
}

yarn.lock

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@
325325

326326
"@angular/dev-infra-private@https://github.com/angular/dev-infra-private-builds.git#7544378ad9aa94cdfe256aaaa923c107f45175a2":
327327
version "0.0.0-8feef7a4ad17f94a98b55e3fa7ce4697bfaef895"
328-
uid "7544378ad9aa94cdfe256aaaa923c107f45175a2"
329328
resolved "https://github.com/angular/dev-infra-private-builds.git#7544378ad9aa94cdfe256aaaa923c107f45175a2"
330329
dependencies:
331330
"@angular-devkit/build-angular" "14.0.0-next.3"
@@ -14991,16 +14990,6 @@ typedarray-to-buffer@^3.1.5:
1499114990
dependencies:
1499214991
is-typedarray "^1.0.0"
1499314992

14994-
"typescript-4.4@npm:[email protected]":
14995-
version "4.4.2"
14996-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86"
14997-
integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==
14998-
14999-
"typescript-4.5@npm:[email protected]", typescript@~4.5.2:
15000-
version "4.5.5"
15001-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3"
15002-
integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==
15003-
1500414993
[email protected], typescript@~4.5.0, typescript@~4.5.4, typescript@~4.6.2:
1500514994
version "4.6.2"
1500614995
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.2.tgz#fe12d2727b708f4eef40f51598b3398baa9611d4"
@@ -15011,6 +15000,11 @@ typescript@^3.9.10, typescript@^3.9.5, typescript@^3.9.7:
1501115000
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.10.tgz#70f3910ac7a51ed6bef79da7800690b19bf778b8"
1501215001
integrity sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==
1501315002

15003+
typescript@~4.5.2:
15004+
version "4.5.5"
15005+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3"
15006+
integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==
15007+
1501415008
1501515009
version "1.0.2"
1501615010
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.2.tgz#e2976c34dbfb30b15d2c300b2a53eac87c57a775"

0 commit comments

Comments
 (0)