ES6 version incoming

Lots of demos and projects were made with Oimo. Please reconsider. It was the default physics engine for a LONNNNG time.

I ll try to track down the IE issue but it looks like OIMO is not compatible with IE so unfortunately it is not totally in our hand:

I would have love it to be an issue in our code :slight_smile: that would have been much easier.

I think we can hack it, right? I have already seen occurrences of BJSOimo running around (not sure what the story is, on that)… but… we can adjust Oimo however we wish, I think. Active dev on it… ended, I think.

To me, Oimo is as important for backward compat… as any other backward-compat concern we might have. @deltakosh is also trying to wash his hands of Oimo. Were things talked-about? Decisions made?

Can we see the discussion, if indeed a “Future of Oimo in BJS” discussion took place?

(sorry for screwing up the ES6 topic. perhaps we should wander-off somewhere else) :slight_smile:

Agree on a new topic for this an let see if @trevordev can fix it for IE :slight_smile:

Please keep in mind that all experiments not relying on our API are not covered by our “back compat” policy. So if you hijack something, this could be break in the future

Yeah, I understand that, even though I often forget that. :slight_smile:

Hijack code into playground… that is ONE subject… and I use it heavily for troubleshooting core issues. Don’t need to, but handy.

Now, if you mean hijacking our own version of Oimo and maybe renaming it and glue-coding it into backward compat… that is ANOTHER thing. That is a DIFFERENT kind of “hijacking” heheh

But, weirdly, Deltakosh’s comments… apply to BOTH kinds of hijacking.

How did he DO that? haha. New thread, same topic: The Future of OimoJS in BJS

Something “feels good” about BJS Inc… just blatantly “running-with” its own version of Oimo. hmm. See the new thread… for more, and to pummel Wingnut as bloody as you wish. heh

There is no back compat issue per se as OIMO seems to not be compatible with ie since at least 2 years :slight_smile:

I am looking at how to integrate support for it in the next release.

The packages are all deployed here: Babylon.js Documentation

They currently do not list their side effects so you need to create imports targetting modules and not the index files to benefit from tree shaking. we are currently hard working to list the side effects and enhance the discovery.

1 Like

Congrats, Bavs! A truly marvelous accomplishment… seriously. (hug)

@sebavan I’m getting a “ReferenceError: earcut is not defined at new PolygonMeshBuilder” any idea?

You either need to define earcut as a var in webpack or you can import earcut and pass it to the constructor of the PolygonMeshBuilder iin the 4th parameter. I ll add some part in the documentation for this today.

so either:

import * as MyEarcut from "earcut";
...
new PolygonMeshBuilder("polytri", corners, scene, MyEarcut);

or in your webpack config:

module.exports = {
    context: __dirname,
...
    plugins: [
        new webpack.ProvidePlugin({
            'earcut': 'earcut'
        })
    ]
}

@sebavan thanks a lot, found it.
the problem is that I’m using MeshBuilder.CreatePolygon which doesn’t pass the earcut parameter to `PolygonMeshBuilder.
I’ll open an issue.

btw you have a typo in the docs “Please not that you can not mix ES6 and our legacy packages.”

Finally! from 500kb gzip to 150kb gzip!
70% less!

1 Like

YEAAHHHHHH pretty happy and thanks for your feedbacks it helps a lot ensuring the full stability in 4.0 :slight_smile:

1 Like

Deployed “@babylonjs/core@4.0.0-alpha.18” and “@babylonjs/gui@^4.0.0-alpha.18” to production env already. besides the issues I already opened everything works perfectly!
major improvement in loading times, thanks. (which was one of our challenges)

1 Like

That is a GOOOD news! Thanks for reporting back!

Typo fixed and 19 is out. the earcut injection is here Allow earcut injection through meshbuilder methods · BabylonJS/Babylon.js@3e27bcb · GitHub and will be available in alpha 20

1 Like

I’ve tested the new alpha in both angular and react, and all typings work out of the box, and the bundle size is way down, so awesome job with the modernization :slight_smile:

1 Like

Sweet, thanks for sharing :slight_smile: