TypeScript 2.9 Adds Notable Editor Features

TypeScript 2.9 has shipped with several new editor features added along with some language/compiler features.

The open source programming language is primarily developed and maintained by Microsoft, providing a strict syntactical superset of JavaScript with the addition of optional static typing.

While TypeScript 2.8, which shipped in March, was known for its addition of support for conditional types, v2.9 adds some interesting editor features. The language figures prominently in many editors including Visual Studio, Sublime Text, Eclipse and especially Visual Studio Code, which just came out in a May update -- version 1.24 -- that supports TypeScript 2.9.

New editor features added to v2.9 include:

  • Rename file and move declaration to new file: This was implemented in response to "much community demand," Daniel Rosenwasser, Microsoft's program manager for TypeScript, said in a blog post last week. The new feature enables moving declarations to their own new files along with the ability to rename files while at the same time updating import paths. Rosenwasser said the functionality might not be implemented in all editors immediately but should soon be propagated broadly.
  • Unused span reporting: With this feature, declared but unused spans that typically generate errors can now be manifested as "unused" suggestion spans. For example, VS Code displays them as grayed-out test. Other editors may handle them differently.
  • Convert property to getter/setter: This editor feature comes courtesy of community developer Wenlu Wang, providing support to easily convert properties to get- and set- accessors.

While Rosenwasser said that while new editor features are often more applicable to users, v2.9 also includes many notable core language/compiler features -- some causing breaking changes that developers have complained about -- including:

Going forward, Rosenwasser said TypeScript 3.0 will feature "an experience around project-to-project references, a new unknown type, a stricter any type, and more." These and other planned features can be seen in the TypeScript Roadmap. Meanwhile, features requested and implemented -- or not -- can be seen on this GitHub issues site. There, the most-commented issue is a 2014 post calling for the language to "Support some non-structural (nominal) type matching."

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus


  • Move Over, Stack Overflow: Microsoft Launches Q&A for .NET

    Stack Overflow probably isn't worried, but Microsoft has launched its own Q&A site for all things .NET, seeking to provide a one-stop-shop for getting .NET technical questions answered by the community.

  • Developer Decries WinForms-to-Blazor Performance Degradation

    Since shipping .NET 5, Visual Studio 2019 v16.8 and more goodies recently, Microsoft has been touting speed improvements in many components -- including the red-hot Blazor project -- but some real-world developers are finding different results.

  • Google Cloud Functions Supports .NET Core 3.1 (but not .NET 5)

    Google Cloud Functions -- often used for serverless, event-driven projects -- now supports .NET, but the new support is a release behind Microsoft's latest .NET offering.

  • Binary Classification Using PyTorch: Model Accuracy

    In the final article of a four-part series on binary classification using PyTorch, Dr. James McCaffrey of Microsoft Research shows how to evaluate the accuracy of a trained model, save a model to file, and use a model to make predictions.

  • Visual Basic in .NET 5: Ready for WinForms Apps

    With the milestone .NET 5 and Visual Studio 2019 v16.8 releases now out, Microsoft is reminding Visual Basic coders that their favorite programming language enjoys full support and the troublesome Windows Forms Designer is even complete -- almost.

Upcoming Events