Announcing 0.9.1

Announcing 0.9.1

Rate This
  • Comments 50

We’re happy to announce the release of TypeScript 0.9.1.  With this version we've focused on fit and finish, improving the compiler performance and rounding out the language and ASP.NET support.

Improved Performance

When we released 0.9.0, we introduced a re-written compiler and language service which scaled better for interactive use cases and supported many new 0.9 language features, including generics.  One side-effect of this re-write was that command line compiler performance was noticeably slower than in 0.8.3.  With 0.9.1, the compiler is now as fast or faster than 0.8.3 for almost all codebases.  With 0.9.1, we close many of the performance gaps introduced by 0.9.0, improving both interactive and compiler performance.  Windows 8 and 8.1 users of the Visual Studio plugin will also notice further performance improvements, as we've begun using the latest version of Chakra, the JavaScript engine, on those platforms.

New Language Features

Typing with 'typeof'

We’ve added support for the ‘typeof’ operator in type positions.  This allows you a way of referring to the type of an expression. This is especially handy for working with the shapes of modules, the static side of a class, and enums, which don’t otherwise have a name you can refer to.

module M {
    export function myFun(x: number) {
        return x;
    }
}

var m: typeof M = M;

Better 'this' handling

We've relaxed the restrictions on field initializers to now allow 'this'.  This means that classes can now contain both methods on the prototype, and callback functions on the instance.  The latter are particularly useful when you want to use a member on the class as a callback function, as in the code above. This lets you mix-n-match between ‘closure’ style and ‘prototype’ style class member patterns easily.

class Adder {
    constructor(public x: number, public y: number) { }

    addMembers = (evt: MouseEvent) => console.log(this.x + this.y);
}

var adder = new Adder(3, 4);

document.onclick = adder.addMembers;

No Implicit Any

In the TypeScript 0.8 releases, there was an experimental option to warn anytime the compiler implicitly inferred the type ‘any’ where it had not been explicitly stated by the developer.  Several teams discovered this and began to use it to ensure they were taking full advantage of the TypeScript type checker, and not having ‘any’ creep in accidentally.  With 0.9.1, we are adding full support to this option, which is now available through the ‘--noImplicitAny’ compiler flag.  For Visual Studio users, we now also support the <TypeScriptNoImplicitAny> project build option. 

var x;             // Error: Variable 'x' implicitly has an 'any' type

x = "foo";
x = 2;

function f(y) {    // Error: Parameter 'y' of f implicitly as an 'any' type
    return y + 1;
}

 Visual Studio support for ASP.NET projects

 

With 0.9.1 on Visual Studio, we have introduced better support for using TypeScript within ASP.NET applications.  Keep an eye on the blog for an in-depth look at the features that are now available.

Download

Get them while they're hot.  The updated downloads are available for Visual Studio, NPM and source through the TypeScript website.  Let us know what you think on the discussion forums and issue tracker.

Note to users of previous versions of TypeScript - there is a list of breaking changes with older versions listed here

Leave a Comment
  • Please add 7 and 8 and type the answer here:
  • Post
  • Great! Can't wait to try out the performance improvements!

  • Cool! Performance improvements and ability to declare lambdas for the class members are huge step ahead for us. Thanks!

  • This version creates a tsc.exe process that never dies, the CPU sits idle after compilation, but the memory is never released. I have even tried restarting Windows. Not sure if it's Web Essentials that's making it hang or TypeScript itself. I've seen this before, but a restart always seemed to fix the problem.

  • @Kevin - there was a recent update to WebEssentials in the last couple days so that it would be compatible with 0.9.1.  If you've updated to the most recent and it's still an issue, you can try contacting the WebEssentials maintainer to see if there's an additional fix needed there.

  • The performance improvements are awesome!

  • Where is the "--nolib" option ?

  • @Olivier It was renamed to --noLib when we did a pass to clean up the commandline options.  

  • Why not support typeof of generic type?

       class View<TModel extends Model> extends Events {

       //...

           model: typeof TModel; // Error: Could not find symbol 'TModel'.

    See related work items here:

    typescript.codeplex.com/.../699

    github.com/.../821

  • @Omid - A close variant to that is indeed possible, details on the threads you linked to on DefinitelyTyped and CodePlex.

  • Someone please fix the https version. half of the links are http, so won't be loaded from chrome or IE 11.

    check this out:

    blogs.msdn.com/.../announcing-0-9-1.aspx

  • This version has crashed Visual Studio (2012.3) three times for me, never completing the compilation. Tsc.exe using 3.3 gb memory right before crash. Are there any logs I can send to help you guys?

  • @Csaba - Fixed the links at the bottom to not use https.  Good catch!

  • @Markus - we're tracking down a similar issue now.  If you can, please file a bug through the issue tracker with the steps that caused the problem for you so we can be sure it's covered.  

  • 0.9 perf was a degradation, glad to see you've brought things back up to speed.

  • Please get typescript into the next javascript EMCA standard.  

Page 1 of 4 (50 items) 1234