Description
Course info
Rating
(28)
Level
Advanced
Updated
Feb 1, 2018
Duration
2h 2m
Description

At the core of any successful application is an in-depth knowledge of how to write well maintainable code. In this course, Getting the Most from the TypeScript Compiler, you’ll learn how to rely on the compiler to avoid errors and have cleaner code. First, you’ll learn about compiler options you can use. Next, you’ll explore advanced features of the language. Finally, you’ll discover how to use types to better design an application. When you’re finished with this course, you’ll have an advanced knowledge of TypeScript and its compiler that will help you as you write your own applications with fewer errors and an improved design.

About the author
About the author

Thiago Temple is a Brazilian developer based in Ottawa, Canada. He has been building software for more than fifteen years, and his professional interests are mostly related to web development both for the client and server.

More from the author
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi everyone, my name is Thiago Temple, and welcome to my course: Getting the Most from the TypeScript's Compiler. TypeScript is a great language that has been largely growing in adoption in part because it provides static typing on top of JavaScript, but you can have even greater benefits beyond the basic typing the language provides. If you are embracing or have already adopted TypeScript, why not go beyond and try to get the most that you can from it? Here are some of the things we will be exploring in this course: configuring the compiler to do a more strict check on the code, using some of the more advanced features of the language to avoid simple mistakes, a few techniques to keep the code as statically typed as possible, how to implement business rules using the types and type checking that the TypeScript compiler provides. By the end of this course, you'll have a deeper understanding of TypeScript and how you can leverage its compiler to have a greater feedback while you're writing your code, how to avoid mistakes that can be caught by the compiler, how to clean up your code, and even how to improve the design of your applications. Before beginning the course, you should be familiar with the TypeScript language. This is not a beginner's course. I will not be explaining the basics of the language, but that's the only thing you should know. I hope you join me on this journey to learn how to get the most from the TypeScript compiler, at Pluralsight.

Using Advanced Features
Hello. My name is Thiago Temple, and welcome back to my course: Getting the Most from the TypeScript Compiler; and in this module: Using Advanced Features, we will see some of the more advanced features of the language, and while you're using these features, the goal remains the same. We still want to have the compiler to work for us. It's not about using a hidden corner of the language. It's about keeping the code strongly typed, even when we try to make it flexible. We are going to see how to achieve the type safety, while dynamically accessing properties of an object using the keyof keyword. It's also about writing less code when possible because the compiler can generate new types for us based on other types, and we'll see how to do that using mapped types. Next, we are going to see what are the benefits of using union types. Syntactically, union types are very simple, but they are also very powerful and can help us ensure a more type safe code, avoid optional arguments, and have a stronger designed application. Finally, we'll see how to use the compiler so we can be sure we are covering all possible logical cases in a given business scenario with the use of discriminated unions.

Avoiding the Any Type
Hello. My name is Thiago Temple, and welcome back to my course: Getting the Most from the TypeScript Compiler, and in this module: Avoiding the Any Type, we will learn a few strategies to avoid having to type any. If you are using TypeScript, there is a great chance one of the reasons for that is to have a static typed language and the benefits that come with such a language. When using the type any, we are losing the type safety that TypeScript provides, and although using the type any may be needed in some cases, we should try and avoid it as much as we can. During this module, we're going to investigate a few ways we can achieve that by augmenting existing interfaces when we are dealing with this external library. We are also going to see how to achieve the same goal, but using intersection types, and we'll take a look at a more advanced usage of generics in TypeScript. So let's begin.