A small web UI for running Bevy WebAssembly applications in the browser and interacting with them through the Bevy Remote Protocol (BRP). Applications require the Bevy Remote WASM plugin.
Open the published site: https://splo.github.io/bevy-remote-playground.
You’ll land on a launcher with two options:
- Demo: this loads the bundled demo WASM app shipped in
public/wasm. - Custom: this allows to load your own app.
To load your own app:
- Ensure your Bevy application is correctly built:
- In your
Cargo.tomldependencies, includebevy_remote_wasmandbevy_remotewith default features disabled to avoid thebevy_remote/httpfeature (which doesn't build on WASM). - Add the
RemotePluginandRemoteWasmPluginplugins to your Bevy app. - Ensure the
rpc.discoverremote method is enabled, which is the case withRemotePlugin::default(). - Build your app for the
wasm32-unknown-unknowntarget. - Generate the JS bindings using
wasm-bindgen --target web(directly or via tools likewasm-packortrunk). See the docs. You'll obtain files including a.jsand a_bg.wasm.
- In your
- In the launcher page, select Custom and provide the
.jsand.wasmfiles. - If your Bevy application specifies a canvas (
WindowPlugin { primary_window: Some(Window { canvas: Some("#my-bevy-canvas".to_string()) }) }), enter it in the dedicated field. - Click Load.
This is a Vite + React + TypeScript + shadcn/ui + Tailwind web application.
Requirements:
Install dependencies:
npm installnpm run watchStarts a Vite server serving the web UI.
npm run checkThis runs TypeScript type-checking and ESLint in check-only mode.
Apply ESLint fixes:
npm run lintnpm run previewnpm run buildThis builds the web UI into a dist/ directory ready for production deployment.
Vite copies files from public/ into dist/, including the bundled demo WASM files from public/wasm.
npm run cleanUse the shadcn/ui CLI to interact with the UI component library:
npx shadcn@latest infopublic/wasm/: Bundled demo WASM assets included with the site.src/: React application entrypoint and styles.src/lib/: Canvas and BRP integration utilities.useBrp.tsdefines a somewhat reusable React function that allows to easily load the typed BRP bridge object.src/components/: Playground and launcher UI components.src/components/ui/: Reusable shadcn/ui primitives, managed by theshadcn/uiCLI.
- On pushes and pull requests, run CI check and build tasks.
- On Git tags matching
v*, builddist/, uploads it as a Pages artifact, and deploys it with GitHub Pages.
The GitHub Pages deployment workflow sets VITE_BASE_PATH from the base_path output of actions/configure-pages, and Vite reads that environment variable in its config so project-site deployments generate asset URLs under the correct repository path automatically.
Dual-licensed under Apache-2.0 and MIT. See LICENSE-APACHE and LICENSE-MIT.