docs: document server-only optional dependencies in AGENTS.md
Some checks failed
CI / check (push) Failing after 5m15s
CI / build (push) Has been skipped

This commit is contained in:
xfy 2026-06-16 17:32:04 +08:00
parent 1a56c0cd3f
commit 7d713cabc2

View File

@ -73,6 +73,8 @@ Dioxus 0.7 fullstack project with **two independent gates** — the most common
**Server-only helpers**: `src/auth/password.rs`, `src/auth/session.rs`, `src/api/auth.rs`, `src/api/comments/helpers.rs`, and several model helper methods are gated with `#[cfg(feature = "server")]` because they are only called from server function bodies, which are stripped in WASM builds.
**Server-only dependencies**: Crates that are only used behind `#[cfg(feature = "server")]` (e.g., `argon2`, `uuid`, `regex`, `pulldown-cmark`, `rand`, `http`, `sha2`, `hex`, plus the pre-existing optional server stack) are declared as `optional = true` in `Cargo.toml` and enabled only through the `server` feature. They are not compiled into the WASM frontend.
## Dual API Architecture
The server exposes two distinct API patterns: