Potential new breaking change - Please chime in!

Hey team! I would like to test the water with you all.

I’m about to merge this: Adding support to mimetype autodetection by deltakosh · Pull Request #15798 · BabylonJS/Babylon.js

In a nutshell, the breaking change is required so we can detect url mimetypes and auto select which plugin to use to load it.

To get there we need to move our loading code path to a fully async approach.
This is not far fetched as all the code is already based either on promise or callbacks.

The problem is that some functions (namely SceneLoader.Load, SceneLoader.Append, SceneLoader.ImportMesh) will not return the plugin that was used to load them.

So my question is: Do you see that as a big problem?

  • yes that will break my code
  • no it is totally fine
0 voters

To avoid that issue and if you need to know which plugin was used you can rely on SceneLoader.OnPluginActivatedObservable

I’m the only one that says that will break my code XD.

What about in the cases where you need a reference to the loader to add observable to OnPluginActivatedObservable and things? That is the only thing I can think of.

The observable is a static on SceneLoader so you can access it any time :slight_smile:
can you elaborate why it will break your code?

Will that still return the plugin then so stuff like this should still be ok:


If so then I can change my vote lol!

1 Like

yeah no change on that :slight_smile:
just the 3 functions I mentioned which used to return the plugin will not anymore

1 Like

it’s a breaking change in react-babylonjs. No objections though - It’s easy for me to fix - I can undo that I get the plugin name from ImportMesh without async.

Maybe just my opinion only, but I would make the async not need a callback for onSuccess/onError.

Like the params being optional? I like that
Wanna PR it?

I’ll merge in 20mins based on the poll results :wink:

I checked and the callbacks are already optionals on the async functions

1 Like

If the new method can provide better support, we only need to make some code changes, which will not have a significant impact on us

If you replace Append → AppendAsync nothing happens: https://playground.babylonjs.com/#GC63G5#95 :open_mouth:

Because this is how to do it:
Basic PluginMaterial example | Babylon.js Playground

:slight_smile:

1 Like