Babylon development: ES version, Typescript version, in-file documentation format?

Which runtime environment should I target? Is ES2022 supported by Babylon source code, build tools, and developers? Do I need to target only ES6?

Eventually, I’ll convert to TypeScript. What TypeScript version is used?

I’m beginning to convert my javascript classes to enable integration into Babylon source. I’m using private class fields with hashtags (“#”) preceding the field name. I discovered this is an ES2022 feature, and ES6 does not support private class fields.

Finally, I’m currently trying to document within my Javascript files with JSdoc. What in-file documentation format is used by Babylon build tools? I’ve seen (elsewhere) references to TypeDoc, TSDoc, and others.

I think you should get most of your answers from here:
Contributing to Babylon.js | Babylon.js Documentation (babylonjs.com)

Versions:
Babylon.js/package.json at master · BabylonJS/Babylon.js (github.com)

1 Like

Thank you. From your link, I was able to determine what I need for now:

tsconfig.build.json:

  • “target”: “es2021”, // esnext has an issue with class generation and our decoders. TODO - avoid using decorators until in standard

TypeDoc reference:

  • “test:docs”: “node ./scripts/typedoc-generator.js”

So I can get started converting to TypeScript using TypeDoc and compiling to JavaScript with:

  • tsc -t es2021 PhysicsDebug.ts
2 Likes