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.

32 lines
1.2 KiB
Markdown

+++
title = "[TRIAGE] NanoID crate WASM compatibility with workers-rs target"
priority = 9
status = "todo"
ticket_type = "task"
dependencies = ["f3dc74"]
+++
<context>
This is a triage decision ticket. It must be resolved before dependent implementation tickets can proceed.
</context>
<question>
NanoID crate WASM compatibility: does the chosen nanoid crate compile for wasm32-unknown-unknown with the workers-rs target? Some crates use thread-local RNG which is not available in WASM.
</question>
<options>
1. **nanoid crate** — check if it supports `getrandom` with `js` feature for WASM.
2. **uuid v4** — widely compatible, UUIDs are slightly longer than NanoIDs but universally supported.
3. **Custom NanoID** — implement NanoID generation using `getrandom` + custom alphabet. ~20 lines of code, no extra dependency.
</options>
<resolution>
1. Research the options above and choose the best approach for this project.
2. Update ticket 05f8ae (PUT /api/quotes) and `Cargo.toml` (ticket 1f5bb5) with the chosen approach.
3. Mark this ticket done with a note on the chosen approach in the body or a comment.
</resolution>
<commit>
`chore(quotesdb): resolve triage — nanoid-crate-wasm-compatibility-with-workersrs-target`
</commit>