https://frontendmasters.com/workshops/typescript/Table of Contents
TypeScript
Introduction
00:00:00 - 00:03:07
Introduction
Mike North introduces his TypeScript course. TypeScript is a
Primitive Types
00:03:08 - 00:06:47
Primitive Types
Mike reviews six primitive types in JavaScript.
Variable Declarations
00:06:48 - 00:13:40
Variable Declarations
Mike examines the specifics of variable declarations var, let and const for reassigning, scope, and hoisting.
Type Conversion
00:13:41 - 00:16:34
Type Conversion
Mike discusses the sometimes confusing type conversion with the + and unary operators
Course Agenda
00:16:35 - 00:24:30
Course Agenda
Mike reviews the course agenda, which covers the difference between modern JavaScript and TypeScript, how TypeScript provides structure for React components, using types to make the code more expressive, practice strategies for adoption, and more.
Types
Adding Types
00:24:31 - 00:30:22
Adding Types
Mike reviews reasons for adopting types.
Implicit Typing
00:30:23 - 00:32:01
Implicit Typing
Mike discusses how TypeScript can guess types through the assigning of a value to a variable.
Explicit Typing
00:32:02 - 00:34:48
Explicit Typing
Mike discusses how to set explicit typing, which is the practice of setting a type while declaring a variable.
Object Shapes
00:34:49 - 00:38:10
Object Shapes
After talking about nominal type and structural type systems for checking if two types are the same, Mike reviews object shapes, which are the names of properties and types of their values.
Challenge 1: Color Functions
00:38:11 - 00:46:33
Challenge 1: Color Functions
In this challenge, students convert color values from different color systems.
Challenge 1: Solution
00:46:34 - 00:58:18
Challenge 1: Solution
Mike walks through the solution to Challenge 1.
Interfaces
00:58:19 - 01:05:23
Interfaces
After revealing that additional properties can be regarded as a possible bug as object shapes are checked more strictly, Mike introduces interfaces, which allow for describing the structure. Mike takes questions from students.
any & never Types
01:05:24 - 01:10:20
any & never Types
After introduces the any type, which bypasses type checking, Mike reviews the never type. The never type is the return type for functions that never return and never is the type of variables under type guards that are never true.
Challenge 2: Account Manager
01:10:21 - 01:14:23
Challenge 2: Account Manager
In this challenge, students design TypeScript interfaces for two accounts, user and admin. Mike takes questions from students.
Challenge 2: Solution
01:14:24 - 01:31:01
Challenge 2: Solution
Mike walks through the solution to Challenge 2. Mike takes questions from students.
Classes
Defining & Creating Instances
01:31:02 - 01:32:18
Defining & Creating Instances
Mike reviews classes in JavaScript including the constructor function used to initialize instances.
Methods
01:32:19 - 01:33:36
Methods
Mike shows that methods can be defined in a manner similar to objects. Static methods can be defined using the static keyword.
Public & Instance Fields
01:33:37 - 01:37:23
Public & Instance Fields
Mike reviews the proposed public and instance fields on classes in JavaScript.
Inheritance
01:37:24 - 01:39:31
Inheritance
Mike discusses how subclasses can be created using the extends keyword. The super keyword can be used to call methods on the parent class.
Species
01:39:32 - 01:49:48
Species
Mike reviews the species, which is a special property on classes when creating derived objects. Mike takes questions from students.
Mixins & Classes
01:49:49 - 01:52:46
Mixins & Classes
After showing mixins patterns, which are abstract classes, Mike reviews how to define the shape of classes in TypeScript.
Enums
01:52:47 - 01:55:20
Enums
Mike introduces enums, which are types used to define a fixed number of possible values.
Arrays & Tuples
01:55:21 - 02:00:42
Arrays & Tuples
Mike reviews arrays in TypeScript, which work the same way as in JavaScript. Mike takes questions from students.
Type Aliases
02:00:43 - 02:01:47
Type Aliases
Mike shows how to use the type keyword to define a type alias.
Challenge 3: Card Dealing
02:01:48 - 02:04:23
Challenge 3: Card Dealing
In this challenge, students build out a card dealing program using enum types to represent each card's suit and number.
Challenge 3: Solution
02:04:24 - 02:22:43
Challenge 3: Solution
Mike walks through the solution to Challenge 3.
Object Literals
Enhanced Object Literal
02:22:44 - 02:25:43
Enhanced Object Literal
After reviewing JavaScript objects, Mike examines enhanced object literal.
Destructured Assignment
02:25:44 - 02:28:23
Destructured Assignment
Mike shows a way to pick one or more properties off an object into distinct variables. Mike takes questions from students.
Rest and Spread Properties
02:28:24 - 02:34:40
Rest and Spread Properties
After discussing that rest properties collect the remaining enumerable property keys that are not already picked off by the destructuring pattern, Mike reviews spread properties, which copies their own enumerable properties from a provided object onto a newly created object.
Getters & Setters
02:34:41 - 02:36:58
Getters & Setters
Mike reviews getters and setters. While a getter is a method that gets the value of a specific property, the setter is a method setting the value of a specific property.
Functions: Types
02:36:59 - 02:42:54
Functions: Types
Mike discusses how functions are types and how interfaces can be used to describe a function type.
Functions: Parameters
02:42:55 - 02:49:52
Functions: Parameters
Mike discusses required parameters, default values, and rest parameters. TypeScript assumes every argument in the function is required.
Challenge 4: Functional Cashier
02:49:53 - 02:52:18
Challenge 4: Functional Cashier
In this challenge, students build out a functional shopping cart. Mike takes questions from students.
Challenge 4: Solution
02:52:19 - 03:04:57
Challenge 4: Solution
Mike walks through the solution to Challenge 4.
Generics
Introducing Generics
03:04:58 - 03:13:28
Introducing Generics
Mike introduces generics, which allow the reuse of code across types, interfaces, and functions.
Access Modifier Keywords
03:13:29 - 03:15:50
Access Modifier Keywords
Mike discusses access modifier keywords, public, protected, and private, which help encapsulate a class and determines access to the class. Mike takes questions from students.
Function Overloading
03:15:51 - 03:30:03
Function Overloading
Mike demonstrates that TypeScript allows for more than one function types for the same function as a list of overloads.
Challenge 5: Typed Stack
03:30:04 - 03:33:43
Challenge 5: Typed Stack
In this challenge, students build a stack data structure using generics. Mike takes questions from students.
Challenge 5: Solution
03:33:44 - 03:50:29
Challenge 5: Solution
Mike walks through the solution to Challenge 5.
Iterators & Generators
Introducing Iterators
03:50:30 - 03:52:19
Introducing Iterators
Mike introduces iterators, which allow access one item from a collection at a time and keeps tracks of the current position.
Iterables
03:52:20 - 04:00:51
Iterables
Mike reviews and demonstrates iterables, objects that can ask for an iterator.
Generators
04:00:52 - 04:19:53
Generators
Mike discusses generators, which define an iterative algorithm by writing a single function which can maintain its state.
Iterators
04:19:54 - 04:34:30
Iterators
Mike demonstrates the ability to pass values in while iterating. Mike takes questions from students.
Challenge 6: Fibonacci Generator
04:34:31 - 04:36:57
Challenge 6: Fibonacci Generator
In this challenge, students build a generator function that returns an iterator, which emits the numbers of the Fibonacci sequence.
Challenge 6: Solution
04:36:58 - 04:40:57
Challenge 6: Solution
Mike walks through the solution to Challenge 6.
React & TypeScript
Stateless Functional Components
04:40:58 - 04:43:55
Stateless Functional Components
Mike discusses how to integrate TypeScript with React by first addressing using interfaces to describe props.
Integrating React & TypeScript
04:43:56 - 04:58:17
Integrating React & TypeScript
After getting the project up and running, Mike shows how to integrate TypeScript with React.
Challenge 7: Autocomplete, Part 1
04:58:18 - 05:05:14
Challenge 7: Autocomplete, Part 1
In this challenge, students code an autocomplete feature.
Challenge 7: Solution
05:05:15 - 05:17:57
Challenge 7: Solution
Mike walks through the solution to build stateless functional component for a search result item.
Stateful Components
05:17:58 - 05:28:29
Stateful Components
Mike discusses stateful components, which are usually classes that describe props and state. Mike takes questions from students.
Challenge 8: Autocomplete, Part 2
05:28:30 - 05:48:28
Challenge 8: Autocomplete, Part 2
Before students continue to work building out the autocomplete feature, Mike reviews code additions to the project in order to aid in completing the challenge.
Challenge 8: Solution
05:48:29 - 06:11:14
Challenge 8: Solution
Mike walks through the solution to build stateless functional component for a search result item.
Challenge 9: Autocomplete, Part 3
06:11:15 - 06:16:11
Challenge 9: Autocomplete, Part 3
In this challenge, students work on refactoring state management in the project.
Challenge 9: Solution
06:16:12 - 06:29:02
Challenge 9: Solution
Mike walks through the solution.
Challenge 10: Autocomplete, Part 4
06:29:03 - 06:38:39
Challenge 10: Autocomplete, Part 4
In this challenge, students implement task function that treats the contents of a generator function that appears to work like async and await. Mike takes questions from students.
Challenge 10: Solution
06:38:40 - 07:10:29
Challenge 10: Solution
Mike walks through the solution.
Wrapping TypeScript
Wrapping Up
07:10:30 - 07:13:39
Wrapping Up
Mike wraps up the TypeScript course by reviewing the course agenda.