This adds support for wasm, there is an extra build with suffix .wasm.js. It's noticeably faster and smaller.
To support wasm, we need async startup. That means that instead of just using the code, we need to wait until it is ready, using something like this,
Box2D().then(function(Box2D) {
..you can use Box2D here..
});
..but you cannot use it here..
This is like the Promise stuff that is common in JS today, so hopefully it's not too confusing, but it is an API change. Ideas on how to make this transition easier for people?
This adds support for wasm, there is an extra build with suffix
.wasm.js
. It's noticeably faster and smaller.To support wasm, we need async startup. That means that instead of just using the code, we need to wait until it is ready, using something like this,
This is like the Promise stuff that is common in JS today, so hopefully it's not too confusing, but it is an API change. Ideas on how to make this transition easier for people?
Issues: the wasm build has js + a wasm file on the side. That has some downsides, see https://github.com/kripken/emscripten/issues/5104