Typescript: proposal-record-tuple

Created on 30 Jul 2020  路  5Comments  路  Source: microsoft/TypeScript

https://github.com/tc39/proposal-record-tuple is stage-2.
I haven't found related issue and I created this.
I'm a little worry about the global Record object and our utils type Record<>.

Suggestion Waiting for TC39

Most helpful comment

Hi @Kingwl,

The type is record and I am not worried about that. I am not even worried about the wrapper object type (like String, Number, and Boolean), because it is stated here that there will be no wrapper object instantiation.

However, TypeScript Record is not really a match for the proposed Record and that would cause confusion, don't you agree?

All 5 comments

FYI we're tracking these as part of our TC39 committee attendance, so there's not really a need to have TS issues for every stage 2 proposal - we don't want to fracture the discussion.

Hi @RyanCavanaugh,

I understand, but also share @Kingwl's concern. This is not a regular TC39 proposal. It introduces a global constructor which may cause a breaking change in TypeScript. It would be kind of you if you could share TypeScript's stance about the naming. Does it look like Record is going to be the eventual name for that constructor or is it still subject to change?

@armanozak I think it's might be ok. The ctor 'Record' is value and Record<> is type. TypeScript is work fine with this case. As the result, the type of record might be 'record', the lower case. Like number and Number, string and String.

But i'm not sure the other case. eg: Array ctor has type parameter, But seems Record cannot.

Hi @Kingwl,

The type is record and I am not worried about that. I am not even worried about the wrapper object type (like String, Number, and Boolean), because it is stated here that there will be no wrapper object instantiation.

However, TypeScript Record is not really a match for the proposed Record and that would cause confusion, don't you agree?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DanielRosenwasser picture DanielRosenwasser  路  3Comments

MartynasZilinskas picture MartynasZilinskas  路  3Comments

remojansen picture remojansen  路  3Comments

siddjain picture siddjain  路  3Comments

dlaberge picture dlaberge  路  3Comments