TypeScript has been updated with improvements to the latest release centered on performance, polish, and stability, according to the development team. The compiler and editing experience have been worked on to improve speed.
The developers say they worked on TypeScript’s performance after observing extremely poor editing/compilation speed with packages such as material-ui and styled-components. The changes optimize “certain pathological cases involving large unions, intersections, conditional types, and mapped types.”
Each of these pull requests gains about a 5-10% reduction in compile times on certain codebases. In total, the team says they’ve achieved around a 25% reduction the material-ui-styles project’s compile time.
They’ve also been told by teams at Microsoft that TypeScript 3.9 has reduced their compile time from 26 seconds to around 10 seconds.
In terms of specific features, there are also improvements in Inference and Promise.all. Recent versions of TypeScript have had updates to the declarations of functions like Promise.all and Promise.race, but this has had a side effect of causing problems when used with values with null or undefined.
To counter this, the development team has improved the inference process in TypeScript 3.9. They say that if you’ve been avoiding upgrading your version of TypeScript due to issues around Promises, you should try version 3.9 because it’s a lot better.