HomeWinBuzzer NewsMicrosoft Rolls out General Release of TypeScript 2.0

Microsoft Rolls out General Release of TypeScript 2.0

Microsoft has generally released TypeScript 2.0, bringing non-nullable types, easier module declarations and control flow analysis to thousands of users.

-

We've been keeping a close eye on TypeScript 2.0. The new version of 's open-source subset first surfaced in July. After that beta, Microsoft announced a release candidate, and now the version is generally available.

TypeScript's roots go as far back as 2012. Since then, the subset has been evolving with new features and tools, and this has made it popular with developers across the world.

New TypeScript 2.0 Features

TypeScript 2.0 brings a number of new features with the goal of enhancing productivity, providing wider support for different languages, and improving the editing experience.

Here's an explanation of some of the most noteworthy ones:

  • Control Flow Analysis for Types:  In 2.0, we've started using control flow analysis to better understand what a type has to be at a given location.
  • Easier Module Declarations: Now you can import any path that starts with foo/ and TypeScript will assume it exists. You can take advantage of this if your module loader understands how to import based on a certain pattern too. Now whenever you import a path ending with !text, TypeScript will understand that the import should be typed as a string.
  • Non-nullable Types: Before TypeScript 2.0,null and undefined were in the domain of every type. That meant that if you had a function that took astring, you couldn't be sure from the type alone of whether you actually had a string – you might actually have nullIn TypeScript 2.0, the new --strictNullChecks flag changes that. string just means string andnumber means number.

According to Microsoft, many of these changes are thanks to the dedicated community. The service has grown from 275,000 downloads a month to over 2 million. Furthermore, the GitHub project has over 2000 comments, 1500 issue logs, and code from over 150 users.

Of course, this is far from the end for TypeScript. Microsoft has ideas in the pipeline to make it easier for users to express JavaScript statically. The language service will also continue to evolve, creating a tool that is smarter and more productive than ever.

You can try out TypeScript for yourself by downloading it here.

SourceMicrosoft
Ryan Maskell
Ryan Maskellhttps://ryanmaskell.co.uk
Ryan has had a passion for gaming and technology since early childhood. Fusing the skills from his Creative Writing and Publishing degree with profound technical knowledge, he enjoys covering news about Microsoft. As an avid writer, he is also working on his debut novel.

Recent News