Microsoft has released TypeScript 1.6.3 and is available for download from Microsoft Download Center. This release adds support for React/JSX, class expressions, and a rich set of new capabilities in the type system. It also provides stricter type checking for object literals.
Overview
TypeScript is a language for application-scale JavaScript. TypeScript adds optional types, classes, and modules to JavaScript. TypeScript supports tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to clean, readable, standards-based JavaScript. Try it out at TypeScript Playground.
Full details about changes that are in this version of TypeScript are available at: Announcing website.
Download TypeScript 1.6.x
TypeScript 1.6.3 is available for download from Microsoft Download Center. You can download TypeScript 1.6.3 for Visual Studio 2015, TypeScript 1.6.2 for Visual Studio 2013, on npm, or as source. For the download links see:
For instructions on using TypeScript, see the TypeScript tutorial. The source code for the compiler is available at https://github.com/Microsoft/TypeScript.
What's new in TypeScript 1.6
There are a bunch of new features coming in the 1.6 release here are highlights of changes in version 1.6:
JSX support: TypeScript 1.6 supports embedding, type checking, and optionally compiling JSX directly into JavaScript.
Intersection types: TypeScript 1.6 introduces intersection types, the logical complement of union types. A union type A | B represents an entity that is either of type A or type B, whereas an intersection type A & B represents an entity that is both of type A and type B.
Local type declarations: Local class, interface, enum, and type alias declarations can now appear inside function declarations. Local types are block scoped, similar to variables declared with let and const.
Class expressions: TypeScript 1.6 adds support for ES6 class expressions. In a class expression, the class name is optional and, if specified, is only in scope in the class expression itself. This is similar to the optional name of a function expression. It is not possible to refer to the class instance type of a class expression outside the class expression, but the type can of course be matched structurally.
Extending expressions: TypeScript 1.6 adds support for classes extending arbitrary expression that computes a constructor function. This means that built-in types can now be extended in class declarations.
abstract classes and methods: TypeScript 1.6 adds support for abstract keyword for classes and their methods. An abstract class is allowed to have methods with no implementation, and cannot be constructed.
Generic type aliases: With TypeScript 1.6, type aliases can be generic.
Stricter object literal assignment checks: TypeScript 1.6 enforces stricter object literal assignment checks for the purpose of catching excess or misspelled properties. Specifically, when a fresh object literal is assigned to a variable or passed for a parameter of a non-empty target type, it is an error for the object literal to specify properties that don't exist in the target type.
ES6 generators: TypeScript 1.6 adds support for generators when targeting ES6.
Experimental support for async functions: TypeScript 1.6 introduces experimental support of async functions when targeting ES6.
References:
Announcing TypeScript 1.6
TypeScript 1.6.3 release notes
TypeScript 1.6.0 Beta (Release notes)
No comments:
Post a Comment