Yesterday (at night in Moscow) the long-awaited release of TypeScript 0.9 was released.
For those who do not know what it is: TypeScript is a programming language for developing JavaScript applications. TypeScript is a typed JavaScript language extension that compiles to JavaScript. Any browser. Any host. Any OS. Open Source. (c) www.typescriptlang.org
Under the cut key innovations. I invite to discussion! ')
I deliberately do only a brief squeeze, for examples and a more detailed description I suggest you go to the official blog .
Key innovations are:
Generics is perhaps the most awaited feature. It had so many requests that even had to move it from 1.0 to version 0.9. Working with arrays is now a pleasure. And not only with them.
Constant overloading - now you can overload the method by the value of the argument. This is often used in JavaScript, for example with the core library. createElement (tagName: 'canvas') and createElement (tagName: 'div') are now different methods. I can imagine how this can still help simplify the work with jQuery-plugins.
Export in AMD & CommonJS - for those who are familiar with the previous 2 terms, you could not write export = MyClass before, but now you can. Progress!
Enums - slightly changed the syntax for enums.
Declaration merging is a complex term. In general, now it is easy to add a couple of static properties to a function and do not break anything. For a better look, see the sample code in the original blog.
The compiler - they say, the compiler has been greatly rewritten and it has now become faster at times. But only under Windows and as a plug-in for Visual Studio. The console version of the compiler has become, on the contrary, slower. They promise to change the situation in 0.9.1, i.e. soon.
A barrel of tar - of course, when you switch to the new version, a lot of things will break. There are enough incompatible changes in the release. How to deal with them - carefully described in a separate article . Well, since TypeScript is a compiled language and IDE gives you the possibility of static analysis - there should not be any special problems during the transition.