Microsoft announces availability of TypeScript 6.0



 Microsoft Dev Blogs:

Today we are excited to announce the availability of TypeScript 6.0!

If you are not familiar with TypeScript, it’s a language that builds on JavaScript by adding syntax for types, which enables type-checking to catch errors, and provide rich editor tooling. You can learn more about TypeScript and how to get started on the TypeScript website.

But if you’re already familiar with the language, you can get TypeScript 6.0 through npm with the following command:

npm install -D typescript

TypeScript 6.0 is a unique release in that we intend for it to be the last release based on the current JavaScript codebase. As announced last year (with recent updates here), we are working on a new codebase for the TypeScript compiler and language service written in Go that takes advantage of the speed of native code and shared-memory multi-threading. That new codebase will be the foundation of TypeScript 7.0 and beyond.

TypeScript 6.0 acts as the bridge between TypeScript 5.9 and 7.0. As such, most changes in TypeScript 6.0 are meant to help align and prepare for adopting TypeScript 7.0. It may seem surprising to say, but TypeScript 7.0 is actually extremely close to completion. You can try it out in Visual Studio Code or install it from npm. In fact, if you’re able to adopt TypeScript 6.0, we encourage you to try out the native previews of TypeScript 7.0.

With that said, there are some new features and improvements in TypeScript 6.0s that are not just about alignment. Let’s take a look at some of the highlights of this release, followed by a more detailed look at what’s changing for 7.0 and how to prepare for it.

What’s New Since the Beta and RC?​

Since TypeScript 6.0 beta, we have made a few noteworthy changes – mostly to align with the behavior of TypeScript 7.0.

One adjustment is in type-checking for function expressions in generic calls, especially those occurring in generic JSX expressions (see this pull request). This will typically catch more bugs in existing code, though you may find that some generic calls may need an explicit type argument.

We have also extended our deprecation of import assertion syntax (i.e. import ... assert {...}) to import() calls like import(..., { assert: {...}})

Finally, we have updated the DOM types to reflect the latest web standards, including some adjustments to the Temporal APIs as well.

Preparing for TypeScript 7.0​

TypeScript 6.0 is designed as a transition release. While options deprecated in TypeScript 6.0 will continue to work without errors when "ignoreDeprecations": "6.0" is set, those options will be removed entirely in TypeScript 7.0 (the native TypeScript port). If you’re seeing deprecation warnings after upgrading to TypeScript 6.0, we strongly recommend addressing them before adopting TypeScript 7.0 (or trying native previews) in your project.

What’s Next?​

Now that TypeScript 6.0 is available on npm, the team will be focused on bringing TypeScript 7.0 to stability. This is much closer than it might sound: we expect a release within a few months, and we are already seeing broad adoption inside and outside of Microsoft on extremely large codebases. So we encourage teams to try out nightly builds of TypeScript 7.0’s native previews on npm along with the VS Code extension too. Feedback on TypeScript 7.0 will go a long way, and you can file issues on our issue tracker.

Still, TypeScript 6.0 is a stable release that you should be able to adopt today, and it includes a number of improvements and new features that you can start using right away. We hope this release will be a smooth transition for everyone, and we look forward to hearing about your experiences with it.

Happy Hacking!

– Daniel Rosenwasser and the TypeScript Team


 Read more:

 
Back
Top Bottom