The launch adds a new syntax for type-only imports and exports, with the intent of offering customers more wonderful-grained manage in excess of import and elision. The
import type syntax only imports declarations to be utilized for type annotations and declarations and always gets fully erased. The
export type syntax only provides an export to be utilized for type contexts and is erased from TypeScript output.
In conjunction with
import type, TypeScript 3.8 also adds a compiler flag to manage what occurs with imports that won’t be utilized at runtime:
Other improvements promised in TypeScript 3.8 contain:
- “Fast and loose” incremental type-examining, that includes a compiler option,
assumeChangesOnlyAffectDirectDependencies. This option can lessen establish periods in sure documents, as TypeScript will recheck/rebuild only documents that have modified as effectively as documents that immediately import them. It is proposed for big code bases the place builders are prepared to defer full project mistakes right until a later time.
- Implementation of the export as
* nssyntax, giving a solitary entry place to expose all members of yet another module as a solitary member.
await, an approaching ECMAScript characteristic to clear away constraints on employing an
awaitexpression at the prime of a file beneath precise disorders.
allowJsflag type-examining of people documents is supported by way of the
jsconfig.jsonlets customers explain to the compiler/language services which file looking at strategies to use to hold observe of documents and directories.
- Stricter assignability checks to unions with index signatures, a breaking improve.
- In yet another breaking improve,
objectin JSDoc is no for a longer period
The typical launch of TypeScript 3.8 is predicted in late February or early March. The launch prospect can be accessed by way of NuGet or by way of NPM:
npm put in [email protected]