TypeScript · Flow vs TypeScript: go.ably.io/typescript-vs-flow Progressive Migration Setup TypeScript configuration Convert files that have most active development Use of a designated

Post on 11-Jul-2020

20 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

Transcript

TypeScriptInternational JavaScript Conference

April 2018

@Srushtika | Ably Realtime | iJS | 2018

Hi!I’m Srushtika

@Srushtika

n.srushtika@gmail.com

Developer Advocate

TypeScript

Why?@Srushtika | Ably Realtime | iJS | 2018

JAVASCRIPTHipster much?

@Srushtika | Ably Realtime | iJS | 2018

In a regular project cycle

Write new code Write new codeDocument Maintain

@Srushtika | Ably Realtime | iJS | 2018

In a regular project cycle

Write new code Write new code

Document Maintain

@Srushtika | Ably Realtime | iJS | 2018

TypeScript

What?@Srushtika | Ably Realtime | iJS | 2018

@Srushtika | Ably Realtime | iJS | 2018

@Srushtika | Ably Realtime | iJS | 2018

TypeScript

How?@Srushtika | Ably Realtime | iJS | 2018

Types

@Srushtika | Ably Realtime | iJS | 2018

Interfaces

@Srushtika | Ably Realtime | iJS | 2018

Classes & OOP

@Srushtika | Ably Realtime | iJS | 2018

Migrating to TypeScript?

Here’s how we did it at Ably

@Srushtika | Ably Realtime | iJS | 2018

Understanding the problem

Realization

● Explosive growth in codebase

● Growth in the development team

● Long onboarding time

● Long and complex refactoring of existing code

Research

Flow vs TypeScript:

go.ably.io/typescript-vs-flow

Progressive Migration

● Setup TypeScript configuration

● Convert files that have most active development

● Use of a designated procedure to convert each file

@Srushtika | Ably Realtime | iJS | 2018

Migration Steps

@Srushtika | Ably Realtime | iJS | 2018

Refactoring and Documentation

@Srushtika | Ably Realtime | iJS | 2018

Tips & Tricks

@Srushtika | Ably Realtime | iJS | 2018

noImplicityAny

@Srushtika | Ably Realtime | iJS | 2018

Object vs any

@Srushtika | Ably Realtime | iJS | 2018

Function overloading

@Srushtika | Ably Realtime | iJS | 2018

Function return types

@Srushtika | Ably Realtime | iJS | 2018

const variables and types? Really?

@Srushtika | Ably Realtime | iJS | 2018

Interfaces with Classes

@Srushtika | Ably Realtime | iJS | 2018

John Diamondhttps://github.com/jdmnd

Thankyou!

@Srushtika | Ably Realtime | iJS | 2018

top related