9
Ojessitron C on SF 2018

Ojessitron - QCon San Francisco | November 16-20, 2020 · 2020-05-17 · 5 wonderful features of Typescript # I Gradual typing # 2 Literal types # 3 Union types # 4 Typeharrowing

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Ojessitron - QCon San Francisco | November 16-20, 2020 · 2020-05-17 · 5 wonderful features of Typescript # I Gradual typing # 2 Literal types # 3 Union types # 4 Typeharrowing

Ojessitron

C on SF 2018

Page 2: Ojessitron - QCon San Francisco | November 16-20, 2020 · 2020-05-17 · 5 wonderful features of Typescript # I Gradual typing # 2 Literal types # 3 Union types # 4 Typeharrowing

Introduction

What is Typescript ?

Javascript tscJavaScript

t Typest Type Errors

+ Type Oefs

my background : Tara ScalaClojurethis talk: Typescriptt Node .js

WE WILL SEE

5 wonderful features of Typescript5 pitfalls of TS

,Node

,4hpm .

Page 3: Ojessitron - QCon San Francisco | November 16-20, 2020 · 2020-05-17 · 5 wonderful features of Typescript # I Gradual typing # 2 Literal types # 3 Union types # 4 Typeharrowing

Runtime TypeL and hand

.ts

← →a

dats

g's

Page 4: Ojessitron - QCon San Francisco | November 16-20, 2020 · 2020-05-17 · 5 wonderful features of Typescript # I Gradual typing # 2 Literal types # 3 Union types # 4 Typeharrowing

00008

sES3 EST

ESG

995 1999 2009 2015 2016 2017 2018

Page 5: Ojessitron - QCon San Francisco | November 16-20, 2020 · 2020-05-17 · 5 wonderful features of Typescript # I Gradual typing # 2 Literal types # 3 Union types # 4 Typeharrowing

tttES

2¥.

ES3X

.

'

.

i'

T javascript

javascriptsrc →'

.

t stint .

→ target"

I,

. runtimenode

n pmKayes

?

brow6er#

Page 6: Ojessitron - QCon San Francisco | November 16-20, 2020 · 2020-05-17 · 5 wonderful features of Typescript # I Gradual typing # 2 Literal types # 3 Union types # 4 Typeharrowing

npm Package

package .json

index.js . ndex.d.IS

module -_ file

Page 7: Ojessitron - QCon San Francisco | November 16-20, 2020 · 2020-05-17 · 5 wonderful features of Typescript # I Gradual typing # 2 Literal types # 3 Union types # 4 Typeharrowing

me

I \box en chalk 2. x

I

chalk i. x

Page 8: Ojessitron - QCon San Francisco | November 16-20, 2020 · 2020-05-17 · 5 wonderful features of Typescript # I Gradual typing # 2 Literal types # 3 Union types # 4 Typeharrowing

5 wonderful features of

Typescript# I Gradual typing# 2 Literal types

# 3 Union types# 4 Type

harrowing# 5 > Best of IS → your choice of JS

5 pitfalls of TS,

Node,4hpm .

# I Runtime targets# 2 libs# 3 module systems# 4 import syntax¥5 package loading

Page 9: Ojessitron - QCon San Francisco | November 16-20, 2020 · 2020-05-17 · 5 wonderful features of Typescript # I Gradual typing # 2 Literal types # 3 Union types # 4 Typeharrowing

Conclusion

compared to JavaScript ,

Type Script is strictly better. Replace some of your build chain

replaces part of your build chain

declare types when they are useful to you .

compared to Java or C#,

Typescript offers :

flexible typingaccess to TSI Node ecosystem

closer brain space to front end

but costs :

learning the Ssl Node ecosystem

the Java tooling you're spoiled by