You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.
Comment
We evaluated the 5.8 beta and RC releases and 5.8 seems to be a low impact release for us.
We are excited to adopt the new flag --erasableSyntaxOnly for the improved Editor experience for features we already avoid. A significant number of our projects already comply with the corresponding rules due to custom error checks that will happily become redundant. We remain interested in gaining the ability to use first-class enums that comply with the TS=JS+types model. For example via the erasable as enum syntax proposal.
#
Change
Affects
Release notes
Packages affected
1
Computed properties with a non literal type now appear in declarations
Declaration Emit
Yes
>1%
2
Better type checking of conditional expressions
Type Checking
No Yes
~1-2%
Computed properties with a non literal type now appear in declarations
Some declaration files changed and now preserve computed properties where index signatures would previously be created. This is an expected change and part of ongoing Isolated Declarations work.
// index.tsexportletfoo="x"exportclassBar{[foo]: string}// index.d.tsexportdeclareletfoo: string;exportdeclareclassBar{// in 5.8[foo]: string;// in 5.7[x: string]: string;}
Better checking in conditional expressions
We observed roughly a dozen new compile errors relating to improved conditional return checking.
In TypeScript 5.7 and before, if a branch of a conditional expression returned any we would not get an error if we returned the wrong type on the other branch. Now we do, at least if the expression is in the return of a function:
declareconstdata: number|string|undefined;constresult=(): number=>typeofdata==='string'
? nullasany
: data;// Error nowconstresult2: number=typeofdata==='string'
? nullasany
: data;// Still not an error ? 😕
Acknowledgement
Comment
We evaluated the 5.8 beta and RC releases and 5.8 seems to be a low impact release for us.
We are excited to adopt the new flag --erasableSyntaxOnly for the improved Editor experience for features we already avoid. A significant number of our projects already comply with the corresponding rules due to custom error checks that will happily become redundant. We remain interested in gaining the ability to use first-class enums that comply with the TS=JS+types model. For example via the erasable as enum syntax proposal.
NoYesComputed properties with a non literal type now appear in declarations
Some declaration files changed and now preserve computed properties where index signatures would previously be created. This is an expected change and part of ongoing Isolated Declarations work.
Better checking in conditional expressions
We observed roughly a dozen new compile errors relating to improved conditional return checking.
While not directly announced the change seems related to Checked Returns for Conditional and Indexed Access Types
In TypeScript 5.7 and before, if a branch of a conditional expression returned any we would not get an error if we returned the wrong type on the other branch. Now we do, at least if the expression is in the return of a function:
Link
The text was updated successfully, but these errors were encountered: