The Complete Magazine on Open Source

Microsoft’s TypeScript 2.5 brings new refactorings

837 0

TypeScript 2.5

Microsoft has released TypeScript 2.5 as the new version of its typed superset of JavaScript. The new TypeScript version brings enhancements for try/catch statements for errors and compiler improvements and includes a couple of new refactorings to ease the development process.

TypeScript 2.5 uses a late-stage ECMAScript for catch binding operational in try/cache statements. This help users catch binding completely optional. Further, you can just omit unusedError altogether with the new TypeScript version.

The new version also brings support for imports while using the Node module-resolution strategy. There is a native support to predict identical packages from the top-most package. Also, there are extract method and extract function as the two refactorings to make complex rewrites unimportant.

Another change in TypeScript 2.5 is the preserveSymlinks compiler flag — it is similar to -preserveSymlinks flag in Node.js that instructs module loader to preserve symbolic links while caching modules. Other changes in the new version include some improvements to TypeScript’s watch mode and integration with other tools and a quick fix to help you flawlessly reference the type of property of another type.

Microsoft’s developer team has additionally brought JSDoc type assertion support into JavaScript files. This new support expands the existing ability to provide type-checking that was debuted in the last version of TypeScript.

Developers with Visual Studio 2015 (with Update 3) can install the developer edition of TypeScript 2.5, while the company is offering SDK support for users with Visual Studio 2017. The new version is also in the pipeline for other editors. Meanwhile, you can configure your open sourced Visual Studio Code and Sublime Text.