TypeScript 2.0 Final Version Not To Be Missed
- By Michael Domingo
It's been a few weeks since Microsoft released its latest version of TypeScript. Near the end of September in fact, the team responsible for its development posted information on the version 2.0 final release, which come with tagged unions, glob support and new types with which to play around.
New types in this version include null- and undefined-aware types, which, prior to this version, couldn't be explicitly named. "In TypeScript 2.0, null and undefined have their own types which allows developers to explicitly express when null/undefined values are acceptable," writes Rosenwasser. "Now, when something can be either a number or null, you can describe it with the union type number | null (which reads as "number or null")." It's a breaking change, so there's also a --strictNullChecks mode in case developers need to exclude this capability.
And finally, there's glob support, a feature that was introduced into testing with version 1.6. Rosenwasser notes that "Globs allow us to write out wildcards for paths, making them as granular as you need without being tedious to write." Globs could be used with the *, ?, and **/ wildcards.
To use TypeScript 2.0, developers will need to have Visual Studio 2015 Update 3; it's also available for developers using the latest version of the Visual Studio Code editor.
About the Author
Michael Domingo is a long-time software publishing veteran, having started up and managed several developer publications for the Clipper compiler, Microsoft Access, and Visual Basic. He's also managed IT pubs for 1105 Media, including Microsoft Certified Professional Magazine and Virtualization Review before landing his current gig as Visual Studio Magazine Editor in Chief. Besides his publishing life, he's a professional photographer, whose work can be found by Googling domingophoto.