TypeScript 3.9 Improves Performance |
Written by Kay Ewbank | |||
Tuesday, 02 June 2020 | |||
TypeScript has been updated with improvements to the latest release centred on performance, polish, and stability, according to the development team. The compiler and editing experience have been worked on to improve speed. TypeScript is a superset of JavaScript that adds optional static types which can be checked by the TypeScript compiler to catch common errors in your programs. 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. The editor has also received attention, with better handling of CommonJS Auto-Imports in JavaScript. Until now, the assumption was that regardless of your file, you wanted an ECMAScript-style import. TypeScript now automatically detects the types of imports you’re using to keep your file’s style clean and consistent. 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. However, the new awaited type operator the aims to accurately model the way that Promise unwrapping works in JavaScript has not made this build, because testing revealed it wasn't ready. More InformationRelated ArticlesTypeScript 3.6 Generators Get Stricter TypeScript 3.5 Adds Smart Select TypeScript 3.2 Gets Stricter Checking TypeScript 3.1 Adds Mappable Tuples TypeScript 3.0 Adds Project References TypeScript Adds Unused Span Reporting TypeScript Adds Conditional Types TypeScript 2.7 Improves Type Inference TypeScript 2.5 Adds Optional Catch Binding TypeScript 2.4 Adds Dynamic Import Expressions TypeScript 2.2 Adds More Code Actions
To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
Comments
or email your comment to: comments@i-programmer.info |
|||
Last Updated ( Tuesday, 02 June 2020 ) |