typescript - your regular javascript on steroids
TRANSCRIPT
#FullStackCon 2015
“Everything that can be written in JavaScript, will eventually be written in JavaScript”
Atwood’s Law
JavaScript was originally developed for applications with a
few hundred lines of code! “Netscape”, 1995
HelloI’m Christos
christosmatskas cmatskas https://cmatskas.com
Enterprise Projects
Mobile applications
Side Projects
Javascript won the war.
Enterprise-Scale
• Refactoring• Building components• Static typing• Go to definition, renaming etc
Ratified in 2015 Long overdue Missing features Slow browser adoption
EcmaScript2015 (ES6)
Slow adoption
Compilers & Polyfils
• Babel• Traceur• TypeScript
TypeScript: A language for large scale
JavaScript development.
TypeScript: A typed superset of JavaScript that
compiles to plain JavaScript.
Any browser. Any host. Any OS.
Open SourceURL: https://
github.com/Microsoft/TypeScript
+ +
+ +
Structural typing and type inference In practice very few type annotations are
necessary
Generics Increases accuracy and expressiveness of
type system
Works with existing JavaScript libraries Declaration files can be written and
maintained separately
Types enable tooling Provide verification and assistance, but not
hard guarantees
Type SystemAn accurate static representation of JavaScript’s dynamic run-time type system
Scalable application structuring Classes, interfaces, and modules enable clear contracts in
code
Aligned with emerging standards Class and lambda syntax aligns with ECMAScript 6 proposals
Supports popular module systems CommonJS and AMD modules in any ECMAScript 3
environment
Classes, Interfaces, ModulesAn accurate static representation of JavaScript’s dynamic run-time type system
Community 827 forks, 500 feature requests, 3.5K StackOverflow
questions Now taking pull requests – 1651 Closed already
Frameworks Over 1350 .d.ts library definitions on Definitely Typed
repository covering more than 95% of popular JavaScript frameworks
Tool support IDEs: VS, Monaco, Eclipse, IntelliJ, Resharper, Sublime, Atom,
Brackets Build: Heroku, Ruby, grunt, ASP.NET, node.js, compile-in-
client Testing: Chutzpah, tsUnit
TypeScript EcosystemAn Open Source language for large scale JavaScript development.
TypeScript 1.6 (stable) available now! 1.7 (Beta) available but with breaking changes
ES7 Async…await (for ES6), Polymorphic this, etc
TypeScript 2.0 wish list Additional features, e.g. async/await for ES3 + ES5
Roadmap details https://github.com/Microsoft/TypeScript/wiki/Roadmap
TypeScript Roadmap
Demo Time!
Questions before lunch.js??????
http://typescriptlang.org
Useful Links• TypeScript – official website• ES6 compatibility table• TypeScript GitHub Repo• TypeScript Roadmap• Use TypeScript with Sublime• Use TypeScript with VS Code