The release adds a new syntax for kind-only imports and exports, with the intent of offering people additional fantastic-grained command in excess of import and elision. The
import kind syntax only imports declarations to be utilized for kind annotations and declarations and often will get absolutely erased. The
export kind syntax only gives an export to be utilized for kind contexts and is erased from TypeScript output.
In conjunction with
import kind, TypeScript 3.eight also adds a compiler flag to command what transpires with imports that will not be utilized at runtime:
Other advancements promised in TypeScript 3.eight contain:
- “Fast and loose” incremental kind-examining, that includes a compiler choice,
assumeChangesOnlyAffectDirectDependencies. This choice can decrease develop times in sure documents, as TypeScript will recheck/rebuild only documents that have altered as well as documents that specifically import them. It is suggested for large code bases where by developers are ready to defer whole task errors right up until a afterwards time.
- Implementation of the export as
* nssyntax, furnishing a one entry stage to expose all members of a different module as a one member.
await, an upcoming ECMAScript function to remove constraints on using an
awaitexpression at the top of a file below unique ailments.
allowJsflag kind-examining of those people documents is supported by using the
jsconfig.jsonlets people notify the compiler/language company which file watching tactics to use to hold observe of documents and directories.
- A refactoring to transform string concatenations.
- Stricter assignability checks to unions with index signatures, a breaking improve.
- In a different breaking improve,
objectin JSDoc is no extended
You can set up the typical release of TypeScript 3.eight by way of NuGet or by using NPM:
npm set up typescript