Background

Microsoft Releases Version 3.0 Of Its JavaScript Plugin TypeScript

TypeScript is an open-source programming language from Microsoft, created as an extension of JavaScript.

On July 30th, Microsoft marks a milestone by announcing TypeScript 3.0. The version brings static types, type declarations and type annotations to JavaScript users.

According to TypeScript's program manager, Daniel Rosenwasser, the project references were one of the biggest improvements of the release, making it easier for developers to share dependencies between multiple TypeScript projects.

"Specifying these dependencies makes it easier to split your code into smaller projects, since it gives TypeScript (and tools around it) a way to understand build ordering and output structure. That means things like faster builds that work incrementally, and support for transparently navigating, editing, and refactoring across projects. Since 3.0 lays the foundation and exposes the APIs, any build tool should be able to provide this."

Notable updates that come with TypeScript 3.0, is the --build flag, which allows developers to build projects and dependencies without requiring external compilers or tools and control the structure of the output.

This avoids duplicate dependencies during the build process when using project reference, explained Rosenwasser.

The update also brings along richer tuple types and the unknown type, which behaves similarly to the preexisting any type, but will show up warnings in the IDE when referenced incorrectly.

The editor's UX elements have also been improved for error and warning reporting, such as for "related error spans" which "can provide messages on other locations so that users can reason about cause-and-effect of an error," continued Rosenwasser.

"In some sense, related error messages can give a user not just an explanation, but also breadcrumbs to see where things went wrong."

It was around TypeScript 2.9 that Microsoft started investing more in TypeScript error messages. "And with 3.0 we really tried to tackle a core set of cases that could give a smarter, cleaner, and more accurate error experience. This includes things like picking better types with mismatches in union types, and cutting right to the chase for certain error messages."

TypeScript

The TypeScript programming language originated from the shortcomings of JavaScript for the development of large-scale applications, both at Microsoft and among the company's external customers. To meet the challenges of dealing with complex JavaScript code, Microsoft created custom tooling to ease the development.

Microsoft first made TypeScript public in October 2012 (version 0.8). That was after two years residing at Microsoft's internal development.

Initially, it received mixed reviews, mainly due to the lack of mature IDE support apart from Microsoft Visual Studio, which was not available on Linux and OS X at that time.

It was on version 0.9 in 2013 that TypeScript added more support for generics.

TypeScript 1.0 was released at Microsoft's Build developer conference in 2014. Also on that year, TypeScript was made available on GitHub. On 22 September 2016, TypeScript 2.0 was released, with Microsoft introducing several features into it, including the ability for programmers to optionally prevent variables from being assigned null values.

With TypeScript 3.0, Microsoft owes so much of TypeScript's success to its community.

"We’re indebted to our contributors who’ve worked on the compiler, the language service, DefinitelyTyped, and tooling integration that leveraged any combination of them. But we’re also grateful for our users who’ve consistently given us the feedback we needed and pushed us to improve," closed Rosenwasser.

Published: 
31/07/2018