What problem does this solve or what need does it fill?
I want to turn a bevy app canvas into an npm package and use it as a typed React component, e.g.
npm install @nuzzles/my-game@ae3b1d31d699e62249cead029b0e10f37a9ed9ac
Usage:
import { useBevyApp } from '@nuzzles/my-game@ae3b1d31d699e62249cead029b0e10f37a9ed9ac';
const [wasmHandle, wasmBindings, loading, error] = useBevyApp();
# Examples:
# - Do something on load finish (callback)
# - Use multiple game canvases on a single page
# - Use any binding output via wasm_bindgen
What solution would you like?
I would like to build a complete npm package that includes lexically-scoped typed bindings and handling of the bevy app load. This way, updating my game is as simple as updating my npm package.
There are a few problems that make this very complex:
What alternative(s) have you considered?
There really is none.
What problem does this solve or what need does it fill?
I want to turn a bevy app canvas into an npm package and use it as a typed React component, e.g.
Usage:
What solution would you like?
I would like to build a complete npm package that includes lexically-scoped typed bindings and handling of the bevy app load. This way, updating my game is as simple as updating my npm package.
There are a few problems that make this very complex:
.tsbindings for an npm packageconst app = app.init();works, but initializing a second app would overwrite state from the first initialization. See Instance-Scoped Runtime (No Global State) wasm-bindgen/wasm-bindgen#4888What alternative(s) have you considered?
There really is none.