TypeScript 3.8 release candidate arrives

TypeScript 3.8, a new model of Microsoft’s typed superset of JavaScript, is now readily available

TypeScript 3.8, a new model of Microsoft’s typed superset of JavaScript, is now readily available in a launch prospect model. The latest TypeScript enhance emphasizes type-only imports and exports and ECMAScript criteria compliance.

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.

TypeScript has utilized JavaScript’s import syntax to empower reference sorts. Even though handy, the functionality only worked simply because of the import elision characteristic, which omits TypeScript type imports when TypeScript outputs JavaScript documents. Even so, import elision has been both insufficient and problematic.

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: importsNotUsedAsValues.

Concerning the ECMAScript common for JavaScript, TypeScript 3.8 adds assistance for ECMAScript private fields, which is portion of a class fields declaration proposal for JavaScript. Public and private fields will be integrated into solitary, orthogonal full, in accordance to this proposal.

Other improvements promised in TypeScript 3.8 contain: