chore!: bump TypeScript target and lib to ES2022 - #10019
Merged
Merged
Conversation
ES2022ES2022
Member
Author
|
@metamaskbot publish-previews |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
Mrtenz
force-pushed
the
mrtenz/typescript-7
branch
from
September 2, 2026 12:05
b721b22 to
6cbc3e7
Compare
Mrtenz
force-pushed
the
mrtenz/es2022
branch
from
September 2, 2026 12:09
3866c0f to
34a2377
Compare
|
No dependency changes detected. Learn more about Socket for GitHub. 👍 No dependency changes detected in pull request |
Mrtenz
force-pushed
the
mrtenz/es2022
branch
from
September 2, 2026 12:21
34a2377 to
00e5250
Compare
Mrtenz
force-pushed
the
mrtenz/typescript-7
branch
3 times, most recently
from
September 2, 2026 14:07
2b73d77 to
97ee0d1
Compare
Mrtenz
force-pushed
the
mrtenz/es2022
branch
from
September 2, 2026 14:07
00e5250 to
56013b5
Compare
Mrtenz
force-pushed
the
mrtenz/typescript-7
branch
from
September 2, 2026 18:08
97ee0d1 to
5572019
Compare
Mrtenz
force-pushed
the
mrtenz/es2022
branch
from
September 2, 2026 18:15
56013b5 to
3c4978c
Compare
Mrtenz
marked this pull request as ready for review
September 2, 2026 18:15
Mrtenz
temporarily deployed
to
default-branch
September 2, 2026 18:16 — with
GitHub Actions
Inactive
Mrtenz
force-pushed
the
mrtenz/es2022
branch
from
September 2, 2026 18:18
3c4978c to
b485edf
Compare
Mrtenz
force-pushed
the
mrtenz/typescript-7
branch
from
September 2, 2026 18:30
5572019 to
f3a4585
Compare
baptiste-marchand
previously approved these changes
Sep 4, 2026
baptiste-marchand
left a comment
Contributor
There was a problem hiding this comment.
LGTM for engagement files
ccharly
previously approved these changes
Sep 4, 2026
Contributor
There was a problem hiding this comment.
LGTM for accounts, I still noticed the updated coverage threshold updates, but I guess that's just a side-effects of changing our target (nvm, found some explanations here: #10019 (comment), thanks 😄)
Closed
4 tasks
chaitanyapotti
previously approved these changes
Sep 7, 2026
OGPoyraz
previously approved these changes
Sep 7, 2026
Mrtenz
dismissed stale reviews from OGPoyraz, chaitanyapotti, ccharly, baptiste-marchand, abretonc7s, roz0n, geositta, rarquevaux, mcmire, Prithpal-Sooriya, and FrederikBolding
September 9, 2026 16:17
The merge-base changed after approval.
Mrtenz
force-pushed
the
mrtenz/typescript-7
branch
from
September 9, 2026 16:17
1865677 to
01e4234
Compare
Mrtenz
force-pushed
the
mrtenz/es2022
branch
from
September 9, 2026 16:17
97d4dae to
03f70bc
Compare
Mrtenz
force-pushed
the
mrtenz/typescript-7
branch
from
September 9, 2026 16:36
01e4234 to
8fbd269
Compare
Mrtenz
force-pushed
the
mrtenz/es2022
branch
2 times, most recently
from
September 9, 2026 16:52
761a5e1 to
47ee7b6
Compare
Mrtenz
force-pushed
the
mrtenz/typescript-7
branch
from
September 9, 2026 16:52
8fbd269 to
052a2f9
Compare
The browser targets and React Native version used by the clients that consume these packages support ES2022, so the target and lib settings can be updated to match that. We stop short of ES2023, since Hermes doesn't fully support it yet. This also lets `foundryup` drop its own `lib` override, since the base config now provides `ES2022` and `DOM` already.
Bumping the TypeScript target and lib to ES2022 changed the compiled output slightly, causing coverage to dip by a fraction of a percent in a handful of packages. Lower the affected `coverageThreshold` values in each package's `jest.config.cjs` to match.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
The base TypeScript configuration targeted
ES2020, which is older than what the browser targets and React Native version used by the clients that consume these packages actually support. Since those clients supportES2022, we can bump the sharedtargetandlibsettings toES2022to take advantage of newer syntax and APIs.We stop short of
ES2023, since Hermes (the React Native JS engine) doesn't fully support it yet (most notably,Array.prototype.toSortedis unsupported).References
N/A
Note
Medium Risk
Breaking build output across all packages may break downstream apps on older JS engines or misconfigured bundlers; no runtime behavior changes in controller logic.
Overview
This PR raises the monorepo’s shared TypeScript
targetandlibfrom ES2020 to ES2022 intsconfig.base.json(and ES2022 for scripts intsconfig.scripts.json), so published packages compile to newer JavaScript and type-check against ES2022 builtins.foundryupdrops its package-levellib: ["ES2021", "DOM"]overrides so it follows the shared base config like the rest of the repo.Every affected package’s
CHANGELOG.mddocuments a BREAKING change: consumers need a runtime or bundler that can handle ES2022 output. Severaljest.config.cjsfiles lower global coverage thresholds slightly—mechanical follow-up from the compile target change, not new product logic.Reviewed by Cursor Bugbot for commit 84b746b. Bugbot is set up for automated code reviews on this repo. Configure here.