The release provides a new syntax for kind-only imports and exports, with the intent of providing buyers much more great-grained management around import and elision. The
import kind syntax only imports declarations to be employed for kind annotations and declarations and often gets entirely erased. The
export kind syntax only presents an export to be employed for kind contexts and is erased from TypeScript output.
In conjunction with
import kind, TypeScript three.8 also provides a compiler flag to management what occurs with imports that will not be employed at runtime:
Other advancements promised in TypeScript three.8 involve:
- “Fast and loose” incremental kind-checking, showcasing a compiler option,
assumeChangesOnlyAffectDirectDependencies. This option can decrease create situations in sure documents, as TypeScript will recheck/rebuild only documents that have modified as well as documents that directly import them. It is advisable for substantial code bases where by developers are eager to defer full venture errors till a later time.
- Implementation of the export as
* nssyntax, giving a single entry position to expose all customers of another module as a single member.
await, an future ECMAScript element to take away restrictions on using an
awaitexpression at the major of a file below distinct situations.
allowJsflag kind-checking of all those documents is supported by means of the
jsconfig.jsonlets buyers explain to the compiler/language company which file observing methods to use to maintain track of documents and directories.
- A refactoring to convert string concatenations.
- Stricter assignability checks to unions with index signatures, a breaking improve.
- In another breaking improve,
itemin JSDoc is no for a longer period
You can set up the normal release of TypeScript three.8 as a result of NuGet or by means of NPM:
npm set up typescript