This is a significant departure from the previous version released and is the shape of what I imagine will eventually be the official release of this port.
A few things of note:
- This is compiled with and relies on Emscripten's pthreads. This severely restricts which browsers will run this project but it's necessary to support Love's full range of features; not just Lua threads but also media decoding. It also means that this project cannot be compiled to Web Assembly yet. But fixes for these problems are just a matter of time. If you have an up-to-date browser you likely already have support for SharedArrayBuffers behind a flag and so you can run the multithreaded code even if it's still experimental.
- Errors should properly propagate to the Love error screen now. A long-time frustration of users of the previous version was that errors just killed the process (sometimes without so much as an error message). This fix is brought to us by some in-progress work to reconcile native and browser main loops. Screenshot: https://love2d.org/imgmirrur/Z5EvLBq.png
- We now make much more effective use of the cmake build files. This includes not using the emscripten ports repositories to ensure dependencies are the same across platforms and compile SDL2 with pthreads support. This was, pleasantly, not as big an undertaking as I thought it might be.
- The project is modularized which means that you can run more than one instance on a page. See the provided index.html pages for examples.