TypeScript 1.5 Released |
Written by Kay Ewbank | |||
Friday, 24 July 2015 | |||
TypeScript 1.5 has been released and the developers say it’s a big one. The new version is part of the newly released Visual Studio 2015, and it adds better support for ES6 features including modules, destructuring, spread, for..of, symbols, computed properties, let/const, and tagged string templates. ES6, ECMAScript 6, is the next version of JavaScript, and its new features are designed to make coding easier and better for maintenance. The goal is that TypeScript will become a superset of ES6, offering type-checking for all ES6’s major features.
TypeScript 1.5 supports the new module syntax from ES6. This is similar to external modules in TypeScript, and you can import modules and export each piece of your public API. You can also selectively import the parts of that public API you want to use. Modules have also been simplified. Writing about the new version on the Developer Tools blog, Microsoft’s Jonathan Turner says that one of the common points of feedback from users working with TypeScript for the first time is that the modules are a bit confusing, saying: “Before ES6, there were internal and external modules. Now with support for ES6 modules, there is now another module to learn about. We’re simplifying this with the 1.5 release.” Internal modules are now to be called ‘namespace’. The thinking is that internal modules are similar in the way they work to namespaces in other languages. External modules just become ‘modules’, with a strong emphasis on the standard ES6 module syntax. The new version also has new module output formats to help continue support more JavaScript practices: SystemJS and UMD. SystemJS will allow you to use ES6 modules closer to their native semantics without requiring an ES6-compatible browser engine. UMD gives you a way to output a single module that works in both AMD and CommonJS. The blog post about the new version admits: “one of the tricky things with TypeScript projects is that it’s not often easy to move from a single file to working with a growing project of files. You generally have two options: adding ///<reference> statements to tie your project together, or manually handling everything on the commandline. Neither approach is particularly clean, and easily become a mess as the project grows. Additionally, only the ///<reference> approach works well with editors, so you inevitably have a number of them in addition to your build.” In recognition of this, TypeScript 1.5 introduces a new feature intended to make getting started with TypeScript easier. The compiler now supports ‘tsconfig.json’, a new file which allows you to specify the files in your project and the compiler settings to use. This lets you create a lightweight project that can be used both on the command-line and within the editor. VS Code, Sublime, Atom, and others already support using tsconfig.json files. Another improvement in the 1.5 release is support for the proposed Decorator feature of ES7, which is currently being developed in collaboration with the Angular, Ember, and Aurelia teams. Since Decorators are being defined in ES7, which hasn’t stabilized yet, the feature is considered experimental. Decorators allow you to attach metadata to classes and members, as well as update the functionality of what is being decorated. In addition to being included in Visual Studio 2015, TypeScript 1.5 can be downloaded from Github. More InformationRelated ArticlesTypeScript Goes Light, Moves To GitHub TypeScript Fully Accepted into Visual Studio
To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin, or sign up for our weekly newsletter.
Comments
or email your comment to: comments@i-programmer.info |
|||
Last Updated ( Friday, 24 July 2015 ) |