days
0
-10
-2
hours
-1
-4
minutes
-3
-9
seconds
-2
0
search
Preview the beta

TypeScript 3.6 beta: Update adds stricter generators & breaking changes

Sarah Schlothauer
typescript
© Shutterstock / welcomia

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.

According to the most recent quarterly report from the ThoughtWorks Technology Radar, TypeScript continues to move up the ranks. It rose up into their “adopt” sector, gaining popularity and maturity as the technology grows. Furthermore, for many developers, it stands as an alternative to JavaScript that adds new features and improves upon JS. This superset of JavaScript compiles to clean JS output.

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 __spreadArrays helper 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 await keyword 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 constructor are 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 Navigator removed. experimental-webgl context removed; use  webgl or webgl2.
  • Fixed issues: View the full list of fixed issues on GitHub and see all the resolved issues and squashed bugs.

SEE ALSO: JavaScript reigns supreme while TypeScript and Julia surprise with their growth in new RedMonk report

Update TypeScript

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.

SEE ALSO: Small embeddable JavaScript engine with QuickJS

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.

Author
Sarah Schlothauer

Sarah Schlothauer

All Posts by Sarah Schlothauer

Sarah Schlothauer is an assistant editor for JAXenter.com. She received her Bachelor's degree from Monmouth University and is currently enrolled at Goethe University in Frankfurt, Germany where she is working on her Masters. She lives in Frankfurt with her husband and cat.

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of