vitessce / vitessce

Vitessce is a visual integration tool for exploration of spatial single-cell experiments.
http://vitessce.io
MIT License
179 stars 43 forks source link

TypeScript usage #1700

Open keller-mark opened 1 year ago

keller-mark commented 1 year ago

User story

It can currently be tricky to contribute to Vitessce due to the many edge cases in which variables can be null, for example if a subset of all possible data types are available in a dataset. TypeScript can help contributors and maintainers to be more confident about new code and modifications to existing code.

Preferred solution

Incrementally convert sub-package code from JS to TS. Probably best to go in this order:

We can now use the JSDoc type annotation approach for future efforts because the @import syntax will be supported as of v5.5. Incremental type annotation can be achieved with // @ts-check comments added to the top of JS files.

### Tasks
- [ ] { "path": "examples/configs" },
- [ ] { "path": "examples/plugins" },
- [ ] { "path": "packages/config" },
- [ ] { "path": "packages/constants" },
- [x] { "path": "packages/constants-internal" },
- [ ] { "path": "packages/file-types/csv" },
- [ ] { "path": "packages/file-types/json" },
- [ ] { "path": "packages/file-types/ome-tiff" },
- [ ] { "path": "packages/file-types/zarr" },
- [ ] { "path": "packages/gl" },
- [ ] { "path": "packages/legend" },
- [x] { "path": "packages/plugins" },
- [x] { "path": "packages/schemas" },
- [ ] { "path": "packages/tooltip" },
- [ ] { "path": "packages/utils/export-utils" },
- [x] { "path": "packages/utils/other-utils" },
- [ ] { "path": "packages/utils/sets-utils" },
- [ ] { "path": "packages/utils/spatial-utils" },
- [x] { "path": "packages/utils/image-utils" },
- [x] { "path": "packages/utils/zarr-utils" },
- [ ] { "path": "packages/vega" },
- [ ] { "path": "packages/vit-s" },
- [ ] { "path": "packages/view-types/description" },
- [ ] { "path": "packages/view-types/feature-list" },
- [ ] { "path": "packages/view-types/genomic-profiles" },
- [ ] { "path": "packages/view-types/heatmap" },
- [ ] { "path": "packages/view-types/layer-controller" },
- [ ] { "path": "packages/view-types/layer-controller-beta" },
- [ ] { "path": "packages/view-types/obs-sets-manager" },
- [ ] { "path": "packages/view-types/scatterplot" },
- [ ] { "path": "packages/view-types/scatterplot-embedding" },
- [ ] { "path": "packages/view-types/scatterplot-gating" },
- [ ] { "path": "packages/view-types/spatial" },
- [ ] { "path": "packages/view-types/spatial-beta" },
- [ ] { "path": "packages/view-types/statistical-plots" },
- [ ] { "path": "packages/view-types/status" },
- [x] { "path": "packages/main/all" },
- [ ] { "path": "packages/main/dev" },
- [ ] { "path": "packages/main/prod" }
- [x] type-only package

Possible alternatives

keller-mark commented 1 year ago

Possibly need to address https://github.com/vitessce/vitessce/issues/1490 prior to some of these