News

TypeScript 2.1 Is Done, But There's More

Following the RC release of 2.1 nearly a month ago, the final version adds a few more tweaks to smooth the coding experience.

Following the TypeScript 2.1 release candidate that hit the Web nearly a month ago, the finalized version adds a few more tweaks to smooth the coding experience.

"This release comes with features that we think will drastically reduce the friction of starting new projects, make the type-checker much more powerful, and give you the tools to write much more expressive code," writes Microsoft Program Manager Daniel Rosenwasser, in a blog post. His post covers lots of ground: async functions, support for object rest & spread, lookup types, mapped types, more utility types, and easier package imports.

Async functions were a part of the 2.1 RC, but in this release it's been tested and stable when targeting ES3/ES5.

Rosenwasser notes that object rest & spread are part of the ES2017 proposal "that makes it much easier to partially copy, merge, and pick apart objects." Object spreads use the spread operator to streamline copying of properties from object to object, while object rests can be extracted into distinct variables.

TypeScript 2.1 also has support for lookup types and mapped types. "Mapped types are produced by taking a union of literal types, and computing a set of properties for a new object type," he writes. He also notes that with the addtion of mapped types, partial type operators aren't absolutely necessary. Even so, support for partial is incorporated into 2.1, as are several others: readonly, record and pick. Rosenwasser points to a Github lib.d.ts file that provides usage examples.

To reduce editing friction, version 2.1 automatically makes assumptions about packages that are installed, bypassing the need to declare them. "We decided that TypeScript needs to be more trusting, and in TypeScript 2.1, so long as you have a package installed, you can use it," he said. Rosenwasser does caution that because of its more trusting nature, there's the assumption that installed package "has the type any, meaning you can do anything with it."

Rosenwasser's blog at the end also links to additional features, including support for custom elements and importing helper functions.

On a related note: Be sure to read Visual Studio Magazine columnist Peter Vogel's recent TypeScript 2.0 coverage on data typing and class discriminants.

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.

comments powered by Disqus

Featured

  • Using Local AI to Cut Copilot Usage-Based Billing Shock

    After being gobsmacked by the new billing plan using almost all my monthly credits in one or two days, I tried pushing some Copilot-style coding work onto local models in VS Code. What I found was less "free AI" and more "pick your pain": cloud charges on one side, heavy local resource use and long waits on the other.

  • .NET 11 Preview 5 Focuses on Performance, Productivity and Safer Code

    .NET 11 Preview 5 focuses on under-the-hood runtime performance gains, streamlined APIs and language features that reduce boilerplate, plus built‑in security checks and incremental ASP.NET Core and EF Core improvements aimed at everyday developer productivity.

  • VS Code 1.124 Focuses on Agent Autonomy and Parallel Sessions

    Microsoft's June 2026 VS Code update turns on Autopilot by default and adds background sending for agent sessions.

  • Developing Agentic Systems in .NET: From Concept to Code

    ZioNet founder Alon Fliess previews his Visual Studio Live! San Diego session on building true agentic systems in .NET -- covering the cognitive loop, MCP tool integration, multi-agent orchestration and enterprise hosting and governance with the Microsoft Agent Framework.

Subscribe on YouTube