TypeScript 2.7 Released

Microsoft has released TypeScript 2.7 today. The new version incorporates a lot of improvements, bugfixes, and important updates.

Users can install the new version via NuGet or download it over npm using the below-mentioned command.

  1. npm install -g typescript  

Though the latest version of TypeScript, i.e., v2.7 is not yet available for Visual Studio Code users, it can be installed for Visual Studio 15 Update 3 from here and for Visual Studio 2017 v15.2 and above, from here.

According to the official announcement, the following are the breaking changes –

  • Stricter class property checks
  • Definite assignment assertions
  • Easier ECMAScript module interoperability
  • unique symbol types and const-named properties
  • Cleaner output in --watch mode
  • Prettier --pretty output
  • Numeric Separators
  • Fixed Length Tuples
  • in operator narrowing and accurate instanceof
  • Smarter object literal inference

 In addition, the new version has brought some minor breaking changes too –

  • Tuples now have fixed numeric length properties.
  • instanceof and in now have slightly different narrowing behavior.
  • Inferences from generic signatures now use base constraint types of type parameters instead of any.
  • The setSelectionRange API now only accepts "forward" | "backward" | "none".
  • allowSyntheticDefaultImports no longer synthesizes default imports from TypeScript implementation files (i.e. .ts and .tsx).
  • Additionally, users with the --strict setting on will automatically be opted in to --strictPropertyInitialization which errors on properties which are not directly initialized on their declarations or in constructor bodies. While easy to opt out of by explicitly turning this check off, your code may be impacted.

The complete list of improvements and changes can be found on the GitHub page.  The company also indicated that TypeScript v2.8 will include "conditional" types and will be released in March this year.

If you are new to TypeScript or want to learn programming in TypeScript, you can start from here