Skip to content

Moving to TypeScript #1091

Open
@ovr

Description

@ovr

Hey!

In 2020 TypeScript started to be a standard (exclude flow in fb internals 😄 ) for every project, It helps use to:

  • Speedup development (autocompletion, easy to know how to implement drivers by interfaces/abstract classes)
  • Protect errors
  • Generate true compatibility code for matrix of compatibility versions of Node.JS platform

Before We start

  1. Performance should not be affected
  2. BC should be done as deprecated notice, next code removal
  3. Dont break exists typings if they provided (merge to interfaces?)

High level iteration plan:

Scope

Due to the fact, that cube.js is not a small project, it's expected to have a plan, How to move it to TypeScript.

It's not possible to move module with dependency on another module that doesn't have typings. It's why dependency tree is useful to detect "core" modules.

Guide

  1. Generate declarations for every package automatically (1-2 base packages, it's needed to write driver on TypeScript)
  2. Introduce first driver fully on top of TS
  3. Move packages from 1st step to TS
  4. Move all packages to TS

Scope

Isolated packages

  • cubejs-cli

Frontend packages

Backend packages (base only)

Drivers

Non code

  • ESLint (support typescript)
  • Docs (a little bit of examples, how to debug?)
  • Tests

Thanks

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions