Introducing type script

22
Introducing TypeScript Large scale JavaScript application development made easy By Remo H. Jansen

Transcript of Introducing type script

Page 1: Introducing type script

Introducing TypeScriptLarge scale JavaScript application development made easyBy Remo H. Jansen

Page 2: Introducing type script

What is TypeScript?TypeScript is a typed superset of JavaScript.

Compiles to plain JavaScript.

Any IDE. Any browser. Any host. Any OS.Open Source.

Based on open standards (ES6, ES7...).

Page 5: Introducing type script

Complex !== ComplicatedComplicated implies being difficult to understand but

with time and effort, ultimately knowable.

Complex describes the interactions between a number of entities. If the number of entities and interactions between them increase we will get to a point where it would be impossible to know and understand all of them.

Page 6: Introducing type script
Page 7: Introducing type script

TypeScript is the future of JavaScriptTypeScript allows us to use ES6 and ES7

today!

We can use the --target compiler option to specify ECMAScript target version: ES3, ES5 or ES6.

Page 8: Introducing type script

Classes

Page 9: Introducing type script

Inheritance

Page 10: Introducing type script

ModulesWe can use the --module compiler option to specify module code generation:

CommonJS

AMD

System

UMD

Page 12: Introducing type script

Async / Await

Page 13: Introducing type script

Decorators

Note: The code snippets above are part of an open-source project I’m working on. You can learn more about it at http://inversify.io/

● Metadata Reflection API

Page 15: Introducing type script

TypeScript goes beyond ES6 & ES7TypeScript is a strongly typed

programming language

TypeScript introduces some great design-time features that are not available in ES6 or ES7.

Page 16: Introducing type script

Namespaces● AKA Internal modules● It is recommended to

use ES6 modules instead

Page 17: Introducing type script

Types● Design-time only● Type inference● Optional type

annotations● Type guards● Union types● Intersection types

Page 18: Introducing type script

Interfaces● Design-time only● Structural type system● Type definitions (.d.ts files)

Page 19: Introducing type script

Generics● Design-time only● Generic constraints can be

declared

Page 21: Introducing type script

Questions?

Page 22: Introducing type script

Thanks!● Join the Dublin TypeScript Meetup to learn more!

● Get 20% off my book “Learning TypeScript” (eBook) using promo code PACKT20 at www.packtpub.com