Moving to TypeScript
- Dominant language
- Rust
- Stars
- 20.8k
- Forks
- 2.1k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 181
Description
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
- [x] cubejs-cli
#### Frontend packages
- [ ] cubejs-client-core
- [x] cubejs-client-ngx
- [ ] cubejs-client-react
- [ ] cubejs-client-vue
- [x] cubejs-client-ws-transport (https://github.com/cube-js/cube.js/pull/1293)
#### Backend packages (base only)
- [x] cubejs-api-gateway (https://github.com/cube-js/cube.js/pull/1474)
- [X] cubejs-query-orchestrator (https://github.com/cube-js/cube.js/pull/1092)
- [x] cubejs-schema-compiler
- [x] cubejs-server-core
- [X] cubejs-server
- [ ] cubejs-serverless
- [ ] cubejs-serverless-aws
- [ ] cubejs-serverless-google
#### Drivers
- [x] cubejs-athena-driver
- [x] cubejs-bigquery-driver (https://github.com/cube-js/cube.js/pull/2818)
- [x] cubejs-cubestore-driver
- [ ] cubejs-dremio-driver
- [x] cubejs-druid-driver (new one, fully on TS) (https://github.com/cube-js/cube.js/pull/1099)
- [ ] cubejs-elasticsearch-driver
- [ ] cubejs-hive-driver
- [x] cubejs-jdbc-driver (blocked, fully outdated)
- [x] cubejs-mongobi-driver
- [ ] cubejs-mssql-driver
- [x] cubejs-mysql-driver
- [ ] cubejs-oracle-driver
- [x] cubejs-postgres-driver
- [x] cubejs-prestodb-driver
- [ ] cubejs-sqlite-driver
- [X] cubejs-snowflake-driver
## Non code
- [x] ESLint (support typescript)
- [ ] Docs (a little bit of examples, how to debug?)
- [ ] Tests
Thanks
Contributor guide
Assessment
This issue has not been assessed yet.