introduction about type script

39
Introduction about Presenter: BinhQD @binhqd

Upload: binh-quan-duc

Post on 15-Feb-2017

332 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Introduction about type script

Introduction about

Presenter: BinhQD@binhqd

Page 2: Introduction about type script

Contents

1.What is TypeScripts?

2.Why using it?

3.Cons

4.Demo

Page 3: Introduction about type script

What is TypeScript?

❖ TypeScript is designed for large-scale application

❖ Can be compiled to plain Javascript for any browser,any OS and it’s Open Source

❖ Developed and maintained by Microsoft

❖ First appeared: October 1st, 2012, first release July 2014

Current version: 1.8 on January 2016

Page 4: Introduction about type script

What is TypeScript?Example 01:

Page 5: Introduction about type script

What is TypeScript?Example 02:

Page 6: Introduction about type script

What is TypeScript?Example 03:

Page 7: Introduction about type script

TypeScript similars

Page 8: Introduction about type script

Why using it?

❖ Javascript is not designed for Large-Scale applications

Page 9: Introduction about type script

Why using it?

❖ Javascript is not designed for Large-Scale applications

❖ OOP programming

Page 10: Introduction about type script
Page 11: Introduction about type script

Why using it?

❖ Javascript is not designed for Large-Scale applications

❖ OOP programming

❖ TypeScript = ES6 + Optional Typing

Page 12: Introduction about type script
Page 13: Introduction about type script

Why using it?

❖ Javascript is not designed for Large-Scale applications

❖ OOP programming

❖ TypeScript = ES6 + Optional Typing

➢ …

➢ For … of

➢ Spread operator

➢ Promise

➢ Proxy

Page 14: Introduction about type script

Why using it?

❖ Javascript is not designed for Large-Scale applications

❖ OOP programming

❖ TypeScript = ES6 + Optional Typing

❖ TypeScript is using in common JS Frameworks:

➢ Angular2

➢ Ionic

➢ Meteor

➢ React

Page 15: Introduction about type script

Why using it?

❖ Javascript is not designed for Large-Scale applications

❖ OOP programming

❖ TypeScript = ES6 + Optional Typing

❖ TypeScript is using in common JS Frameworks:

➢ Angular2

➢ Ionic

➢ Meteor

➢ React

❖ Type checking when typing

Page 16: Introduction about type script
Page 17: Introduction about type script
Page 18: Introduction about type script

Why using it?

❖ Prevent Javascript common mistake (Non-blocking issue)

Page 19: Introduction about type script
Page 20: Introduction about type script
Page 21: Introduction about type script

Why using it?

❖ Prevent Javascript common mistake (Non-blocking issue)

❖ Output for ES5, ES6, ES7 and future Javascript

Page 22: Introduction about type script

Why using it?

❖ Prevent Javascript common mistake (Non-blocking issue)

❖ Output for ES5, ES6, ES7 and future Javascript

❖ Output to CommonJS/System/AMD/UMD format

Page 23: Introduction about type script

CommonJS

Page 24: Introduction about type script

SystemJS

Page 25: Introduction about type script

AMD (Asynchronous Module Definition)

Page 26: Introduction about type script

UMD (Universal Module Definition)

Page 27: Introduction about type script

Why using it?

❖ Prevent Javascript common mistake (Non-blocking issue)

❖ Output for ES5, ES6, ES7 and future Javascript

❖ Output to CommonJS/AMD format

❖ Unlike CoffeeScript, Dart. Learning TS it is not about learning new language.

Page 28: Introduction about type script

CoffeeScript

Page 29: Introduction about type script

Dart

Page 30: Introduction about type script

TypeScript

Page 31: Introduction about type script

Why using it?

❖ Prevent Javascript common mistake (Non-blocking issue)

❖ Output for ES5, ES6, ES7 and future Javascript

❖ Output to CommonJS/AMD format

❖ Unlike CoffeeScript, Dart. Learning TS it is not about learning new language.

❖ Easy to discontinue

Page 32: Introduction about type script

Cons

❖ Write more type definitions

❖ Need to setup Typescript compiler

❖ Remove some free style

Page 33: Introduction about type script

Demo❖ Installation

$ sudo npm install -g typescript

❖ Tools➢ Visual Studio, Visual Studio Code, Web Maxtrix➢ Eclipse, Netbean➢ Vim➢ Atom➢ Sublime➢ Grunt, Gulp

Page 34: Introduction about type script

Demo - Supported types

❖ boolean

❖ number

❖ string

❖ enum

❖ any

❖ void

❖ array

Page 35: Introduction about type script

Demo - ES6 features

❖ let

❖ arrow function

❖ const

❖ template string

Page 36: Introduction about type script

Demo - OOP

❖ Interface

❖ Supporting ES6 for class-based OOP

❖ Inheritance

❖ public, protected and private members

❖ Modules

❖ Functions

❖ Mixins

Page 37: Introduction about type script

Demo - Output

❖ ES5

❖ ES6

❖ CommonJS

❖ System

❖ AMD

❖ UMD

Page 38: Introduction about type script

Demo - Migrate from existing application

❖ DefinitelyTyped

➢ https://github.com/DefinitelyTyped/DefinitelyTyped

❖ Tools:

➢ $ sudo npm install -g typings

Page 39: Introduction about type script

Thanks