The release adds a new syntax for kind-only imports and exports, with the intent of giving end users far more fantastic-grained manage about import and elision. The
import kind syntax only imports declarations to be used for kind annotations and declarations and generally receives totally erased. The
export kind syntax only offers an export to be used for kind contexts and is erased from TypeScript output.
In conjunction with
import kind, TypeScript 3.8 also adds a compiler flag to manage what occurs with imports that won’t be used at runtime:
Other advancements promised in TypeScript 3.8 consist of:
- “Fast and loose” incremental kind-checking, featuring a compiler choice,
assumeChangesOnlyAffectDirectDependencies. This choice can decrease build occasions in particular data files, as TypeScript will recheck/rebuild only data files that have adjusted as effectively as data files that directly import them. It is encouraged for significant code bases exactly where developers are eager to defer total challenge mistakes right up until a later on time.
- Implementation of the export as
* nssyntax, supplying a one entry position to expose all customers of an additional module as a one member.
await, an upcoming ECMAScript feature to eliminate limitations on using an
awaitexpression at the prime of a file less than distinct ailments.
allowJsflag kind-checking of individuals data files is supported by means of the
jsconfig.jsonlets end users tell the compiler/language provider which file watching tactics to use to retain observe of data files and directories.
- A refactoring to change string concatenations.
- Stricter assignability checks to unions with index signatures, a breaking transform.
- In an additional breaking transform,
itemin JSDoc is no for a longer period
You can put in the common release of TypeScript 3.8 by means of NuGet or by means of NPM:
npm put in typescript