chore!: bump TypeScript target and lib to ES2022 - #10019
Open
Mrtenz wants to merge 4 commits into
Open
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/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/es2022
branch
from
September 2, 2026 14:07
00e5250 to
56013b5
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/es2022
branch
from
September 2, 2026 18:31
b485edf to
1d9b975
Compare
Mrtenz
force-pushed
the
mrtenz/es2022
branch
from
September 2, 2026 18:37
1d9b975 to
33814c7
Compare
Mrtenz
force-pushed
the
mrtenz/es2022
branch
from
September 2, 2026 18:53
33814c7 to
b3cbbb7
Compare
Mrtenz
force-pushed
the
mrtenz/es2022
branch
from
September 2, 2026 18:59
b3cbbb7 to
969489a
Compare
Mrtenz
force-pushed
the
mrtenz/es2022
branch
from
September 3, 2026 09:07
969489a to
775b2d5
Compare
Mrtenz
force-pushed
the
mrtenz/es2022
branch
from
September 3, 2026 09:11
775b2d5 to
df0cf76
Compare
4 tasks
Mrtenz
force-pushed
the
mrtenz/es2022
branch
from
September 3, 2026 09:20
df0cf76 to
6fdaf6e
Compare
Mrtenz
force-pushed
the
mrtenz/es2022
branch
from
September 3, 2026 10:55
6fdaf6e to
56565a0
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.
Mrtenz
force-pushed
the
mrtenz/es2022
branch
from
September 3, 2026 11:06
56565a0 to
97d4dae
Compare
FrederikBolding
approved these changes
Sep 3, 2026
Prithpal-Sooriya
approved these changes
Sep 3, 2026
rarquevaux
approved these changes
Sep 3, 2026
geositta
approved these changes
Sep 3, 2026
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
Monorepo-wide breaking compile target affects all package consumers on older JS engines or misconfigured bundlers; behavior change is limited to emitted syntax/API surface, not application logic.
Overview
Raises the shared TypeScript
targetandlibfrom ES2020 to ES2022 intsconfig.base.json(andtsconfig.scripts.jsonfor repo scripts), so published@metamask/*packages emit and type-check against ES2022.foundryupdrops its localES2021liboverride so it follows the repo base config. Every affected package CHANGELOG documents this as a breaking consumer change: builds now ship ES2022 output and need a compatible runtime or bundler.Several Jest
coverageThresholdvalues are nudged down slightly (no functional test changes in the diff).Reviewed by Cursor Bugbot for commit 97d4dae. Bugbot is set up for automated code reviews on this repo. Configure here.