Upgraded supported TypeScript version to v2.7. #3978
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR upgrades compatibility to TypeScript v2.7. It also adds the
yield*
operator to JavaScript and JSX.First some minor parsing improvements:
You can now name anonymous functions, e.g.
Assertion typing (casting) is now supported in
for
statements, e.g.You can now export type aliases, e.g.
(and they don't need to end with a semi-colon).
Union, intersection type aliases can now start with a leading | or &, e.g.
See microsoft/TypeScript#12386
Tuples (and function parameter lists) can have a trailing comma:
See microsoft/TypeScript#28893
Upgrades based on TypeScript versions:
TypeScript v0.9
You can now declare namespaces, e.g.
See https://www.typescriptlang.org/docs/handbook/declaration-files/by-example.html
TypeScript v1.8
Boolean, number and string literal types are now supported, e.g.
See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-8.html#type-parameters-as-constraints
TypeScript v2.0
Added non-null assertion operator, e.g.
See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html#non-null-assertion-operator
Added
undefined
type, e.g.See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html#null--and-undefined-aware-types
Added
never
type, e.g.See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html#the-never-type
TypeScript v2.1
Added
keyof
and indexed access types, e.g.See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html#keyof-and-lookup-types
TypeScript v2.2
Added
object
type, e.g.See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#object-type
TypeScript v2.3
Added
yield*
operator to JavaScript, TypeScript & JSX.See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-3.html#generators
Added generic parameter defaults, e.g.
See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-3.html#generic-parameter-defaults
TypeScript v2.7
Added
unique symbol
type, e.g.declare const Foo: unique symbol;
See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#unique-symbol