Skip to content

Introduce ES2025 target & Add missing ScriptTargetFeatures#63046

Merged
jakebailey merged 21 commits intomicrosoft:mainfrom
petamoriken:feat/es2025-target
Feb 6, 2026
Merged

Introduce ES2025 target & Add missing ScriptTargetFeatures#63046
jakebailey merged 21 commits intomicrosoft:mainfrom
petamoriken:feat/es2025-target

Conversation

@petamoriken
Copy link
Contributor

@petamoriken petamoriken commented Jan 24, 2026

Fixes #61735

This PR includes the addition of 2 type files:

  • es2025.regexp.d.ts
  • es2025.intl.d.ts

Related issues and (stalled) PRs

ES2025 RegExp.escape (es2025.regexp.d.ts)

Closes #61321
Closes #62138

ES2025 Intl.DurationFormat (es2025.intl.d.ts)

Closes #60608
Closes #60646

@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Jan 24, 2026
@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Jan 24, 2026
@typescript-bot
Copy link
Collaborator

Thanks for the PR! It looks like you've changed the TSServer protocol in some way. Please ensure that any changes here don't break consumers of the current TSServer API. For some extra review, we'll ping @sheetalkamat, @mjbvz, and @joj for you. Feel free to loop in other consumers/maintainers if necessary.

@typescript-bot
Copy link
Collaborator

Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page.

Also, please make sure @DanielRosenwasser and @RyanCavanaugh are aware of the changes, just as a heads up.

@petamoriken petamoriken changed the title Introduce ES2025 target Introduce ES2025 target & Add missing ScriptTargetFeatures Jan 24, 2026
@pluma
Copy link

pluma commented Jan 28, 2026

Can we please get this reviewed? I know the country is burning and everyone is being replaced by AI but this would be really useful for those of us who deal with audiences across different languages.

@jakebailey
Copy link
Member

We have a lot of these lib related PRs; it's absolutely our intention to review all of them as soon as we can, we've just had a bunch of other stuff that has been a bit more pressing.

@jakebailey
Copy link
Member

I will note that an all-up PR for this may not be as useful as us reviewing the individual esnext PRs and then having a dedicated ES2025 PR; them being mixed together in this PR is making it hard to figure out what's new and what's just moving around. I would have preferred that the other PRs not be closed and this PR be a pure move + define options.

@petamoriken
Copy link
Contributor Author

Only two files were newly added: es2025.intl.d.ts and es2025.regexp.d.ts.

I created this combined PR because the individual "esnext" PRs for these features had stalled, and there had been no progress. I wanted to take over the tasks myself, and since there are only two added files, I thought the review would not be too difficult.

@jakebailey If you still prefer to have them separated, I can create two individual PRs instead. What do you think?

@petamoriken
Copy link
Contributor Author

@jakebailey For now, I can remove the additions of es2025.intl.d.ts and es2025.regexp.d.ts from this PR, but should I do so? Please let me know your thoughts.

@jakebailey
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 4, 2026

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
test top400 ✅ Started ✅ Results
user test this ✅ Started ✅ Results
run dt ✅ Started ✅ Results
perf test this faster ✅ Started 👀 Results

Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some other stuff I noticed.


type DurationFormatUnitSingular =
| "year"
| "quarter"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "quarter" real?

Comment on lines 71 to 94
locale?: UnicodeBCP47LocaleIdentifier;
numberingSystem?: DateTimeFormatOptions["numberingSystem"];
style?: DurationFormatStyle;
years?: Exclude<DurationFormatOption, "numeric" | "2-digit">;
yearsDisplay?: DurationFormatDisplayOption;
months?: Exclude<DurationFormatOption, "numeric" | "2-digit">;
monthsDisplay?: DurationFormatDisplayOption;
weeks?: Exclude<DurationFormatOption, "numeric" | "2-digit">;
weeksDisplay?: DurationFormatDisplayOption;
days?: Exclude<DurationFormatOption, "numeric" | "2-digit">;
daysDisplay?: DurationFormatDisplayOption;
hours?: DurationFormatOptions;
hoursDisplay?: DurationFormatDisplayOption;
minutes?: DurationFormatOptions;
minutesDisplay?: DurationFormatDisplayOption;
seconds?: DurationFormatOptions;
secondsDisplay?: DurationFormatDisplayOption;
milliseconds?: DurationFormatOptions;
millisecondsDisplay?: DurationFormatDisplayOption;
microseconds?: DurationFormatOptions;
microsecondsDisplay?: DurationFormatDisplayOption;
nanoseconds?: DurationFormatOptions;
nanosecondsDisplay?: DurationFormatDisplayOption;
fractionalDigits?: fractionalDigitsOption;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These options don't appear to be resolved; I think they should omit the ?.

@jakebailey
Copy link
Member

I am actually quite confused why these intl changes are in ES2025. Doesn't https://github.com/tc39/proposal-intl-duration-format imply they are ES2024?

@jakebailey
Copy link
Member

I think I'm just wrong; it's in https://tc39.es/ecma402/2025/ but not https://tc39.es/ecma402/2024/.

| "day"
| "hour"
| "minute"
| "second";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this also needs milliseconds, microseconds, nanoseconds

minutesDisplay?: DurationFormatDisplayOption;
seconds?: DurationFormatOptions;
secondsDisplay?: DurationFormatDisplayOption;
milliseconds?: DurationFormatOptions;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For milliseconds, microseconds, nanoseconds (not display), I think they need to be Exclude<DurationFormatOption, "2-digit"> (and below)

@jakebailey
Copy link
Member

I realize I dumped a bunch of changes onto you; if you are too busy, I'm happy to just push the intl changes to the PR directly.

@petamoriken
Copy link
Contributor Author

Instead of adding a new type as with other Intl type definitions, I wrote it inline within DurationFormatOptions. This might make the changes harder to review due to the volume. I apologize for the inconvenience.

@petamoriken
Copy link
Contributor Author

I realize I dumped a bunch of changes onto you; if you are too busy, I'm happy to just push the intl changes to the PR directly.

I have fixed most of it on my end. If the release of TypeScript 6.0 is imminent and you need the changes reflected immediately, please feel free to push directly to the PR 🙇

@petamoriken
Copy link
Contributor Author

It seems that in es2023.intl.d.ts (Intl.NumberFormat) and es2022.intl.d.ts (Intl.Segmenter), types are defined inline within the options interfaces as much as possible, whereas in es2020.intl.d.ts (Intl.RelativeTimeFormat), types like RelativeTimeFormatUnit and RelativeTimeFormatUnitSingular are explicitly defined...

@jakebailey
Copy link
Member

It seems that in es2023.intl.d.ts (Intl.NumberFormat) and es2022.intl.d.ts (Intl.Segmenter), types are defined inline within the options interfaces as much as possible, whereas in es2020.intl.d.ts (Intl.RelativeTimeFormat), types like RelativeTimeFormatUnit and RelativeTimeFormatUnitSingular are explicitly defined...

Yeah, I was thinking that we should do the middle ground, retaining:

  • DurationFormatLocaleMatcher
  • DurationFormatStyle
  • DurationFormatDisplayOption
  • DurationFormatUnit
  • DurationFormatUnitSingular

@jakebailey
Copy link
Member

Ah, I just pushed to this, but didn't notice you were around to react. Well, I think it's in a good state now?

@jakebailey
Copy link
Member

For some reason GitHub is not showing https://github.com/petamorike/TypeScript/commit/27bfccaac48540492a18f202227ed44c38b009a4 in this PR (and gh pr checkout did not pull it!), but it's there on your branch, and my commit comes after it and shows up...

Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cross checked again, and looked at diffs that weren't simple replacements. All looks good.

I pushed to this last, so I can't approve, so I'll get someone to look.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this file get an output? Was its target incorrectly specified before?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR is too big to see that there are test cases at the very very bottom. If you view on github.dev or just clone, you can see it.

@github-project-automation github-project-automation bot moved this from Not started to Needs merge in PR Backlog Feb 6, 2026
@jakebailey jakebailey added this pull request to the merge queue Feb 6, 2026
Merged via the queue into microsoft:main with commit ee09569 Feb 6, 2026
23 checks passed
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Feb 6, 2026
@petamoriken petamoriken deleted the feat/es2025-target branch February 7, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add ES2025 target and library Add types for RegExp.escape Intl.DurationFormat missing from library definitions

5 participants