Skip to content
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

Make SceneLoader module level functions PascalCase and add GetRegisteredSceneLoaderPluginMetadata #16154

Merged
merged 6 commits into from
Feb 7, 2025

Conversation

ryantrem
Copy link
Member

@ryantrem ryantrem commented Feb 6, 2025

  • To make the SceneLoader module more consistent with the rest of the API, I am updating the module level functions to be PascalCase. The camalCase ones are marked as deprecated, and the new PascalCase ones are not marked as experimental.
  • Also marking the SceneLoader class as deprecated, suggesting using the module level functions instead.
  • Exposing a new function GetRegisteredSceneLoaderPluginMetadata to get the metadata of the registered SceneLoader plugins. I want to use this for tooling like Sandbox so it doesn't have to hardcode a list of supported extensions. This adds no state, so it should have zero bundle impact for consumers that don't use it.

@ryantrem ryantrem enabled auto-merge (squash) February 6, 2025 20:19
@bjsplat
Copy link
Collaborator

bjsplat commented Feb 6, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 6, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 6, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 6, 2025

Copy link
Member

@sebavan sebavan left a comment

Choose a reason for hiding this comment

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

Not sure of the rename for case only but not against it either :-)

packages/dev/core/src/Loading/sceneLoader.ts Outdated Show resolved Hide resolved
@ryantrem
Copy link
Member Author

ryantrem commented Feb 6, 2025

Not sure of the rename for case only but not against it either :-)

Since in recent discussions there was agreement to use PascalCase as the standard for module level functions, I thought it was worth fixing, especially since they are marked as @experimental. But I'm fine either way. @RaananW, @deltakosh, do you have an opinion on this one?

@sebavan
Copy link
Member

sebavan commented Feb 6, 2025

Not sure of the rename for case only but not against it either :-)

Since in recent discussions there was agreement to use PascalCase as the standard for module level functions, I thought it was worth fixing, especially since they are marked as @experimental. But I'm fine either way. @RaananW, @deltakosh, do you have an opinion on this one?

If they were experimental, I guess we could rename and mark as breaking change ?

@ryantrem
Copy link
Member Author

ryantrem commented Feb 6, 2025

Not sure of the rename for case only but not against it either :-)

Since in recent discussions there was agreement to use PascalCase as the standard for module level functions, I thought it was worth fixing, especially since they are marked as @experimental. But I'm fine either way. @RaananW, @deltakosh, do you have an opinion on this one?

If they were experimental, I guess we could rename and mark as breaking change ?

Yes, this is an option as well. I went this way because the old camalCase calls the new PascalCase ones, which means it has zero impact on bundle size for anyone using the new PascalCase ones. So it seems like "cheap" back compat that maybe avoids any community frustration. That said, it also pollutes intellisense a bit when you do the import (since you will see both the camalCase and PascalCase).

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 6, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 6, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 6, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 6, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 6, 2025

@ryantrem ryantrem merged commit 42dcaa2 into BabylonJS:master Feb 7, 2025
15 checks passed
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