CDN hosted wasm files

Hi,

It would be great if there was an NPM package that contained all the wasm files used by babylon. My reasoning is, our clients generally don’t want anything loaded from an external CDN. Currently when using basis universal for example, it has to load the loader wasm and js file from the CDN. I’m aware that I can download those files and configure the URL, but some clients dig into the code searching for external servers (even though they’re not being used, they’ll be flagged which is fair).

Out of curiosity, what’s the reasoning for loading these files from a CDN instead of including it in the package.

1 Like

cc @RaananW

Oh, I totally support this notion :slight_smile:

There is a few reasons behind the way we currently work with external packages. The main one is - Babylon is ca. 10 years old. Back then, it was very acceptable to use CDN delivery for external libraries. Not a lot were using packages (heck, we used bower and browserify!!!). To make sure babylon works without forcing the developer to downloading or delivering libraries themselves, we have made the decision to integrate it in the library. And since babylon is backwards compatible, we will continue serving these. At least in our current packages.

NPM packages fit more nowadays, I agree. And I will be happy to look into that. Don’t forget that every external library has its own OS license, and we can’t just redistribute the libs without making sure we are not violating the license. And as we have quite a few external dependencies (all optional, but still), we will need to see how we do that correctly. TWGSL, Ammo, Cannon, (Oimo?), Recast, Basis, earcut, All of those are external dependencies that we will need to distribute if we want to avoid CDN loads. I will add it to the ESM work (which just grows bigger and bigger).

I keep myself assigned :slight_smile:

2 Likes

You can keep track here - [Build] Release all CDN-related packages as npm packages · Issue #12783 · BabylonJS/Babylon.js (github.com)

1 Like

Thanks!

1 Like

I’ve ran into this as well on projects. The companies (larger tends to care more in our case) want the projects fully on their servers for security reasons. This makes a lot of sense to me. Thanks for moving this forward.