Serdar Yegulalp
Senior Writer

TypeScript 2.0 beta kicks async support down the road

news analysis
Jul 13, 20162 mins

There's still a lot to like in the newest version of Microsoft's JavaScript-derived language, like non-nullable variable types

The first beta of TypeScript 2.0, the latest version of Microsoft’s “industrial-strength JavaScript,” was announced earlier this week.

The bad news: It doesn’t deliver everything promised for 2.0. It does, however, provide a slew of new features for type-checking — long regarded as the biggest benefit TypeScript provides for JavaScript programmers.

One of the big additions promised for 2.0 —  non-nullable types — is being delivered. Pass a flag to TypeScript and it will ensure that, for instance, strings or numbers never end up being assigned to null or undefined. In cases where you want something to be given those values, null and undefined are now available as types.

In cases where you want to override the type system’s protections, Microsoft allows a way to conditionally override it. Add “!" as a postfix to any variable (such as user_name!), and TypeScript will assume the variable in question doesn’t need to be guarded against null/undefined checks.

Not all of 2.0’s additions revolve around types; some deal with the workflow around a script. Module declarations, for example, are easier to write this time around. A developer in a hurry can start with a stub declaration that has no actual code in it or even declare a whole package of modules in this fashion.

What’s missing from 2.0 — for now — is support for async/await. These keywords were introduced in ECMAScript 2016 to make asynchronous programming easier, in the same manner as similar keywords for C#, Dart, and Python. One boon is that TypeScript code written with async/await can be compiled down to versions of JavaScript (EC5, for instance) that don’t support those keywords.

Microsoft’s beta notes indicate that the main reason for the delay in support was to make sure TypeScript could generate the needed async/await code quickly enough, and to thoroughly test the resulting behaviors. “While we feel confident in today’s implementation, confidence is no match for thorough testing,” Microsoft wrote.

As a result, async/await support has been bumped to the 2.1 release.

Serdar Yegulalp

Serdar Yegulalp is a senior writer at InfoWorld. A veteran technology journalist, Serdar has been writing about computers, operating systems, databases, programming, and other information technology topics for 30 years. Before joining InfoWorld in 2013, Serdar wrote for Windows Magazine, InformationWeek, Byte, and a slew of other publications. At InfoWorld, Serdar has covered software development, devops, containerization, machine learning, and artificial intelligence, winning several B2B journalism awards including a 2024 Neal Award and a 2025 Azbee Award for best instructional content and best how-to article, respectively. He currently focuses on software development tools and technologies and major programming languages including Python, Rust, Go, Zig, and Wasm. Tune into his weekly Dev with Serdar videos for programming tips and techniques and close looks at programming libraries and tools.

More from this author