Skip to content

Commit

Permalink
feat(typescript): add support for typescript v4.7 (#3530)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rwaskiewicz authored Aug 30, 2022
1 parent 29034f9 commit 1226e56
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 11 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"semver": "7.3.4",
"sizzle": "^2.3.6",
"terser": "5.6.1",
"typescript": "4.5.4",
"typescript": "4.7.4",
"webpack": "^4.46.0",
"ws": "7.4.6"
},
Expand Down
3 changes: 1 addition & 2 deletions scripts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"forceConsistentCasingInFileNames": true,
"lib": [
"dom",
"es2017",
"esnext.array"
"es2019",
],
"module": "commonjs",
"moduleResolution": "node",
Expand Down
9 changes: 9 additions & 0 deletions src/compiler/sys/dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@
"compiler/lib.es2019.symbol.d.ts",
"compiler/lib.es2020.bigint.d.ts",
"compiler/lib.es2020.d.ts",
"compiler/lib.es2020.date.d.ts",
"compiler/lib.es2020.full.d.ts",
"compiler/lib.es2020.intl.d.ts",
"compiler/lib.es2020.number.d.ts",
"compiler/lib.es2020.promise.d.ts",
"compiler/lib.es2020.sharedmemory.d.ts",
"compiler/lib.es2020.string.d.ts",
Expand All @@ -56,6 +58,13 @@
"compiler/lib.es2021.promise.d.ts",
"compiler/lib.es2021.string.d.ts",
"compiler/lib.es2021.weakref.d.ts",
"compiler/lib.es2022.array.d.ts",
"compiler/lib.es2022.d.ts",
"compiler/lib.es2022.error.d.ts",
"compiler/lib.es2022.full.d.ts",
"compiler/lib.es2022.intl.d.ts",
"compiler/lib.es2022.object.d.ts",
"compiler/lib.es2022.string.d.ts",
"compiler/lib.es5.d.ts",
"compiler/lib.es6.d.ts",
"compiler/lib.esnext.d.ts",
Expand Down
2 changes: 2 additions & 0 deletions src/mock-doc/performance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
*/
export class MockPerformance implements Performance {
timeOrigin: number;
eventCounts: EventCounts;

constructor() {
this.timeOrigin = Date.now();
this.eventCounts = new Map<string, number>();
}

addEventListener() {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"jsx": "react",
"jsxFactory": "h",
"jsxFragmentFactory": "Fragment",
"lib": ["dom", "es2018", "esnext.array"],
"lib": ["dom", "es2019"],
"module": "esnext",
"moduleResolution": "node",
"noImplicitAny": true,
Expand Down

0 comments on commit 1226e56

Please sign in to comment.