TypeScript 3.6 beta: Update adds stricter generators & breaking changes
Another update for TypeScript arrives. As the TypeScript team prepares for the full release of v3.6, users can now download the fully-featured beta release and see what the new additions include. This update includes several breaking changes, improved Promises API, stricter generators, and more accurate array spreads.
On July 19, 2019 Microsoft announced the availability of TypeScript 3.6 beta. The beta release is a feature-complete version of v3.6. Its release candidate and full release are set to arrive in the next coming weeks.
v3.6 beta features
Preview all the upcoming additions in the stable release with the beta. Features and language changes in TypeScript 3.6 include:
- Stricter Generators: New stricter checking for iterators and generator functions. This allows users to better narrow down values from iterators. Refer to the pull request to learn more about this addition.
- Array spread emits more accurate code: New
__spreadArrayshelper added for more accurate behavior. See this pull request for more details on the fixed behavior.
- Semicolon detections: As per this pull request, TypeScript can now detect if your file uses semicolons before writing from TextChanges. Files without semicolons will not receive any semicolons, in order to stay consistent with user guidelines.
PromiseAPI improvements: When working with the Promises API, error messages now suggest the
awaitkeyword to users, providing more clarification and context of what to do next. Quick fixes for certain issues also now provided.
- String-named methods breaking change: Class declarations with methods named
constructorare now constructor functions, 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
- Fixed issues: View the full list of fixed issues on GitHub and see all the resolved issues and squashed bugs.
TypeScript 3.6 Beta is out now, and we’re looking for lots of feedback on improvements to iterators & generators, our UX around Promises, as well as editor features! Try it today! https://t.co/2lHCzXEloS
— TypeScript (@typescript) July 19, 2019
As per the release announcement from Microsoft, the next few weeks will include more bug fixes, performance improvements, and stability upgrades as this version leaves its beta phase.
Newcomers to the language can test it out in the in-browser playground and play around with some examples. Be sure to also review the 5-minute intro guide for building web apps.
You can grab the latest beta via npm, Visual Studio, or NuGet. The TypeScript team anticipates the release of v3.6 to arrive at the end of August. Beta users should report any issues, errors, or suggestions they encounter in order to ensure a stable future release.