-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add JSDoc for Box2 #29357
base: dev
Are you sure you want to change the base?
Add JSDoc for Box2 #29357
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
I think as long as we do not force contributors to have to write these I think it may be okay. But I'm afraid we'll end up having discussions about types in the repo again and that would slow us down. Are you trying to look for ways to offload the maintenance of types? |
I would expect we primarily write JSDoc to generate the English API documentation. It is a nice side effect that we can also use JSDoc to generate TS declaration files. However, the actual generation and hosting/providing should be done in a different repository and npm package ( In this way, discussions about the TS related topics happen at a different place. We can accept PRs to improve the typings in the scope of JSDoc. |
@Mugen87 is exactly right. The goal is also to make maintenance of the translated docs easier. Making it easier to create TS declaration files is not a goal, it's just a nice side-effect, so any discussion of TS types should still happen in The other option that has been discussed would be to host the types and the documentation in a different repo together (.d.ts+TSDoc), but I think this is the better split so you can ignore TypeScript altogether, just mentioning it in case you find that appealing. |
Related issue: #24984 (comment)
Description
A proof-of-concept for adding JSDoc (the .d.ts file is built by running
npm run build-types
, it wouldn't actually be committed if we go with this approach)