Skip to content

Instantly share code, notes, and snippets.

@chrisfinch
Last active July 14, 2017 10:21
Show Gist options
  • Save chrisfinch/309f6331b32de046084e453420895088 to your computer and use it in GitHub Desktop.
Save chrisfinch/309f6331b32de046084e453420895088 to your computer and use it in GitHub Desktop.

Typescript

Install

  • npm install -g typescript
  • ST2
  • Atom

Basics

  • Typed Javascript
  • Introduces static typing
  • Extensions: .ts, .tsx
  • Compiles to .js
  • Controlled via settings in tsconfig.json
  • Accepts standard javscript
  • When typings are added typescript will highlight errors on the fly and provide autocompletion

Compile pipeline in di2

*.ts (TS) => Typescript Compiler => *.js (ES2017) => Babel => *.js (ES5) => Webpack => *.bundle.js (Final ES5 bundle for use in browser)

Starter tutorial

Tutorial

Usage with react

here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment