Skip to content

Commit 1226e56

Browse files
authored
feat(typescript): add support for typescript v4.7 (#3530)
this pr adds support through v4.7.4 of typescript. to support v4.6 and v4.7, minor changes were required for each: - to add support for TypeScript 4.6, the `lib` fields of a few `tsconfig.json` files needed to be updated to continue to support `Array.prototype.flat()`. TS no longer bundles `flat` in `esnext.array`, but does in `es2019`. as a result, the former value was removed, while `es2017` was bumped to `es2019` - to add support for TypeScript v4.7, `Performance` gained the `EventCount` field, which was added to `MockPerformance` to adhere to that interface. STENCIL-435: Upgrade TypeScript to v4.7
1 parent 29034f9 commit 1226e56

File tree

6 files changed

+21
-11
lines changed

6 files changed

+21
-11
lines changed

package-lock.json

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
"semver": "7.3.4",
131131
"sizzle": "^2.3.6",
132132
"terser": "5.6.1",
133-
"typescript": "4.5.4",
133+
"typescript": "4.7.4",
134134
"webpack": "^4.46.0",
135135
"ws": "7.4.6"
136136
},

scripts/tsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
"forceConsistentCasingInFileNames": true,
77
"lib": [
88
"dom",
9-
"es2017",
10-
"esnext.array"
9+
"es2019",
1110
],
1211
"module": "commonjs",
1312
"moduleResolution": "node",

src/compiler/sys/dependencies.json

+9
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@
4444
"compiler/lib.es2019.symbol.d.ts",
4545
"compiler/lib.es2020.bigint.d.ts",
4646
"compiler/lib.es2020.d.ts",
47+
"compiler/lib.es2020.date.d.ts",
4748
"compiler/lib.es2020.full.d.ts",
4849
"compiler/lib.es2020.intl.d.ts",
50+
"compiler/lib.es2020.number.d.ts",
4951
"compiler/lib.es2020.promise.d.ts",
5052
"compiler/lib.es2020.sharedmemory.d.ts",
5153
"compiler/lib.es2020.string.d.ts",
@@ -56,6 +58,13 @@
5658
"compiler/lib.es2021.promise.d.ts",
5759
"compiler/lib.es2021.string.d.ts",
5860
"compiler/lib.es2021.weakref.d.ts",
61+
"compiler/lib.es2022.array.d.ts",
62+
"compiler/lib.es2022.d.ts",
63+
"compiler/lib.es2022.error.d.ts",
64+
"compiler/lib.es2022.full.d.ts",
65+
"compiler/lib.es2022.intl.d.ts",
66+
"compiler/lib.es2022.object.d.ts",
67+
"compiler/lib.es2022.string.d.ts",
5968
"compiler/lib.es5.d.ts",
6069
"compiler/lib.es6.d.ts",
6170
"compiler/lib.esnext.d.ts",

src/mock-doc/performance.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
*/
44
export class MockPerformance implements Performance {
55
timeOrigin: number;
6+
eventCounts: EventCounts;
67

78
constructor() {
89
this.timeOrigin = Date.now();
10+
this.eventCounts = new Map<string, number>();
911
}
1012

1113
addEventListener() {

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"jsx": "react",
1010
"jsxFactory": "h",
1111
"jsxFragmentFactory": "Fragment",
12-
"lib": ["dom", "es2018", "esnext.array"],
12+
"lib": ["dom", "es2019"],
1313
"module": "esnext",
1414
"moduleResolution": "node",
1515
"noImplicitAny": true,

0 commit comments

Comments
 (0)