The Complete Magazine on Open Source

TypeScript 2.4 enhances load times

1.25K 0

TypeScript 2.4

TypeScript, the popular typed JavaScript superset developed by Microsoft, has received a new version. Dubbed TypeScript 2.4, the latest release features a dynamic import expressions capability.

Microsoft’s development team has improved load times on TypeScript by adding dynamic import expressions. The new feature runs import () calls in ECMAScript to enable asynchronously loading of a module at any arbitrary point in a program. Developers can leverage the advanced development to get much faster load times with fewer JavaScript transmissions while loading projects.

Check for weak types

Another notable addition to the TypeScript v2.4 release is a check for weak types. The check contains very few optional properties and restricts what can be assigned to the check. You can utilise the tweak to declare existing properties and add index signature to a weak type. Also, you will no longer be able to assign anything to a weak type if properties are overlapping.

Additionally, there is an inclusion of safer callback parameter checking in the latest version. TypeScript uses the addition to checking if parameters are bi-directionally assignable or not. However, this model does not work very well on containers that are programmed to handle internal data from callbacks.

TypeScript 2.4 also introduces improved inference for generics that has changed the way generics are inferred. Besides, the new build supports both string literal types and enums.

You can presently add all the newest features of TypeScript to your system by adding its release candidate version. The testing-centric version can be installed simply by running the command npm install -g [email protected] in the terminal.