Overview#
Build and run the Zylix counter app in your browser using WebAssembly.
Prerequisites#
- Zig 0.15+
- A modern browser
1. Clone the Repo#
git clone https://github.com/kotsutsumi/zylix.git
cd zylix2. Build the Web Sample#
cd samples/counter-wasm
./build.shThis builds samples/counter-wasm/zylix.wasm and uses samples/counter-wasm/zylix.js as the JS bridge.
3. Run the Sample#
python3 -m http.server 8080
# Open http://localhost:80804. Confirm State Updates#
Click the + and - buttons. The counter value updates through Zylix state and events.
Key files:
samples/counter-wasm/index.html(UI shell)samples/counter-wasm/zylix.js(WASM bridge)
Troubleshooting#
- WASM fails to load: rerun
./build.shand confirmzylix.wasmexists. - Blank page: use an HTTP server, not
file://.