Typescript
Target Use case
- deck.gl exports typescript types, enabling
Proposed feature
- Start by adding a tsconfig and install typescript
- Make deck.gl JS code base pass ts linter.
- Start adding types (either as
d.ts(or if tooling improvement allow move to.ts, otherwise we can ts-smooch later) - Initial focus is on adding types for exported symbols
- Gradually add types for internal symbols
To Do List
- [ ] Add label and assign to milestone
- [ ] Coding
- [ ] Doc update
- [ ] What’s new update
- [ ] Test
Does this issue need help? What can I help to do?
At this time, as the first step, we just need to make sure at least the core module passes the typescript linter. Once that is done, I suspect things will start happening.
If you wanted to help with that:
- check out the
typescriptbranch -
yarn bootstrap - Edit the
tsconfig.jsonto ensure only thecoremodule is included - Start fixing the ~80-100 errors reported by
npx tsc - At this stage you can't yet use TS syntax, the errors needs to be fixed using JS changes and JSDoc types.
If you do decide to help with this please make smaller PRs with a limited number of changes in each PR.
The yarn test node makes me confused with WSL2.
Even run glxgears pretty well, but also get error message:
canvas.width = gl.drawingBufferWidth;
^
TypeError: Cannot read property 'drawingBufferWidth' of null

So, my PR needs further tests.
https://github.com/visgl/deck.gl/pull/5643 https://github.com/visgl/deck.gl/pull/5644
@peaceshi Thanks for starting this. Are you on the deck.gl slack? (link in deck.gl docs)...
I can add you to the typescript channel there.