Skip to content

Conversation

CedricGuillemet
Copy link
Contributor

@CedricGuillemet CedricGuillemet commented Oct 8, 2025

  • Use tsc for checks and babel to transpile to .js
  • port playground scripts to TS
  • removed leftover in build.gradle for UnitTests
  • fix 1 PG test for readonly assignement
  • Keep using UMD modules instead of ES for multiple reasons (consequent changes in babylon.js CI, 1+ minute buildtime for experience.ts, need of a bundler and size of bundles)

@CedricGuillemet CedricGuillemet changed the title ES packages + Typescript Typescript Oct 10, 2025
@CedricGuillemet CedricGuillemet marked this pull request as ready for review October 14, 2025 10:16
Copy link
Contributor

@docEdub docEdub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 lgtm

@ryantrem
Copy link
Member

I think this is a step in the right direction for sure, but I feel like moving to esm packages instead of umd packages is a big part of what would be added value. But maybe I'm thinking too much about specifically having a test app for the Viewer. I suppose I could have a totally separate .ts entry point for that though, and have that one depend on esm packages.

@CedricGuillemet
Copy link
Contributor Author

@ryantrem we can talk offline about that. Quickly, I've faced some blockers like:

  • Babylon.js ES module need to be transpiled for Chakra compatibility
  • No modularity / need bundle. experience.js becomes a 26Mb file
  • Need heavy work on Babylon.js PR CI to upload ES package snapshot to use with BabylonNative build

Copy link
Contributor

@bghgary bghgary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick first pass

"${CMAKE_CURRENT_LIST_DIR}/iOS/Base.lproj/Main.storyboard"
"${CMAKE_CURRENT_LIST_DIR}/iOS/Base.lproj/LaunchScreen.storyboard")
set(RESOURCE_FILES ${STORYBOARD} ${SCRIPTS})
set(RESOURCE_FILES ${STORYBOARD} ${SCRIPTS} ${JS_SCRIPTS})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we now have both the .ts and .js files as resources? Is that what we want?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no strong opnion on that. It was handy to quickly open produced .js thanks to project hierarchy. Also to be consistent with babylon.max.js copy.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm more worried about it being added to the final running package. The .ts are source files, so they don't belong there, right? Or maybe I missed something.

"title": "Multi cameras and output render target",
"renderCount": 2,
"playgroundId": "#BCYE7J#31",
"playgroundId": "#BCYE7J#46",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this related to the TypeScript changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. "Use strict" now makes an assignation to a read only value trigger an exception. Assignation fixed in the PG.

Copy link
Contributor

@bghgary bghgary Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. This test is from the JS side, so maybe we should update the config.json in Babylon.js also?


if (text) {
const Writer = BABYLON.MeshWriter(scene, { scale: 1.0, defaultFont: "Arial" });
// @ts-ignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No definition for MeshWriter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe put a comment after // @ts-ignore to explain why.

@bghgary
Copy link
Contributor

bghgary commented Oct 16, 2025

@ryantrem we can talk offline about that. Quickly, I've faced some blockers like:

  • Babylon.js ES module need to be transpiled for Chakra compatibility
  • No modularity / need bundle. experience.js becomes a 26Mb file
  • Need heavy work on Babylon.js PR CI to upload ES package snapshot to use with BabylonNative build

@CedricGuillemet Please include me when we talk about this offline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants