trailbase/examples/wasm-guest-js
2026-03-26 11:21:16 +01:00
..
src Stop rolling up trailbase-wasm types to avoid duplicating types per module and confusing tsc. 2026-02-19 14:51:22 +01:00
.gitignore Add TypeScript WASM guest runtime and examples. 2025-09-09 18:22:33 +02:00
eslint.config.mjs Add TypeScript WASM guest runtime and examples. 2025-09-09 18:22:33 +02:00
hot-reload.ts Add RUST_BACKTRACE=1 to example's WASM hot-reload script. 2025-12-26 08:55:56 +01:00
Makefile Add TypeScript WASM guest runtime and examples. 2025-09-09 18:22:33 +02:00
package.json Update JS dependencies. Upgrade to TS6. 2026-03-26 11:21:16 +01:00
README.md Developer experience: add a hot-reload watcher setup to TS/JS WASM examples. #161 2025-10-14 14:15:17 +02:00
vite.config.ts Add TypeScript WASM guest runtime and examples. 2025-09-09 18:22:33 +02:00

Example WASM Component

An example JavaScript WASM component for TrailBase. Feel free to copy and make it your own.

Running in Development

Assuming you have trail installed and in your $PATH, simply run

npm run dev

to start a TrailBase server with the component and a file watcher.

Whenever a file under ./src changes, the watcher will rebuild the component and send a SIGHUP ot the server to reload the component. This will typically take a few seconds.

Limitations

Adding or removing new routes will require restarting the server.