WhoBuilt

Is Typescript our Future?

Oct 8, 2019· 14 min· 1.7K views·Watch on YouTube

Speaker

Radek Czemerys, a React Native developer and open-source contributor at Callstack, shares his experience with TypeScript at React Native EU 2019 in his hometown.

Why TypeScript helps

Czemerys describes starting with little TypeScript experience before his team adopted it for a new module and eventually rewrote their code in it. He says optional static types can catch mistakes such as incorrect function arguments and misspelled names, and that teams can add types gradually.

Everyday tooling and shared types

In Visual Studio Code, autocomplete, error feedback, navigation, and automatic imports help him work without repeatedly checking documentation. He demonstrates using TypeScript’s `ReturnType` utility in a Redux app to derive component props from a selector, keeping types aligned as code changes.

Costs and the Flow comparison

TypeScript can add too much overhead to a small project, and migrating a large codebase takes time. Czemerys says complex type errors involving third-party libraries can be hard to diagnose, while Flow offers easier integration and, in his experience, stronger initial type inference. He also recalls Flow upgrades causing breaking changes and third-party library fixes.

Starting or migrating a project

For new React Native projects, Czemerys recommends a community template and TypeScript ESLint, with the compiler’s `noEmit` option to check types across the app in CI or locally. For migration, he describes converting modules gradually when business logic and UI are separated, and favors a fast, broad rewrite to avoid maintaining two type systems.

When TypeScript fits

Czemerys sees TypeScript as a useful choice for some companies, especially those with large codebases and teams. He points to its community-maintained library typings and day-to-day tooling as its main strengths.

Takeaways

  • Start adding TypeScript incrementally when a team already knows JavaScript.
  • Large teams can use shared types to make refactoring and unfamiliar code easier to navigate.
  • Derive component props from selectors or functions to reduce duplicated type definitions.
  • Run the TypeScript compiler across the whole project in CI; editor feedback alone may not cover every file.
  • Before migrating, weigh ongoing tooling and complex-type maintenance against the benefits for your codebase.

Mentioned in this talk

Search inside this talk

What was claimed 10

  • feature
    Callstack: Enabled Radek Czemerys to get started with React Native
    “the company that enabled me to get started with React Native”
    YouTube
    Unverified1 source· Talk
  • feature
    Callstack: Organized React Native EU 2019
    “it’s organized by Callstack”
    YouTube
    Unverified1 source· Talk
  • feature
    TypeScript: Compiler checks types and can identify common errors
    “These types are checked by the TypeScript compiler, which can show us common errors”
    YouTube
    Unverified1 source· Talk
  • feature
    TypeScript: Adds optional static types to JavaScript
    “It builds on the JavaScript foundation by adding optional static types.”
    YouTube
    Unverified1 source· Talk
  • feature
    TypeScript: Parses JSDoc comments to add types to JavaScript code
    “TypeScript can parse JSDoc and add types from those comments”
    YouTube
    Unverified1 source· Talk
  • feature
    VS Code: provides first-class TypeScript support, including autocomplete and hints
    provides first-class TypeScript support, including autocomplete and hints
    “Visual Studio Code, which has first-class support for TypeScript”
    YouTube
    Unverified1 source· Talk
  • feature
    VS Code: Suggests and adds missing imports while coding
    “it suggests and adds imports that are missing from the file”
    YouTube
    Unverified1 source· Talk
  • feature
    React Native: TypeScript support is community maintained rather than official
    TypeScript support is community maintained rather than official
    “React Native still doesn’t have official TypeScript support; it’s community maintained.”
    YouTube
    Unverified1 source· Talk
Show all 10 facts

Related talks