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

  • Uno Platform Wants Microsoft to Improve .NET WebAssembly in Two Ways

    Uno Platform, a third-party dev tooling specialist that caters to .NET developers, published a report on the state of WebAssembly, addressing some shortcomings in the .NET implementation it would like to see Microsoft address.

  • Random Neighborhoods Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the random neighborhoods regression technique, where the goal is to predict a single numeric value. Compared to other ML regression techniques, advantages are that it can handle both large and small datasets, and the results are highly interpretable.

  • As Some Orgs Restrict DeepSeek AI Usage, Microsoft Offers Models and Dev Guidance

    While some organizations are restricting employee usage of the new open source DeepSeek AI from a Chinese company due to data collection concerns, Microsoft has taken a different approach.

  • Useful New-ish Features in .NET/C#

    We often hear about the big new features in .NET or C#, but what about all of those lesser known, but useful new features? How exactly do you use constructs like collection indices and ranges, date features, and pattern matching?

  • TypeScript 5.8 Beta Speeds Program Loads, Updates

    "TypeScript 5.8 introduces a number of optimizations that can both improve the time to build up a program, and also to update a program based on a file change in either --watch mode or editor scenarios."

Subscribe on YouTube