TypeScript
-
Upload
fabian-vilers -
Category
Technology
-
view
666 -
download
0
description
Transcript of TypeScript
![Page 1: TypeScript](https://reader036.fdocuments.net/reader036/viewer/2022082808/554f77a7b4c9052a518b4837/html5/thumbnails/1.jpg)
TypeScriptFabian Vilers
@fvilershttp://www.linkedin.com/in/fvilers
![Page 2: TypeScript](https://reader036.fdocuments.net/reader036/viewer/2022082808/554f77a7b4c9052a518b4837/html5/thumbnails/2.jpg)
Who am I ? Founder & owner of Dev One
IT consultant with more than 15 years of experience
Microsoft .NET software architect & technology enthusiast
Father of two daughters, gamer, photographer & poker player
![Page 3: TypeScript](https://reader036.fdocuments.net/reader036/viewer/2022082808/554f77a7b4c9052a518b4837/html5/thumbnails/3.jpg)
Who are you ?
![Page 4: TypeScript](https://reader036.fdocuments.net/reader036/viewer/2022082808/554f77a7b4c9052a518b4837/html5/thumbnails/4.jpg)
Application scale JavaScript development is hard Scripting language
No static typing
Lacks of structuring mechanisms (classes, modules, interfaces)
![Page 5: TypeScript](https://reader036.fdocuments.net/reader036/viewer/2022082808/554f77a7b4c9052a518b4837/html5/thumbnails/5.jpg)
TypeScript is a language for application-scale JavaScript development
TypeScript is a superset of JavaScript that compiles to JavaScript
Any browser, any host, any OS
Open source
![Page 6: TypeScript](https://reader036.fdocuments.net/reader036/viewer/2022082808/554f77a7b4c9052a518b4837/html5/thumbnails/6.jpg)
TypeScript Starts with JavaScript All JavaScript code is TypeScript code, simply copy and paste All JavaScript libraries work with TypeScript
Optional static types, classes, modules Enable scalable application development and excellent tooling Zero cost: static types completely disappear at run-time
Ends with JavaScript Compiles to idiomatic JavaScript Runs in any browser or host, on any OS
![Page 7: TypeScript](https://reader036.fdocuments.net/reader036/viewer/2022082808/554f77a7b4c9052a518b4837/html5/thumbnails/7.jpg)
DemoTypeScript type system
![Page 8: TypeScript](https://reader036.fdocuments.net/reader036/viewer/2022082808/554f77a7b4c9052a518b4837/html5/thumbnails/8.jpg)
Type system Formalization of JavaScript’s types Static representation of JavaScript’s dynamic type system
Type inference and structural typing In practice very few type annotations are necessary
Works with existing JavaScript libraries Declaration files can be written and maintained separately
Not « provable type safe » Types reflect intent but do not provide guarantees
![Page 9: TypeScript](https://reader036.fdocuments.net/reader036/viewer/2022082808/554f77a7b4c9052a518b4837/html5/thumbnails/9.jpg)
DemoTypeScript multi-modules application
![Page 10: TypeScript](https://reader036.fdocuments.net/reader036/viewer/2022082808/554f77a7b4c9052a518b4837/html5/thumbnails/10.jpg)
Classes and modules Scalable application structuring Classes, modules, and interfaces enable clear contracts between components
Aligned with emerging standards Classes, modules, and arrow functions syntax aligns with ECMAScript 6
proposals
Support popular modules systems CommonJS and AMD modules in any ECMAScript 3 compatible environment
![Page 11: TypeScript](https://reader036.fdocuments.net/reader036/viewer/2022082808/554f77a7b4c9052a518b4837/html5/thumbnails/11.jpg)
What’s included ? Compiler Open source, written in TypeScript
Tooling Visual Studio language service, browser hosted playground Source Maps Full support in upcoming Resharper 8.1
Libraries Full static typing of DOM, jQuery, node.js,…
And more Lots of sample and formal language specification
![Page 12: TypeScript](https://reader036.fdocuments.net/reader036/viewer/2022082808/554f77a7b4c9052a518b4837/html5/thumbnails/12.jpg)
ResourcesOfficial website
http://www.typescriptlang.org
Language specification (PDF)
http://go.microsoft.com/fwlink/?LinkId=267238
Repository for high quality TypeScript type definitions
https://github.com/borisyankov/DefinitelyTyped