Skip to content

Commit

Permalink
Document why we can't use es2022 as target
Browse files Browse the repository at this point in the history
  • Loading branch information
rakyi committed Jan 24, 2025
1 parent a2b07e9 commit 89ab5b7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions devTools/tsconfigs/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
"declarationMap": true,

"lib": ["dom", "dom.iterable", "es2020", "es2021", "es2022", "es2023"],
// Using es2022 as a `target` caused the following error in wrangler:
// "Uncaught TypeError: PointVector is not a constructor".
// This seems to be related to a change in how classes are compiled in
// es2022 when used with `experimentalDecorators`. It probably means
// that to upgrade to a newer target, we'll either have to stop using
// `experimentalDecorators` or this problem might be eventuallly fixed
// by upgrading to a newer version of TypeScript or wrangler, or in one
// of the higher `target`s. Possibly related TypeScript issues:
// https://github.com/microsoft/TypeScript/issues/51570
// https://github.com/microsoft/TypeScript/issues/52004
"target": "es2021",

"alwaysStrict": true,
Expand Down

0 comments on commit 89ab5b7

Please sign in to comment.