TypeScript 2.4 Now GA
- By Michael Domingo
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.
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.