1 / 17

Introduction to TypeScript

Introduction to TypeScript. Michael Chu. Agenda. JavaScript. Features. Declarations. 1. 2. 3. 4. 5. 6. Alternatives. Tooling. Resources. JavaScript. 1995 20 years ago. Dynamic computer programming language. Brendan Eich Netscape Communica ., Mozilla Foundation.

goret
Télécharger la présentation

Introduction to TypeScript

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to TypeScript Michael Chu

  2. Agenda JavaScript Features Declarations 1 2 3 4 5 6 Alternatives Tooling Resources

  3. JavaScript 1995 20 years ago Dynamic computer programming language Brendan Eich Netscape Communica., Mozilla Foundation Client side Server side (Node.js) Single Page App

  4. Demo JavaScript

  5. Application scale JavaScript development is hard • not design as a programming language for big application • does not have static typing • lack structuring mechanisms like classes, modules, interfaces

  6. Expert “JavaScript is the assembly language of the Web.” Erik Meijer (software architect)

  7. Expert “You can write large programs in JavaScript. You just can’t maintain them.” Anders Hejlsberg (father of C#)

  8. The Alternatives • Hard core JavaScript development • JavaScript preprocessors that compiles to JavaScript: S# CoffeeScript coffeescript.org custom lang. Clojurescript github.com custom lang. Script# github.com C# Dart http://dartlang.org custom lang. by Google

  9. TypeScript • TypeScriptis a typed superset of JavaScript that compiles to plain JavaScript. • TypeScript is a language for application scale JavaScript development. • Any browser. Any host. Any OS. • Open Source. • ~typescriptlang.org JS TS JS Copy JS code Compile to JavaScript Into TS file

  10. TypeScript Key Features • Support standard JavaScript code with static typing • Zero cost: Static types completely disappear at run-time • Encapsulation though classes, modules and interfaces • Constructors, properties and functions (public, private) • Enums • Lambda and generics support • Intellisense and syntax checking • IDE support • Visual Studio • Sublime Text, Vi, Emacs • Eclipse, WebStorm • Preview Pane – Web Essentials

  11. Demos TypeScript

  12. Highlights Tool Features TypeScript Code • Type Annotation • Any and Primitive Type • Interface, Implementation • Class, constructor • Opt. Parameter, overloads • Event handler • Get accessor, private, static • Arrow function, lambda • Module • Typed definitions • And more… • Type Inference • Intellisense, statement comp. • Compile on Save • Preview Pane • ECMAScript version • Redirect JavaScript output • Generate declaration files

  13. TypeScript Versions • TypeScript 1.3 for VS older (Web Essentials) • TypeScript 1.3 for VS 2013 Update 2 • TypeScript 1.4 for VS 2013 • TypeScript 1.4 for VS 2015 CTP5 • TypeScript 2.0 (vNext)

  14. Resources • http://www.typescriptlang.org • http://www.typescriptlang.org/Content/TypeScript%20Language%20Specification.pdf • http://www.typescriptlang.org/Playground • http://vswebessentials.com/download • https://github.com/borisyankov/DefinitelyTyped • https://github.com/Microsoft/TypeScript

  15. Angular 2: Built on TypeScript • http://blogs.msdn.com/b/typescript/archive/2015/03/05/angular-2-0-built-on-typescript.aspx • http://blogs.msdn.com/b/visualstudio/archive/2015/03/12/a-preview-of-angular-2-and-typescript-in-visual-studio.aspx

  16. Summary • Open source language that compiles into JavaScript • Code encapsulation • Maintainable code • Tooling support Application scale JavaScript development is hard TypeScript makes it easier

  17. Questions

More Related