Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript 5.2 Iteration Plan #54298

Closed
DanielRosenwasser opened this issue May 17, 2023 · 25 comments
Closed

TypeScript 5.2 Iteration Plan #54298

DanielRosenwasser opened this issue May 17, 2023 · 25 comments
Labels
Planning Iteration plans and roadmapping

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented May 17, 2023

This document outlines our focused tasks for TypeScript 5.2. It minimally indicates intent to investigate tasks or contribute to an implementation. Nothing is set in stone, but we will strive to complete these tasks in a reasonable timeframe.

Date Event
2023-05-30 TypeScript 5.1 Release
2023-06-23 Create 5.2 Beta (5.2.0) Build for Testing
2023-06-27 TypeScript 5.2 Beta Release
2023-08-04 Create 5.2 RC (5.2.1) Build for Testing
2023-08-08 TypeScript 5.2 RC Release
2023-08-18 Create 5.2 Final (5.2.2) Build for Testing
2023-08-22 TypeScript 5.2 Final Release 🚀
gantt
    dateFormat  YYYY-MM-DD
    TypeScript 5.1 Stabilization Period : 2023-05-15, 2023-05-30
    TypeScript 5.2 Beta Development : 2023-05-15, 2023-06-27
    TypeScript 5.2 RC Development : 2023-06-27, 2023-08-04
    TypeScript 5.2 Stabilization Period : 2023-08-04, 2023-08-22
todayMarker stroke-width:5px,stroke:#0f0,opacity:0.5
Loading

Compiler and Language

Editor and Language Service

Performance

Website and Docs

Infrastructure

@DanielRosenwasser DanielRosenwasser added the Planning Iteration plans and roadmapping label May 17, 2023
@RyanCavanaugh RyanCavanaugh pinned this issue May 17, 2023
@DanielRosenwasser
Copy link
Member Author

The previous Iteration Plan for TypeScript 5.1 is available here.

@fleddri
Copy link

fleddri commented May 23, 2023

Are there any plans or discussions regarding #53656?

@TmLev
Copy link

TmLev commented Jun 2, 2023

Also interested if you have any plans regarding #41316? Working on libraries seems impossible without it sometimes.

@Mike-Dax
Copy link

Mike-Dax commented Jun 15, 2023

I've been recently hitting up against #53018 and #54029 seems to open a bunch of opportunities for reverse mapped types to receive better inference. It would be a real game changer to our main APIs. Is there anything a community member can do to help with something like this?

@max-kamps
Copy link

Is #14729 still being investigated? It got closed after #51328 got accepted for 5.1, but has since been re-opened since the PR didn't actually address most of #14729's usecases.

@DanielRosenwasser
Copy link
Member Author

@typescript-bot sync release-5.2 and LKG

@typescript-bot
Copy link
Collaborator

Heya @DanielRosenwasser, I've started to sync release-5.2 with main for you. Here's the link to my best guess at the log.

@Andarist
Copy link
Contributor

I've been recently hitting up against #53018 and #54029 seems to open a bunch of opportunities for reverse mapped types to receive better inference. It would be a real game changer to our main APIs. Is there anything a community member can do to help with something like this?

@Mike-Dax my PR isn't (yet) complete - it has some rough edges that I need to figure out. I'd happily collaborate on this one with somebody, I already know what I want to do there just need to find a proper way to fit those ideas into the code and the available data structures.

@fatcerberus
Copy link

Here's the link to my best guess at the log.

What the… what even kind of bot is this
Bad bot

@timbuckley
Copy link
Contributor

timbuckley commented Jul 6, 2023

Not explicitly mentioned above but this also lands support for Change Array By Copy methods (eg arr.toReversed(), arr.toSorted(), arr.with(index, value), etc).

Issue: #50333
PR: #51367
ECMAScript proposal: https://github.com/tc39/proposal-change-array-by-copy

@RyanCavanaugh
Copy link
Member

FYI: #54923

@DanielRosenwasser
Copy link
Member Author

@typescript-bot bump release-5.2

@typescript-bot
Copy link
Collaborator

Heya @DanielRosenwasser, I've started to update the version number on release-5.2 to 5.2.1-rc for you. Here's the link to my best guess at the log.

@eps1lon
Copy link
Contributor

eps1lon commented Aug 11, 2023

How template literals as computed properties on objects are now typed as literals instead of strings seems to not be mentioned in the changelog:

const key = 'foo'

// {
//    foo: number;
//    "foo-de": string;
// }

const object = {
    [key]: 1,
    [`${key}-de`]: "2"
}

// Errors in 5.1.6 with "Property 'match' does not exist on type 'string | number'."
object['foo-de'].match(/2/)
object['foo'] + 1;

Playground Link 5.2.0-beta

vs

const key = 'foo'

// {
//    [x: string]: string | number;
//    foo: number;
// }

const object = {
    [key]: 1,
    [`${key}-de`]: "2"
}


// @ts-expect-error
object['foo-de'].match(/2/)
object['foo'] + 1;

Playground Link 5.1.6

Seems like a good change but probably worth mentioning.

@Andarist
Copy link
Contributor

If im not mistaken this was changed by #53907

@eps1lon
Copy link
Contributor

eps1lon commented Aug 14, 2023

Also positive change: referencing const enums in template literal types used to error under --isolatedModules but doesn't anymore:

export declare const enum OBJECT_INDICATION_TYPE {
    HIGHLIGHTED_DOT = "HIGHLIGHTED_DOT"
}
type Values<T> = {
    [K in keyof T]: T[K];
}[keyof T];
export type IndicationType = `${Values<typeof OBJECT_INDICATION_TYPE>}`;
// Fixed:                                     ^^^^^^^^^^^^^^^^^^^^^^ Cannot access ambient const enums when 'isolatedModules' is enabled.(274
export {};

Playground Link

@DanielRosenwasser
Copy link
Member Author

@typescript-bot bump release-5.2

@typescript-bot
Copy link
Collaborator

Heya @DanielRosenwasser, I've started to update the version number on release-5.2 to 5.2.2 for you. Here's the link to my best guess at the log.

@dimatakoy
Copy link

Version 5.2.2 is already available on npm, but I don't see a corresponding tag and release/changelog in this repository. Can you add the actual release here on the github?

@DanielRosenwasser
Copy link
Member Author

It's tagged now - but can I ask what you all use the tag for?

@timbuckley
Copy link
Contributor

It's tagged now - but can I ask what you all use the tag for?

Speaking for myself: Github watch notifications on release tags to know when new releases happen.

@dimatakoy
Copy link

It's tagged now - but can I ask what you all use the tag for?

— Release notifications / changelogs
— Easy way to compare releases

@RHOOPH
Copy link

RHOOPH commented Sep 5, 2023

Not explicitly mentioned above but this also lands support for Change Array By Copy methods (eg arr.toReversed(), arr.toSorted(), arr.with(index, value), etc).

Issue: #50333 PR: #51367 ECMAScript proposal: https://github.com/tc39/proposal-change-array-by-copy

I've upgraded to 5.2.2 but still shows error.
Property 'toSpliced' does not exist on type 'string[]'. Did you mean 'splice'?
Am i missing something? @timbuckley

@timbuckley
Copy link
Contributor

timbuckley commented Sep 5, 2023

Not explicitly mentioned above but this also lands support for Change Array By Copy methods (eg arr.toReversed(), arr.toSorted(), arr.with(index, value), etc).
Issue: #50333 PR: #51367 ECMAScript proposal: https://github.com/tc39/proposal-change-array-by-copy

I've upgraded to 5.2.2 but still shows error. Property 'toSpliced' does not exist on type 'string[]'. Did you mean 'splice'? Am i missing something? @timbuckley

@RHOOPH I think your runtime (whether browser or Node) still needs to use toSpliced, independent of whether TypeScript understands that type (which it only does after 5.2).

Node v20 is the first Node version to support it, for example. Scroll down to that line in this compatibility chart: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#browser_compatibility

@sacru2red
Copy link

target should set to esnext. In tsconfig.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Planning Iteration plans and roadmapping
Projects
None yet
Development

No branches or pull requests

15 participants