-
Notifications
You must be signed in to change notification settings - Fork 0
how to contribute patterns and conventions
Load Rift keeps the frontend and backend contract explicit. React hooks call a typed API, the Tauri adapter maps that API to command names, and Rust commands return serde models in camelCase.
| TypeScript | Rust | Notes |
|---|---|---|
src/lib/loadrift/types.ts |
src-tauri/src/models.rs |
Shared payload shapes and status enums |
src/lib/loadrift/api.ts |
src-tauri/src/lib.rs |
Frontend API methods and registered commands |
src/lib/loadrift/api.ts |
src-tauri/src/events.rs |
Event names and event payloads |
Rust models in src-tauri/src/models.rs use #[serde(rename_all = "camelCase")], which matches the TypeScript fields in src/lib/loadrift/types.ts.
The backend stores process state in AppState in src-tauri/src/state.rs. test_is_busy treats both an active process and an in-progress launch as busy, so imports, starts, validation, and smoke tests can reject unsafe transitions.
src/app/persistence.ts catches storage failures and normalizes stored values before using them. Runner preferences persist common non-secret settings such as VUs, duration, thresholds, traffic mode, and request weights. Auth token, base URL, advanced JSON, and variable overrides are not part of persisted runner preferences.
src-tauri/src/k6/process/runtime.rs writes private per-run temp directories and uses marker files before cleanup. Startup cleanup only removes stale marker-owned artifact directories after conservative shape and liveness checks.
For how these patterns appear in API calls, see Tauri commands.