News

TypeScript 2.4 Now GA

Dynamic import expressions, enhanced string enums, and improved generics checking are just a few of the features of this point release of the JavaScript superset.

TypeScript 2.4 has emerged from a very short release candidate cycle and this point release sports a bevy of enhancements and capabilities, including dynamic import expressions, enhanced string enums, and improved generics checking, to name a few.

TypeScript is a JavaScript language superset that currently is available to run with Visual Studio 2015 Update 3 and Visual Studio 2017 Update 2. "Built-in support for 2.4 should be coming to other editors very soon, but you can configure Visual Studio Code and our Sublime Text plugin to pick up any other version you need," notes Microsoft's Daniel Rosenwasser, in a blog post.

Among the additions to TypeScript 2.4 is support for dynamic import expressions. These expressions, notes Rosenwasser in his blog, are a new feature of coming to ECMAscript 2018. Such expressions allow developers to asynchronously request a module any time during the program's execution. "These modules come back as Promises of the module itself, and can be await-ed in an async function, or can be given a callback with .then," he writes.

Among the enhancements:

  • String enums: Enum members can now contain string initializers.
  • Generic function checking: Version 2.4 improves upon "how types are inferred when generics come into play, as well as improved checking when relating two generic function types," and can now return types as inference targets, as well as offers stricter checking for generics.
  • Callback parameters: TypeScript 2.4 now enforces "the correct directionality on callback parameter type checks" when comparing two function types.
  • Weak types: 2.4 introduces weak types, which are "any type that contains nothing but all-optional properties."

Rosenwasser's blog provides some detailed information on each of these enhancements, and he has additional information for these features in a blog, here, on the release candidate that was made available earlier this month.

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

  • Full Stack Hands-On Development with .NET

    In the fast-paced realm of modern software development, proficiency across a full stack of technologies is not just beneficial, it's essential. Microsoft has an entire stack of open source development components in its .NET platform (formerly known as .NET Core) that can be used to build an end-to-end set of applications.

  • .NET-Centric Uno Platform Debuts 'Single Project' for 9 Targets

    "We've reduced the complexity of project files and eliminated the need for explicit NuGet package references, separate project libraries, or 'shared' projects."

  • Creating Reactive Applications in .NET

    In modern applications, data is being retrieved in asynchronous, real-time streams, as traditional pull requests where the clients asks for data from the server are becoming a thing of the past.

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

Subscribe on YouTube