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

WebAssembly support, and new async API #85

Merged
merged 8 commits into from
Apr 9, 2017
Merged

WebAssembly support, and new async API #85

merged 8 commits into from
Apr 9, 2017

Conversation

kripken
Copy link
Owner

@kripken kripken commented Apr 4, 2017

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?

Issues: the wasm build has js + a wasm file on the side. That has some downsides, see emscripten-core/emscripten#5104

@kripken kripken merged commit f63d40a into master Apr 9, 2017
@kripken kripken deleted the wasm branch April 9, 2017 21:29
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.

1 participant