Introduction to Typescript Versions
We all know that typescript is booming nowadays. It is nothing but the superset of JavaScript. That simply means It is just a javaScript with strict typing capabilities. In Angular 2+ versions, we mostly use it for easy coding purposes. So, in this article we will see different typescript versions.
Initially, it was introduced by Microsoft in 2012. And the very first version of it is 0.8. Thereafter the next version came into picture i.e. 0.9. Which is developed in 2013? It had many drawbacks such as support for other operating systems and for IDE. Later version 1.0 came with these improvements in the year 2014. Further version 2.0 launched in 2016.
List of Typescript Versions
Here is the list of TypeScript Versions mention below:
- Version 1.1: When version 1.1 came it was nearly four times faster than the older version of it. This was very useful to improve Javascript projects.
- Version 1.3: In this release, it introduced the one access modifier i.e. protected as you may have seen it in java or any other language. If you don’t know what does it mean then let me tell you this gives access to only class and its subclasses to use members of the protested class.
- Version 1.4: ES6 features are being used like declaring variables with let and const keywords rather than using var keyword which tends to create hoisting scenarios. Strictness in generic calls has been improved here.
- Version 1.5: This has support for modules in ES6. It enhanced the functionality for importing and exporting different modules.
- Version 1.6: 1.5 version came with the support for JSX. This is nothing but the javascript-XML. JSX at the end gets compiled to javascript only. It came up with a new extension that is .tsx which embeds jsx. And it also introduced as an operator to rename importing.
- Version 1.7: This gave support for Asynchronous programming with Async-Await and Promises which are very important to the latest programming practices in ES6.
- Version 1.8: This allows for the reference type parameter from the same parameter list. This solved many problems,
- Version 2.0: In this version use of null and undefined data types got some weight age to assign the values at a particular scenario. Previously it was difficult to identify the errors with null and undefined.
- Version 2.1: This gives us the ability to make some keys optional. The key and Lookup types have been enhanced in this version.
- Version 2.2: This version gives us the ability to use mixin classes of ES6 and mixin constructor type. It also supports the spread operator in JSX expression.
- Version 2.3: This supports the ES6 features like generators and Iterator. Previously these features only supported by ES6 and later versions but not from this version we can use it here.
- Version 2.4: In this version we got the functionality to import any library or module in the program anywhere when needed. This also called Dynamic Import Expressions. This also introduces string initializes for enum.
- Version 2.5: This introduces to optional catch statement and type assertions with the syntax /** @type {…} */. Also, this version allowed us to get in the new updated version of packages without duplicating it with redirecting packages to a newer version.
- Version 2.6: It introduces the –watch flag to mark the changes. It has a strict function type flag for checking the type of functions strictly. It only ignores the methods inside the constructor or in any method.
- Version 2.7: This version allowed us to declare properties with the const keyword. Ex: const Abc = “123”. This also introduced a new flag called – strictPropertyInitialization. This used to initialize each property in the constructor of the class. It also has a Pretty flag to make error messages more readable.
- Version 2.8: It introduces conditional types. You can see it as a ternary operator. Which works like if ..else statements. Syntax: T extends U ? X : Y
- Version 2.9: It adds support for number and symbol named properties in the index and mapped types. Before it was supported for string only.
- Version 3.0: This version allows us to split the project into smaller projects with the help of project references. It gives a new flag –build. –build flag runs faster builds for the project. It also supports for Tuples in spread expressions and rests parameters.
- Version 3.1: This simplifies the version controversy with the new field in package.json file. Which looks like below:
{ "typesVersions": { ">=3.1": { "*": ["ts3.1/*"] }
- Version 3.2: It introduces –strictBindCallApply flag. This gives us access to methods like call apply and bind. It also has –showConfig. Which refreshes the tsconfig.json file.
- Version 3.3: It reduces the 50 to 70% of total build time with the flag –builds and –watch. Which helps to build the required files. This also introduced better behavior for calling union types.
- Version 3.4: This gave us the –incremental flag for the fast build process of an application. It catches up with the changes and builds accordingly. For that, we need field incremental as true in the tsconfig.json file.
- Version 3.5: The minor changes happened here so far as improvements in – incremental flag. Good optimization has been achieved through builds and type checks. This also introduces the Omit helper type which removes a property from the original definition.
- Version 3.6: This version improved on typechecking with generators. Earlier we were not able to recognize that the value is return by generator or yielded. But now we can check the correct type of it. This also supports greatly for Unicode characters. It also has a smarter auto-import syntax.
- Version 3.7: This is the latest release. This version introduces some breaking changes such as function truthy checks, API changes. Optional chaining was an issue. Do we make use of it? operator for this. ? operator makes property optional access. It also has a nullish coalescing operator(??) like optional chaining. Also, the use of asset function has been improved.
Conclusion
Typescript earlier has many issues while working with it. Now the latest version came with most of the bug fixes. If you want to go deep then you can always follow the documentation for its official sites.
Recommended Articles
This is a guide to TypeScript Versions. Here we discuss the basic concept and different versions of typescript in detail. You may also look at the following article to learn more –