Slide 1

Slide 1 text

TypeScript: JavaScript you are gonna to love ❤

Slide 2

Slide 2 text

Who am I? ๏5 years of front-end experience ๏big enterprise projects ๏mentor ๏public speaker ๏OSS contributor @bobrov1989 https://vitaliy-bobrov.github.io/

Slide 3

Slide 3 text

Agenda ๏WTF TypeScript!? ๏Type system ๏How to Start? ๏Tooling ๏Integrations

Slide 4

Slide 4 text

WTF TypeScript!?

Slide 5

Slide 5 text

Trivial Problem

Slide 6

Slide 6 text

JS Expression Trivia

Slide 7

Slide 7 text

JS Expression Trivia

Slide 8

Slide 8 text

There are NO DEFECTS if there is NO DOCs

Slide 9

Slide 9 text

Trivial Solution

Slide 10

Slide 10 text

jsDoc ๏Too verbose ๏Remember to update ๏No warnings of wrong usage

Slide 11

Slide 11 text

TypeScript JavaScript ESNext Types

Slide 12

Slide 12 text

Any JavaScript is VALID TypeScript

Slide 13

Slide 13 text

ESNext

Slide 14

Slide 14 text

WHY? ๏Easy to collaboration ๏Complex projects ๏Static analysis ๏Reduce errors rate ๏Easy to refactor and maintain

Slide 15

Slide 15 text

Type System

Slide 16

Slide 16 text

let variable: TYPE;

Slide 17

Slide 17 text

Cheat

Slide 18

Slide 18 text

Base Types

Slide 19

Slide 19 text

Functions

Slide 20

Slide 20 text

Array & Tuple

Slide 21

Slide 21 text

DOM API

Slide 22

Slide 22 text

enum

Slide 23

Slide 23 text

Interface

Slide 24

Slide 24 text

Abstract Class

Slide 25

Slide 25 text

Union types

Slide 26

Slide 26 text

Partials

Slide 27

Slide 27 text

http://www.typescriptlang.org/docs/

Slide 28

Slide 28 text

https://medium.com/@martin_hotell

Slide 29

Slide 29 text

How to Start?

Slide 30

Slide 30 text

REPL http://www.typescriptlang.org/play/index.html

Slide 31

Slide 31 text

IDE & Text Editors

Slide 32

Slide 32 text

Just change extension from .js to .ts %

Slide 33

Slide 33 text

Tooling

Slide 34

Slide 34 text

JavaScript checks

Slide 35

Slide 35 text

TypeScript compiler

Slide 36

Slide 36 text

tsconfig.json

Slide 37

Slide 37 text

Webpack

Slide 38

Slide 38 text

Parcel https://parceljs.org/

Slide 39

Slide 39 text

TypeWiz https://github.com/urish/typewiz

Slide 40

Slide 40 text

3rd party libraries http://definitelytyped.org/

Slide 41

Slide 41 text

Integrations

Slide 42

Slide 42 text

Strictly typed REST API calls

Slide 43

Slide 43 text

Just use TypeScript to write NodeJS project %

Slide 44

Slide 44 text

Java / C# Swagger

Slide 45

Slide 45 text

JSON Schema

Slide 46

Slide 46 text

Thank YOU! @bobrov1989 https://vitaliy-bobrov.github.io/ https://speakerdeck.com/bobrov1989/typescript-javascript-you-are-gonna-to-love