What’s New In TypeScript 3.0?

By | August 16, 2018

For starters, TypeScript is basically an open source programming language that is an optionally-typed superset of JavaScript. It is designed to develop large applications as well as transcompiles to JavaScript and can also be used to create JavaScript applications for server-side/node.js and client-side execution. Typescript originated as a result of the weaknesses of JavaScript in the development of large applications at Microsoft and among other external customers. The complex JavaScript code brought about many challenges which led to the need for custom tooling that would ease the process of developing components in the JavaScript language.

Typescript is highly compatible with JavaScript hence JavaScript can seamlessly be consumed by a TypeScript program. The release of TypeScript 3.0 by Microsoft offers a new way to structure projects as well as improved error messages making its adoption relatively easy.

TypeScript 3.0 allows you to easily change filename extensions from .js to .ts using TypeScript-aware tools and the TypeScript compiler since the existing JavaScript is also valid TypeScript. In this TypeScript 3.0 overview, we will look at what’s new in this current version of TypeScript as well its features.

What Is New In TypeScript 3.0?

This current version of TypeScript has several dominant features but key among them is a feature known as the project reference capability which allows interdependence of projects hence it becomes easy for tsconfig.json files to reference other similar file types. One can easily use TypeScript and tools that are able to understand output structure and build order for splitting code into smaller projects by simply specifying these dependencies. This also ensures faster build times. TypeScript 3.0 also allows developers to be able to transparently edit and navigate across various projects.

Other Features of TypeScript 3.0

Some other notable features of TypeScript 3.0 include:

  • Tuples in rest parameters
  • Tuples in spread expressions
  • Generic rest parameters
  • Support for JSX defaultProps
  • Unknown type
  • Improved error messages
More interesting articles:

TypeScript 3.0 allows rest parameters to become generic and further infers these generics as tuple types. In the creation of a component, developers can define default values for props with React’s defaultProps. TypeScript 3.0 has also expanded what tuples can do which means that tuples can now allow for trailing optional elements, rest elements at the end and can also be empty.

Error messages can help you figure out exactly how to fix issues by providing related error spans unlike previously where error messages were a bit vague. Error messages are also smarter and cleaner allowing you to easily and conveniently check over your code. Another feature of Typescript 3.0 is the “unknown” type which is a type-safe counterpart of any but is probably the least capable type. Any value can be assigned to unknown just like any but unlike any, everything else needs a control flow-based narrowing or type assertion to be assignable to unknown.

Typescript 3.0 may not necessarily be a code breaking update but it offers several amazing features for you to explore. If you have not used this current release you can still get it and see what more it has to offer.

Understanding TypeScript
Learn what TypeScript is, why it really is a powerful Addition to JavaScript, what its Features are and how to use it! And whilst doing so, also understand what you’re actually doing in your Angular 2 Code. This Course takes you from the very Basics and its most important Feature (Types!) to the Point where you’re able to use TypeScript in any of your Projects. ReactJS Projects included!

Angular Essentials (Angular 2+ with TypeScript)
The most efficient way to dive into Angular 2 or Angular 5 if you got limited time or need to refresh the basics! Build highly reactive and user-friendly web applications running in the browser (driven by JavaScript). Dive deeper into Angular with very solid fundamentals taught by this course.