Paul Krill
Editor at Large

Microsoft emphasizes JavaScript tools, libraries in TypeScript 2.0

news
Sep 22, 20162 mins

The latest version of Microsoft's typed JavaScript superset adds simplified declaration file acquisition and non-nullable types

Microsoft is now shipping TypeScript 2.0, an upgrade to the company’s typed superset of JavaScript. It can be downloaded for Visual Studio 2015 Update 3, accessed by NuGet, used with with Visual Studio Code, or installed via NPM.

Version 2.0 focuses on developer productivity, alignment with the ECMAscript standard underlying JavaScript, and support for JavaScript libraries and tools, the TypeScript team said.

Compiling to JavaScript and now serving as the underpinning of Google’s Angular 2 JavaScript framework, TypeScript features the same syntax and semantics familiar to JavaScript developers, but also offers types.  It is part of a roster of JavaScript alternatives, such as CoffeeScript, that are seen as easier for developers.

Key improvements in TypeScript 2.0 include simplified declaration file acquisition, in which declarations for a library are made easier, and non-nullable types, in which null and undefined have their own types for developers to express when null/undefined values are acceptable. “Because this is a breaking change, we’ve added a --strictNullChecks mode to opt into this behavior. However, going forward it will be a general best practice to turn this flag on as it will help catch a wide range of null/undefined errors.”

Control flow analyzed types in version 2.0 can produce the most specific type possible. “When combined with non-nullable types, TypeScript can now do much more complex checks, like definite assignment analysis.” Also, immutable programming has been made easier in version 2.0 by declaring properties read-only.

The first beta version of TypeScript 2.0, which postponed delivery of async support until TypeScript 2.1, was released in July. In future versions, TypeScript’s builders plan to evolve the type system to allow further expression of JavaScript in a statically typed fashion. The TypeScript language service and tooling features will be enhanced so tools can become “smarter,” the team said.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author