Convert packages to Typescript
Author: hydrosquallCreated Sep 8, 2024Updated Jan 31, 2026
Motivation
- Vega was written in JS before the wide adoption of Typescript (1.0 in 2014). As a result, separate
d.tsare manually created and sync'd with the type of files. Occasionally the types get out of sync with the types ( #3954 )
Proposal
We could converted some of vega sub-packages to TS. This way we won't have to sync .d.ts files with JS source code / can delete the d.ts files entirely . Many of the newer vega projects are written in typescript (including Vega-Lite).
Contraints
- We need to make sure doing this doesn't degrade the developer experience. For example
- if I change code in a linked Vega package, the Vega editor (in local dev mode) should update. (via @domoritz in https://github.com/vega/vega/issues/3957#issuecomment-2334737308 )
- Unit tests should still work
- It might be unrealistic to migrate the entire vega repository at once. We could try this a small package at a time.
Source: vega/vega