Today we’re happy to announce the release of TypeScript 1.5. This release took an alpha, a beta, and your help to get here. It’s a big one, so let’s get started!
TypeScript 1.5 is part of the newly released Visual Studio 2015. You can also get a separate download for Visual Studio 2013, npm, and straight from GitHub.
ES6 support
TypeScript 1.5 – closing the gap on Kangax ES6 support
TypeScript 1.5 adds a number of new ES6 features including modules, destructuring, spread, for..of, symbols, computed properties, let/const, and tagged string templates. There is quite a bit of information available in the links above, including samples of how to use these features. With these features, TypeScript takes a big step in completing its goal of becoming a superset of ES6 and offering type-checking for all of ES6’s major features
In the above table, you can see our progress on the Kangax ES6 support table. This table, originally for JS engines, also shows coverage of the features transpilers and polyfills support for ES5 output. With TypeScript 1.5, we doubled the number of passing tests and will continue to improve over the next few releases.
Modules
There has been quite a bit of work on how modules work in the 1.5 release. With this release, we’ve begun supporting the official ES6 modules, we’re simplifying how modules work, and we’re adding support for more kinds of modules as output.
ES6 modules
TypeScript 1.5 supports the new module syntax from ES6. The ES6 module syntax offers a rich way of working with modules. Similar to external modules in TypeScript, ES6 modules can import modules and exports each piece of your public API. Additionally, ES6 modules allow you to selectively import the parts of that public API you want to use.
import * as Math from “my/math”;
import { add, subtract } from “my/math”;
You can also work with the module itself using a ‘default’ export. The default allows you a handle on what the module main content is. This gives you even more precise control over the API you make available.
// math.ts
export function add(x, y) { return x + y }
export function subtract(x, y) { return x – y }
export default function multiply(x, y) { return x * y }
// myFile.ts
import {add, subtract} from “math”;
import times from “math”;
var result = times(add(2, 3), subtract(5, 3));
If you look closely, you can see the ‘export default’ used as the last line of math.ts. This line allows us to control a ‘default’ export, which is what is exported when you don’t import specific exports with curly braces ({ }) but instead use a name, like the second line of myFiles.ts.
Simplifying modules
One of the common points of feedback we’ve heard as new users pick up TypeScript for the first time is that the modules are a bit confusing. 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.
Going forward, internal modules will be called ‘namespace’. We chose to use this term because of the closeness between how this form works and namespaces in other languages, and how the pattern in JS, sometimes called IIFE, is used in practice. We’ve already updated the handbook to reflect this change. We’re encouraging teams to use the new terminology and corresponding syntax.
Likewise, external modules just become ‘modules’, with a strong emphasis on the standard ES6 module syntax. With these changes, there is now just one ‘module’, and it works like the corresponding concept in JavaScript.
New module output
TypeScript has supported multiple module loaders since the early days. Because JavaScript is used in both the browser and on the server, TypeScript has supported compiling modules for either AMD or CommonJS.
We’re adding two 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.
Lightweight, portable projects
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.
TypeScript 1.5 introduces a new feature to make getting started withTypeScript 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. In fact, VS Code, Sublime, Atom, and others already support using tsconfig.json files.
Decorators
The 1.5 release also adds 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’, but it is already showing how powerful it is when working with rich libraries and applications.
import {Component, View, NgFor, bootstrap} from “angular2/angular2”;
import {loadFile} from “audioFile”;
import {displayAudioFile} from “displayAudio”;
@Component({selector: ‘file-list’})
@View({template: `
<select id=”fileSelect” size=”5″>
<option *ng-for=”#item of items; #i = index”
[selected]=”selected === item”(click)=”updateSelection()”>{{ item }}</option>
</select>`,
directives: [NgFor]
})
class MyDisplay {
items: string[];
constructor() {
this.items = [“item1”, “item2”];
}
updateSelection() { … }
}
Using decorators in Angular 2
Decorators allow you to attach metadata to classes and members, as well as update the functionality of what is being decorated. As you can see above, Angular 2 uses Decorators to define the HTML selector and template on a class directly. We’re excited to see what else developers do with this feature.
Note: to use decorators in your projects, you’ll need to pass the –experimentalDecorators flag to the compiler.
What’s next
The 1.5 release has significant new language features to use in your projects. It’s been a fairly long release, and we’re excited to hear your feedback on TypeScript 1.5 as well as jump in and finish TypeScript 1.6.
We’ve also heard your feedback that you’d like smaller releases, more often. We’re currently working on ways to make that happen, so you get great features, high quality, and don’t have to wait long to get it. Stay tuned…
Thanks!
- Ahmad Farid
- Anders Hejlsberg
- Arnav Singh
- Basarat Ali Syed
- Bill Ticehurst
- Bryan Forbes
- Caitlin Potter
- Chris Bubernak
- Colin Snover
- Cyrus Najmabadi
- Dan Quirk
- Daniel Rosenwasser
- Dick van den Brink
- Dirk Bäumer
- Frank Wallis
- Guillaume Salles
- Ivo Gabe de Wolff
- James Whitney
- Jason Freeman
- Jason Ramsay
- Johannes Rieken
- Jonathan Bond-Caron
- Kagami Sascha Rosylight
- Keith Mashinter
- Lorant Pinter
- Masahiro Wakame
- Mohamed Hegazy
- Oleg Mihailik
- Paul van Brenk
- Pedro Maltez
- Ron Buckton
- Ryan Cavanaugh
- Sheetal Nandi
- Shengping Zhong
- Stan Thomas
- Steve Lucco
- Tingan Ho
- Tomas Grubliauskas
- TruongSinh Tran-Nguyen
- Vladimir Matveev
- Yui Tanglertsampan
- Zev Spitz
- Zhengbo Li

This is a great release! Congrats to everyone involved!
Will the new module system aid in creating NPM reusable typescript libraries? That is the biggest sticking point for me open-sourcing my work. Right now all my libraries need to live in one behemoth project due to inability to reuse typescript in NPM modules.
@Jason Sw
Thanks – we're looking into a few ways to improve working with npm and modules. One is the module bundling feature that we're hoping to get into one of the next releases (you can track where it lands on the roadmap: github.com/…/Roadmap)
To answer my own question: Not yet. NPM reusable libraries seems to be slated for 1.6:
github.com/…/3421
github.com/…/2338
Thanks guys, love the new release and can't wait for TS 1.6 !
Great job!
Great news – well done all! Is there any idea when 1.6 might ship?
Thanks for the great work. I'm becoming a big TypeScript fan the more I use this software.
Do you know when the Playground compiler,, Handbook and Language Specification will be updated on the web site to reflect this new release?
Great job guys! Feels like its been a long time coming with this one. It was a hassle to convert our big nested namespaced app to ES6, but it was so worth it in the end.
GREAT work. I can't wait to try out all this new stuff
Great but,
Bring Windows 10 Universal Apps to Android and iOS
vote this:
visualstudio.uservoice.com/…/8912350-bring-windows-10-universal-apps-to-android-and-ios
Create something like what Xamarin is doing in order to help developers to code once and run EVERYWHERE (Wndows 10, windows 10 mobile, android and ios).
If Microsoft could not buy Xamarin, at least do what they are doing by your own. Make something that enable us to archive real NATIVE cross platform development. It could dramatically increase the numbers of developers using .net to create mobile applications as well as increasing the number of apps created to wp too, since app could be compiled to ios, android AND WINDOWS PHONE. Hibrid apps like apache Cordova has a lot of potential but right now it is limited to offer a bad user experience when compared to the native apps you could build native with native objective-c on iOS, java on Android or C# (on Xamarin.Forms o WP and Windows 8). Porting .net to others platforms is good, but go further MS, create something that help us to "code once and run everywhere. And by EVERYWHERE I mean, not just windows, I mean: Native apps on Android, iOS, Windows PC, Windows Mobile, Xbox, HoloLens and to on. Bring us a tool that enable us to make Visual Studio Universal Apps REALLY UNIVERSAL (running as well on android and iOS).
We want a Framework that enable us to build NATIVE.
By the way Xamarin Starter edition has a very limited package size so is almost impossible to create even small apps with an organised architecture (multi layers) and its licences fees is very expensive too.
Hey M$ look to the opportunity a tool like Xamarin could bring to the windows ecosystem. It could help you to resolve the app gap Windows Phone suffers so far. With a tool that can help developers to build native applications to windows as well as to android and iOS could bring the apple and android developers interest to use it and since it will be able to compile to windows phone then they will not have why to do not do so. It will also bring mobile developers form other platforms (android and iOS) to Visual Studio and .NET.
@Eder You used "M$" on a blog for a free and open source project. No cookies for you.
Great release! Very excited to use a lot of these features!
I love you guys!!! I love typescript TEAM!!! I love this blog! You are an example to the community! You inspire us!
Every day spent in this job.. It is like gold for us! Thank you all! =D
Great job, thank you! Can't wait for async/await/yield support.
Any plans to update the Language Specification document?
@mallison244 No, Typescript is not "free" (as in speech). It is a Microsoft product tied to Microsoft tooling. Do you think it coincidence that TS 1.5 happened to release at the same time as VS2015? True OSS products would never do that.
Awesome guys! Love the new module output options! Hope you can do something about the declaration files which doesn't output a proper module formatted declaration. Thanks guys!
@Skeptic You can define "free" a number of ways, but TypeScript is FOSS. What "True OSS products" are is irrelevant.
Kind of funny and ironic how much the last code example looks like the Spring Framework in Java.
@James Roland – if you're seeing some formatting issues with modules, would you mind filing an issue in the issue tracker (if you haven't already): github.com/…/issues
It is really great to see the TS evolving so quickly.
It would be really useful to also see the language spec and the handbook updated.
There is a mention in the blog that the handbook was updated but the updated handbook doesn't appear on the main site and I couldn't find it in the github repo either. The handbook on the main site is quite out of date, doesn't even mention features available in TS 1.4 (like union types)
Also the language spec on the mai site still points to TS 1.4.
You picked up my name for committer list from somewhere else 😀 (its not the name from CLA, MS or GitHub account)
@RaduW – Totally agree. We're working on updates to both. One gotcha is that we have two versions of the handbook: the one on the website and the one on GitHub. We'd like to fix that so we only have one version, the GitHub one, and have the website just pull from that one.
@Tomas – I tried to find full names. If you'd like me to change it, let me know 🙂
I am very happy with this release overall — in particular let/const compiling to ES5!
I do agree with @Skeptic to the degree that a release of TS shouldn't be coupled to a release of VS. For example, compilers and tooling for VS 2013 and other IDEs should have been released when ready instead of artificially being held back until VS 2015 was released. The marketing efforts — talks, blog posts, etc. is one thing, but that shouldn't affect the actual release of an OSS product. Obviously anyone can pull down the code and build on their own, but that doesn't feel like the right solution either.
Food for thought, anyway.
On behalf of the Aurelia Team, I'd like to official congratulate and thank you for this release. Thanks to your work, openness and collaborative spirit you've enabled our community to do some amazing things and helped us to provide tools and technology that many developers have been asking for and needing. Looking forward to the future and what we all can do next!
@Jonathan
If "Thomas Vitkauskas" is added to the list for this commit github.com/…/1908 then check github profile. If not, I need to stop using that as dummy name 😀
@James – we're trying to improve how we do releases, so we can update more often. We're taking the feedback to heart that we need to release more often.
@Rob Eisenberg – thanks! 🙂
@Tomas – sorry about that! It should be fixed now
@Skeptic and @James … a) binding to VS release has nothing to do with the FLOSS nature of the project, b) there are bindings of TypeScript to alternative editing environments (e.g., me as a Linux programmer used to use excellent vim bindings).
Another great release. Awesome linq 4 typescript implementation with Complete lazy evaluation! https://github.com/dibiancoj/
Does it support promise ?
Thanks!!
Microsoft has really turned around, remember the Ballmer "Linux is a cancer" days? Now look at today.
TypeScript is a great tool like it or not, anyone who still bashes Microsoft is living in the past.
async/awaid delayed again, this time to TS 2.0, in reality to VS 2017. Great job, TS 'team'
@Tristan STW
We're doing some refactoring in the compiler to handle compiling async/await down to ES5. Ideally, both the compiler code and the output code would be clean, so we're taking our time to get it right. To get there, we knew it probably won't make it into 1.6, which we want to release sooner rather than later.
The next "bucket" is 2.0, though we may have more releases between 1.6 and 2.0, depending on how mature the features are.
Good news, but please update handbook. It's really outdated in modules section
Tried to use the new 'namespace' feature in Visual Studio 2015 with TS 1.5.4 installed.
namespace test {
// my code here
}
Get error: Build: ";" expected. Does anybody know what's wrong? Tried my code in TS playground, it gets converted to JS correctly. Set to use ECMAScript 5.
The Typescript Handbook still talks about Internal and External modules. No mention of namespaces.
http://www.typescriptlang.org/Handbook
Looks out of date in general.
@Toby McDuf, We are in the process of updating the TypeScript website. Meanwhile the most up-to-date documentation can be found at: github.com/…/TypeScript-Handbook