three-stdlib icon indicating copy to clipboard operation
three-stdlib copied to clipboard

Question: How to manage discrepancies with three types?

Open CodyJasonBennett opened this issue 4 years ago • 2 comments

I'm noticing that these modules pull from @types/three, currently maintained parallel with three.

My concern is managing discrepancies between this repository and three's and keeping the shared types in sync.

To circumvent this, I see two options, although exhaustive:

  • track and mirror changes in three, likely via bot magic (or vice versa)
  • add self-contained types/doc to the repository

What are your thoughts on this? Is there something internal going on that makes this a non-issue?

CodyJasonBennett avatar Feb 27 '21 04:02 CodyJasonBennett

From what I understand, the repo won't work with @types/three when people import this, three and the type library into their project, because @types/three maps to three.

So ideally this library needs to be brought over to TS or have it's own .d.ts files (which @giulioz is working on currently ⭐), in the meantime depending on the urgency these could be imported & then exported from @types/three? As I can see the fixes we do in this library causing divergence from three.

joshuaellis avatar Feb 27 '21 10:02 joshuaellis

right, translating the js files to ts is probably best. simple annotation-like types hopefully as this isn't an interlinked library but simple little interfaces, so it should be quite minimal.

drcmda avatar Feb 27 '21 11:02 drcmda

I've vendored types and manually fixed and upgraded modules for r128 to latest just now.

CodyJasonBennett avatar May 26 '23 20:05 CodyJasonBennett