Why does scene have any type for Builder


Just checking in if there is a reason why Builders like createGround(...) have an any type for scene:
BABYLON | Babylon.js Documentation (babylonjs.com)

The signature is:
CreateGround(name: string, options: ...., scene: any): Mesh

It used to be Babylon.js/meshBuilder.ts at 6dff168324ff7827ffbf8b722a25b2ebc1cedc98 · BabylonJS/Babylon.js · GitHub

CreateGround(name: string, options: ..., scene: Nullable<Scene> = null): Mesh

Along with the Meshbuilder changing from a class to a var - just working through bringing a project that depends on the typings ready for 5.0.


edit: Also, not just the type itself, but it was optional before.

This is actually a pretty good question :slight_smile: @RaananW might have some clues about the change ?

1 Like

I d really bet on a typo only :wink:

It seems like it’s : any in our code! just need to change that.

Babylon.js/groundBuilder.ts at master · BabylonJS/Babylon.js (github.com)

i’ll add that to a formatting change I am pushing soon


thanks @RaananW! I don’t want to wait for next RC - so, with the switch to workspaces did we lose the gulp task to build es6 and link them automatically? i’m going through the buildSystem.md which says:

- Build the public package you want to link:
  - `npx nx build babylonjs` (when building es6 packages remove the @babylonjs prefix, i.e. `npx nx build core`)
- If using the es6 packages, run `npm run prepublishOnly -w @babylonjs/core`
- Run `npm link -w @babylonjs/core`

that’s the way to link now, yes. there are tasks to build es6 (npm run build:es6), and then you need to run the prepublish and link

you can also build the core only, using npx nx build core:build This will run all needed build tasks to build the es6 package