TypeScript 2.5 Adds Optional Catch Binding
TypeScript 2.5 Adds Optional Catch Binding
Written by Kay Ewbank   
Monday, 21 August 2017

 The release candidate of TypeScript 2.5 is available, though just for Visual Studio and Sublime Text at the moment. Support for other editors will be added soon.


typescriptlogo

While work will continue on TypeScript 2.5, other changes such as a watch mode, and integration with other tools that have file-watching functionality, will be kept for TypeScript 2.6.

TypeScript was developed by Microsoft ,and is a superset of JavaScript that builds on the ECMAScript standard and includes support for static types. Your TypeScript code then gets transformed into clean, runnable JavaScript.

The improvements to the release candidate start with support for optional catch binding parameters. According to the TypeScript developers, this is for use on those occasions where you expect something might fail by throwing an error, but you don't particularly care what that error is. TypeScript 2.5 introduces a late-stage ECMAScript feature to make the catch binding optional in try/catch statements

The second main improvement is better handling of deduplicated and redirected packages. If you import files using the Node module resolution strategy, the compiler will now check whether they come from “identical” packages. If you import a file from a package with a package.json containing the same name and version fields as one that TypeScript has already encountered, it will redirect itself to the top-most package. This helps avoid problems where two packages contain identical declarations of classes, but which contain private members that cause them to be structurally incompatible. It also reduces the memory and runtime footprint of the compiler and language service.

The final main change to this version is the addition of the preserveSymlinks flag. This behaves similarly to the --preserve-symlinks flag in Node.js. The new flag also behaves in the opposite way to Webpack’s resolve.symlinks option (i.e. setting TypeScript’s preserveSymlinks to true parallels setting Webpack’s resolve.symlinks to false, and vice-versa).

According to the TypeScript developers:

"in this mode, references to modules and packages (e.g. imports and /// <reference type="..." /> directives) are all resolved relative to the location of the symbolic link file, rather than relative to the path that the symbolic link resolves to."

The release candidate is available through NuGet. 


typescriptlogo

 

More Information

TypeScript on NuGet

TypeScript On GitHub

TypeScript 2.5 RC for Visual Studio
 

Related Articles

TypeScript 2.4 Adds Dynamic Import Expressions  

TypeScript 2.3 Released

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, FacebookGoogle+ or Linkedin.

 

Banner


Does Strong Typing Help?
18/10/2017

We all have our opinions on static strong typing versus dynamic or even no real typing at all, but hard evidence of what works is thin on the ground. Now some new research gives us some facts to throw [ ... ]



React 16 Adds Fragments
05/10/2017

There's a new version of React with improvements including fragments, error boundaries, portals, and support for custom DOM attributes. 


More News

 

 
 

 

blog comments powered by Disqus

Last Updated ( Monday, 21 August 2017 )
 
 

   
Banner
Banner
RSS feed of news items only
I Programmer News
Copyright © 2017 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.