type script francis_paulin_20131129

16
TypeScript HVORFOR OG HVORDAN, EN PRAKTISK INNFØRING Francis Paulin, Software Engineer @ Steria Norway @paulin_francis

Upload: francis-dougherty-paulin

Post on 16-Jul-2015

120 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: Type script francis_paulin_20131129

TypeScriptHVORFOR OG HVORDAN, EN PRAKTISK INNFØRING

Francis Paulin, Software Engineer @ Steria Norway

@paulin_francis

Page 2: Type script francis_paulin_20131129

Hva er TypeScript?

Supersett av JavaScript – forsøker å ligge tett opp mot ES6

Designet av Anders Hejlsberg

JavaScript er gyldig TypeScript

Kompilator som kompilerer til JavaScript

Kan kompilere til ES3 eller ES5

TypeScript kan innføres litt og litt i en kodebase

Page 3: Type script francis_paulin_20131129

Tooling Visual Studio 2012 og 2013

Sublime

Npm (npm install -g typescript)

http://www.typescriptlang.org/#Download

Page 4: Type script francis_paulin_20131129

Typer

string

number

boolean

any

void*

<T>

Page 5: Type script francis_paulin_20131129

Syntaks

Page 6: Type script francis_paulin_20131129

Klasser

Page 7: Type script francis_paulin_20131129

Moduler Som namespace i C#

Page 8: Type script francis_paulin_20131129

Interface

Page 9: Type script francis_paulin_20131129

Arv

Page 10: Type script francis_paulin_20131129

Valgfrie& rest-parametere

Page 11: Type script francis_paulin_20131129

Generics

Page 12: Type script francis_paulin_20131129

Properties Obs: Fungerer kun dersom man kompilerer til ES5!

Page 13: Type script francis_paulin_20131129

Fallgruber

Page 14: Type script francis_paulin_20131129

Eksterne biblioteker

Typedefinisjoner: .d.ts

Ambient declarations

https://github.com/borisyankov/DefinitelyTyped

Definisjoner finnes også på Nuget

Page 15: Type script francis_paulin_20131129

Demo

Page 16: Type script francis_paulin_20131129

Komme i gang

http://www.typescriptlang.org/Playground/

http://pluralsight.com/training/courses/TableOfContents?courseNa

me=typescript

http://www.typescriptlang.org/Content/TypeScript%20Language%2

0Specification.pdf