TypeScript 3.9 beta: Reduced compile time and editor improvements
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.
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.
Announcing 3.9 Beta! We’ve been focusing on polish, performance, stability, and correctness in this release and want your feedback! Check out our release notes and give it a shot!https://t.co/qAmDX4Bi3E
— TypeScript (@typescript) March 27, 2020
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.
- 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
awaitedand 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:
- Delay the beta by another day or two.
- 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).
- Revisit the
awaitedtype for a later version.
Taking the time and perfecting this before release will ensure that it runs smoother, without issue.
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 [email protected]