Announcing TypeScript 5.1 Beta

Mark Sikaundi

Mark Sikaundi

July 18th, 2024 | 21:1 | 0

Today we're announcing our beta release of TypeScript 5.1!

To get started using the beta, you can get it through NuGet or through npm with the following command:

TypeScript 5.1 Beta is OUT!

TypeScript 5.1 unblocks React Server Components, brings some nice usability updates to functions returning undefined, and some perf improvements.

Transcript

0:00 What's up, Wizards? The TypeScript 5.1 Beta is out. My neighbors are building something in their back garden, so apologies for the noise, but I have to get this out right now. There are two main things that come from this release. The first one is undefined-returning functions.

0:14 Functions that don't return anything in JavaScript just return undefined. In TypeScript, they're inferred as void. This one here, for instance, this function that's just returning absolutely nothing, is inferred as a function with no parameters that just returns void.

0:28 What if the type of the function that you're passing in or the type that's expected actually returns undefined? This, currently, in TypeScript 5, will be an error. There are a bunch of these different cases here. This actually makes it less usable than you might expect...

More Tips

Type Predicates

1 min

How to Name your Types

4 mins

Don't use return types, unless...

5 mins

TypeScript 5.0 Beta Deep Dive

6 mins

Conform a Derived Type Without Losing Its Literal Values

1 min

Conform a Derived Type Without Losing Its Literal Values

1 min

Conform a Derived Type Without Losing Its Literal Values

1 min

Conform a Derived Type Without Losing Its Literal Values

1 min

New TypeScript tips delivered to your inbox: