deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

Typescript

Open ibgreen opened this issue 5 years ago • 5 comments

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

ibgreen avatar Mar 18 '21 22:03 ibgreen

Does this issue need help? What can I help to do?

peaceshi avatar Mar 31 '21 12:03 peaceshi

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 typescript branch
  • yarn bootstrap
  • Edit the tsconfig.json to ensure only the core module 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.

ibgreen avatar Mar 31 '21 15:03 ibgreen

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

image

So, my PR needs further tests.

peaceshi avatar Apr 08 '21 12:04 peaceshi

https://github.com/visgl/deck.gl/pull/5643 https://github.com/visgl/deck.gl/pull/5644

peaceshi avatar Apr 08 '21 12:04 peaceshi

@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.

ibgreen avatar Apr 08 '21 20:04 ibgreen