2 ms·
If you really need a DOM based UI I would write a hybrid application, do the UI completely on the JS side via the DOM, and the logic on the WASM side, with a mi
by flohofwoe 1y ago
If you really need a DOM based UI I would write a hybrid application, do the UI completely on the JS side via the DOM, and the logic on the WASM side, with a minimal interface to communicate between the two and which doesn't need tons of roundtrips each frame.
Games often need to do at least some DOM work though, like rendering a login dialog or integrating a 3rd party in-app-payment solution (or the obvious one: displaying ads). For this I would also do most work on the JS side.
With Emscripten, such mixed JS/WASM apps are really not that hard, you can even embed JS code snippets right into the C/C++ code.