News

TypeScript 3.6 Now Feature-Complete, Release Candidate Next

Microsoft's open source TypeScript programming language, fresh off cracking the top 10 in a popularity index for the first time, is out in a v3.6 beta that is feature complete, with the release candidate coming next.

Since its debut in 2012, TypeScript's adoption rate has been described as "exploding" and "meteoric" in various indices and articles, driven by its ability to let developers use static typing in JavaScript-based applications.

TypeScript 3.6 is expected to be released near the end of next month, with a release candidate coming soon on the heels of the July 19 beta, described by program manager Daniel Rosenwasser as feature complete.

The TypeScript roadmap includes the following items for TypeScript 3.6:

Here's a summary of Rosenwasser's descriptions of some of the main new features in the TypeScript 3.6 beta:

  • Stricter Generators: "TypeScript 3.6 introduces stricter checking for iterators and generator functions. In earlier versions, users of generators had no way to differentiate whether a value was yielded or returned from a generator."

  • More Accurate Array Spread: This in response to a pull request titled "Add __spreadArrays helper," stating "Adds a __spreadArrays helper for a more accurate spread behavior when not using --downlevelIteration."

    Rosenwasser explained: "In pre-ES2015 targets, the most faithful emit for constructs like for/of loops and array spreads can be a bit heavy. For this reason, TypeScript uses a simpler emit by default that only supports array types, and supports iterating on other types using the --downlevelIteration flag. Under this flag, the emitted code is more accurate, but is much larger.

    "TypeScript 3.6 introduces a new __spreadArrays helper to accurately model what happens in ECMAScript 2015 in older targets outside of --downlevelIteration."

  • Improved UX Around Promises: "Promises are one of the most common ways to work with asynchronous data nowadays. Unfortunately, using a Promise-oriented API can often be confusing for users. TypeScript 3.6 introduces some improvements for when Promises are mis-handled.

    "For example, it's often very common to forget to .then() or await the contents of a Promise before passing it to another function. TypeScript's error messages are now specialized, and inform the user that perhaps they should consider using the await keyword."

  • Semicolon-Aware Code Edits: "Editors like Visual Studio and Visual Studio Code can do automatically apply quick fixes, refactorings, and other transformations like automatically importing values from other modules. These transformations are powered by TypeScript, and older versions of TypeScript unconditionally added semicolons to the end of every statement; unfortunately, this disagreed with many users' style guidelines, and many users were displeased with the editor inserting semicolons.

    "TypeScript is now smart enough to detect whether your file uses semicolons when applying these sorts of edits. If your file generally lacks semicolons, TypeScript won't add one."

In addition to providing code samples and other information for the above, Rosenwasser's post lists several breaking changes affecting DOM updates, constructor naming and the consultation of immediately preceding JSDoc comments to figure out declared types.

The roadmap shows future plans including:

Developers have been clamoring for the poetic presentation of error messages (in haiku or iambic pentameter) for about a year and a half, but Rosenwasser didn't mention that much-discussed PR in his latest post.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube