TypeScript v3.6 introduces more accurate array spreads & stricter generators

Share
  • August 30, 2019

TypeScript continues to add quality of life improvements for JavaScript developers. Many JS devs turn to TypeScript for modern improvements upon programming in JavaScript. TypeScript builds upon JS by adding optional static types, compiling to plain JavaScript.

A new update arrives, adding stricter generators, more accurate array spreads, improved UX, better Unicode support for identifiers, a few breaking changes, and more. TypeScript 3.6 is out of its beta phase and hit general availability, as of August 28, 2019.

Grab the latest beta via npmVisual Studio, or NuGet.

TypeScript version 3.6 features

Let’s review some of the key changes in this release:

  • Stricter Generators: New, stricter checking for iterators and generator functions. From the Microsoft dev blog: “…what this means is that you’ll be able to appropriately narrow down values from iterators when dealing with them directly.” Check out the pull request to learn more about this change.
  • Array spread emits more accurate code: New __spreadArrays helper added. View the pull request.
  • Refreshed playground: The Playground gets some new toys to play with, with added functionality. New supported options include the  target option, strictness flags, support for plain JavaScript files, and more.
  • Promise improvements: UX improvements for Promise added.
typescript

Quick fixes for Promises. Source.

  • Improved Unicode character support in Identifiers
  • APIs support --build and  --incremental flags: Two sets of APIs operate on project references and incremental program building. See the pull request for more info.
  • Smart semicolon-aware edits: TypeScript detects if your file uses semicolons before writing from TextChanges. Files that do not have any semicolons will not receive any, keeping consistent with user guidelines.
  • Improved auto-imports: Auto-imports are now better at looking at existing imports and deciding how to auto-import modules, making them more likely to be valid.

Fixed issues & breaking changes

As with any new release, version 3.6 comes with some breaking changes, removed/changed declarations, and fixes a few pesky bugs.

SEE ALSO: What do top DevOps performers have in common? Tips for elite performance

View the fixed issues query for v3.62, v3.6.1, and v3.6.0.

Source : JAXenter