O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Introducing type script

1.821 visualizações

Publicada em

Large scale JavaScript application development made easy.

Publicada em: Software
  • Seja o primeiro a comentar

Introducing type script

  1. 1. Introducing TypeScript Large scale JavaScript application development made easy By Remo H. Jansen
  2. 2. 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...).
  3. 3. JavaScript is TypeScript! “We’re excited to announce that we have converged the TypeScript and AtScript languages, and that Angular 2, the next version of the popular JavaScript library for building web sites and web apps, will be developed with TypeScript”
  4. 4. Why do we need TypeScript? (PART I) “As a system evolves, its complexity increases unless steps are taken to reduce it” JavaScript was not designed to deal with the level of complexity required to meet today’s needs.
  5. 5. Complex !== Complicated Complicated 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.
  6. 6. TypeScript is the future of JavaScript TypeScript allows us to use ES6 and ES7 today! We can use the --target compiler option to specify ECMAScript target version: ES3, ES5 or ES6.
  7. 7. Classes
  8. 8. Inheritance
  9. 9. Modules We can use the --module compiler option to specify module code generation: CommonJS AMD System UMD
  10. 10. Generators “Synchronous Looking Asynchronous Code”
  11. 11. Async / Await
  12. 12. 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
  13. 13. Why do we need TypeScript? (PART II) “Large codebases are more difficult to maintain when they are written in dynamic languages”
  14. 14. TypeScript goes beyond ES6 & ES7 TypeScript is a strongly typed programming language TypeScript introduces some great design-time features that are not available in ES6 or ES7.
  15. 15. Namespaces ● AKA Internal modules ● It is recommended to use ES6 modules instead
  16. 16. Types ● Design-time only ● Type inference ● Optional type annotations ● Type guards ● Union types ● Intersection types
  17. 17. Interfaces ● Design-time only ● Structural type system ● Type definitions (.d.ts files)
  18. 18. Generics ● Design-time only ● Generic constraints can be declared
  19. 19. Getting started with TypeScript! http://www.typesc riptlang.org/Playgr ound https://github.com /remojansen/ts- vscode-boilerplate
  20. 20. Questions?
  21. 21. 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

×