Sharing Top Content from the Angular-sphere.

Announcing TypeScript 2.6 RC

  • You can get TypeScript 2.6 RC working with Visual Studio Code and Sublime Text, though the full release of TypeScript 2.6 will be available out of the box.
  • The compromise of increasing strictness on all function types but methods also allows TypeScript to continue modeling the above use-cases (e.g. event handlers and simpler array handling).
  • This may introduce some breaks, so to disable the check with on, you can specify on the command line or in your as so: – – Historically, we’ve avoided error suppression within TypeScript because most cases where our users asked for it could be solved through more accurate declaration files,…
  • However, over time, we have seen two motivating examples: migrating from JavaScript to TypeScript, and overcoming type-checks that live in legacy code.
  • For example, in the following code, TypeScript would ordinarily report an error about the statement being unreachable.

TypeScript 2.6 RC is now available! To get started with the latest stable version of TypeScript, you can grab it through NuGet, or use the following command with npm:

TypeScript 2.6 RC is now available! To get started with the latest stable version of TypeScript, you can grab it through NuGet, or use the following command with npm:

Visual Studio 2015 users (who have Update 3) can install TypeScript 2.6 RC from here, and Visual Studio 2017 users using version 15.2 or later will be able to get TypeScript by simply installing it from here.

You can get TypeScript 2.6 RC working with Visual Studio Code and Sublime Text, though the full release of TypeScript 2.6 will be available out of the box.

Let’s take a look at what TypeScript 2.6 will bring!

With TypeScript 2.6, we’re introducing a new mode flag: . TypeScript has traditionally compared parameters in a bivariant manner. There are a number of reasons for this – modeling event handlers in the DOM, allowing a simpler model for working with arrays, and more.

In TypeScript 2.4, we tightened these checks a bit, but a few problems still remained. For example, the following would compile with no errors:

While this is a very basic example, we re-evaluated our design decisions based on how JavaScript is written today and will be in the coming years, and felt that there were improvements we could make while accomodating the patterns described above.

Under ,…

Announcing TypeScript 2.6 RC

Comments are closed, but trackbacks and pingbacks are open.