TypeScript v3.6 introduces more accurate array spreads & stricter generators
The general release for TypeScript version 3.6 is here! This update includes some new features, breaking changes, and a well-needed refresh for the TypeScript playground. Check out the new features, including stricter generators, more accurate array spreads, better Unicode support for identifiers, improved UX for Promises, and more.
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.
TypeScript 3.6 is now out! 🎉
Read up on better generator checking, better UX around Promises, editing improvements, a new TypeScript playground, and more! https://t.co/32PNpbxfoA
— TypeScript (@typescript) August 28, 2019
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
__spreadArrayshelper added. View the pull request.
- Refreshed playground: The Playground gets some new toys to play with, with added functionality. New supported options include the
Promiseimprovements: UX improvements for
- Improved Unicode character support in Identifiers
- APIs support
--incrementalflags: 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.
The following are the breaking changes and removed/changed declarations to take note of:
- String-named methods change: Class declarations with methods named
constructornow will be constructor functions, as per ECMAScript specifications.
- DOM removals: Removed declarations within
lib.dom.d.ts. : Users must now use WindowOrWorkerGlobalScope instead of GlobalFetch. Non-standard properties on
experimental-webglcontext removed; use
- No more merging JSDoc comments
- Keywords no longer allowed to contain escape sequences
Looking towards the future
What’s next? Refer to the roadmap overview on GitHub and catch a preview of upcoming features and high-level goals. As of right now, the team is focusing on the following 5 goals for future releases:
- Types on every desk, in every home, for every JS developer
- Productivity through strong tooling
- Approachability and UX
- Community engagement
- Infrastructure and engineering systems
Support for editors beyond Visual Studio Code will also arrive in future updates, according to the Microsoft dev blog.