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

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

  • Naive Bayes Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

  • VS Code Copilot Previews New GPT-4o AI Code Completion Model

    The 4o upgrade includes additional training on more than 275,000 high-quality public repositories in over 30 popular programming languages, said Microsoft-owned GitHub, which created the original "AI pair programmer" years ago.

  • Microsoft's Rust Embrace Continues with Azure SDK Beta

    "Rust's strong type system and ownership model help prevent common programming errors such as null pointer dereferencing and buffer overflows, leading to more secure and stable code."

  • Xcode IDE from Microsoft Archrival Apple Gets Copilot AI

    Just after expanding the reach of its Copilot AI coding assistant to the open-source Eclipse IDE, Microsoft showcased how it's going even further, providing details about a preview version for the Xcode IDE from archrival Apple.

Subscribe on YouTube

Upcoming Training Events