You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.4 KiB
Markdown

+++
title = "Set up ui/Cargo.toml with Yew/Wasm dependencies (yew, yew-router, gloo, wasm-bindgen, serde, etc.)"
priority = 8
status = "todo"
ticket_type = "task"
dependencies = ["c3503b", "166996"]
+++
<context>
The `quotesdb` UI is a Yew (Rust → Wasm) single-page app compiled by Trunk and hosted on Cloudflare Pages. It communicates with the backend API via `fetch` calls. Source lives in `src/bin/ui/`. Run with `trunk serve` for local development.
</context>
<goal>
Add UI-side Yew/Wasm dependencies to `Cargo.toml` under `[target.'cfg(target_arch = "wasm32")'.dependencies]`. Resolve TRIAGE ticket 166996 (Yew version selection) first, then add: `yew`, `yew-router`, `gloo` (timers, fetch), `wasm-bindgen`, `web-sys`, `serde`, `serde_json`, and `wasm-bindgen-futures`.
</goal>
<constraints>
- Resolve TRIAGE ticket 166996 (Yew + yew-router version compatibility) before pinning versions.
- All UI dependencies must be scoped to the wasm32 target — they must not appear in host builds.
- `wasm-bindgen` version must be compatible with the `wasm-bindgen-cli` version in the Nix dev shell.
</constraints>
<skills>
Use `superpowers:verification-before-completion` — run `trunk build` to confirm WASM compilation succeeds.
</skills>
<validation>
From the `quotesdb/` directory:
```sh
cargo fmt
cargo check
trunk build
```
</validation>
<commit>
`chore(quotesdb): set up ui Cargo dependencies for Yew/Wasm`
</commit>