days
0
-42
-2
hours
-1
0
minutes
-1
-7
seconds
-1
-7
search
Preview new features

TypeScript 3.9 beta: Reduced compile time and editor improvements

Sarah Schlothauer
typescript
© Shutterstock / Teguh Pramadita

The new beta release for TypeScript mainly focuses on providing stability, bug fixes, and crash-reduction. Thanks to multiple pull requests, TypeScript 3.9 beta reduces its material-ui’s compile time by up to 40%, issues regarding Promises have been fixed, and more.

Daniel Rosenwasser, Program Manager of TypeScript, announced the availability of TypeScript 3.9 beta in a blog post on March 27, 2020. TypeScript is a much-loved superset of JavaScript. It adds syntax for types which can be analyzed through static type-checking before running the code with minimal configuration management, IDE support, all while still providing the benefit of JS libraries.

The new beta release mainly focuses on providing stability, bug fixes, and crash-reduction. It arrives thanks to the feedback and efforts from the community.

SEE ALSO: How can you make a JavaScript website successful in Google?

TypeScript 3.9 beta highlights

Let’s check on some of the new features included in TypeScript 3.9 beta.

  • Inference and Promise.all improvements: Previous issues and errors regarding Promises have been fixed. View the pull request for more information.
  • Improved speed: Thanks to multiple pull requests, TypeScript has reduced its material-ui’s compile time up to 40%. Optimizations include using objects instead of closures for type mappers, faster exit from isTypeRelatedTo, and optimizing deferred type references.
  • Added @ts-expect-error to @ts-ignore directives: Thanks to contributions from Joshua Goldberg, now when a line is prefixed with a // @ts-expect-error comment, it suppresses the error, preventing it from being reported. In cases where there is no error, it will report that // @ts-expect-error is unnecessary.
  • Visual Studio Code improvements: Select different versions of TypeScript in VS Code with the TypeScript: Select TypeScript Version command.
  • JavaScript auto-imports: When using CommonJS modules, TypeScript automatically detects the types of imports you use, keeping all your code clean and neat.
  • Preserving newlines: When printing nodes from TextChanges, TypeScript now works to preserve newlines better than before.

Delaying ‘awaited’ type

Although the ‘awaited type‘ was initially planned for a 3.9 release, it will have to wait a little longer.

In the iteration plan, Daniel Rosenwasser writes:

For those following the issue and the listed features, we noticed that a lot of code was being impacted by awaited and we’ve decided that we need to back out the feature to ensure that we can roll it out more smoothly later on…

So the course of action we’re taking is:

  1. Delay the beta by another day or two.
  2. Back out the changes and run a bunch of tests to ensure nothing else regresses (including another round of validation on the Visual Studio side just to be safe).
  3. Revisit the awaited type for a later version.

Taking the time and perfecting this before release will ensure that it runs smoother, without issue.

SEE ALSO: SQL is most in-demand tech skill, Burning Glass Technologies reports

Testing out beta

Keep an eye on progress towards TypeScript 3.9 and follow the iteration plan on GitHub. For now, the final release is set to schedule on May 12, 2020.

Before you upgrade, take note of all the breaking changes. There are now stricter checks on intersections, newly invalid JSX text characters, and new parsing differences to be aware of.

You can test out the new beta release and get a sneak peek before the final version by updating via NuGet. Alternatively, use the following command:

npm install typescript@beta
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. She is also the editor for Conditio Humana, an online magazine about ethics, AI, and technology.

guest
0 Comments
Inline Feedbacks
View all comments