Abstract

You’re probably doing something wrong if you write JavaScript for a living in 2017 and haven’t yet tried TypeScript. Whether you’re writing a back-end, front-end or a mobile app — and whether you’re using jQuery, React, Angular, Vue or your favourite framework-du-jour — TypeScript can significantly improve your development experience with its incredible tooling and refactoring support that can help you catch bugs as you type and bring sanity to managing large codebases.

In this session, I’ll take you through the amazing world of TypeScript’s language features and its rich out-of-the-box IDE affordances such as cross-referencing and auto-completion, experiences that developers working with traditional statically-typed languages take for granted. I’ll also show you how all the latest ES2015/16/17 features are natively available in TypeScript with a greatly simplified configuration compared to Babel’s and how you can take advantage of static typing to auto-generate a nice documentation for your project.

Outline

I’ll probably take the following route:

Give examples of how unintended bugs creep into our JS code.

Introduce the concept of ‘thinking like a compiler’ to show how most of these common mistakes arise due to misunderstanding or incomplete understanding of how the language works.

Introduce TypeScript and show how it can point out these bugs to us right inside the editor, leading on to the motivation for static-typing.

Show how easy it is to set up a TypeScript project, with some often-used settings and config.

Show how to incrementally upgrade existing projects to TypeScript.

Introduction to DefinitelyTyped (and how easy it is to submit a PR to add new definitions or fix existing ones).

Show more complete examples of static typing and editor support in some sample projects (Node and React).

Show more advanced features of TypeScript.

Demonstrate how you can use TS interfaces to follow SOLID design principles.

Also talk about some gotchas and workarounds when writing some parts of traditional JS that don’t easily map to TS.

What to expect in the TS roadmap and how it’s aligned to future ECMAScript versions.