chore: update Tauri ecosystem dependencies#1453
Conversation
Update Tauri, tauri-specta, and related plugin dependencies, then adapt the bindings export code for tauri-specta rc.24. Add explicit Specta wire types for ProcessInfo usage fields, update enum serde derives, and move the Result helper type out of generated bindings. Validation: - cargo check - cargo test -p hardware_visualizer enums:: - cargo test -p hardware_visualizer models::hardware::tests::serialize_usage - npm run build - npx vitest run src/hooks/useColorTheme.test.ts
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughTauri and Specta toolchain versions bumped; several Rust enums switched from manual serde impls to derive-based ChangesBindings, Serialization, and Types
Sequence Diagram(s)sequenceDiagram
participant Client as Frontend
participant Bind as Bindings (src/rspc/bindings.ts)
participant Tauri as Tauri (__TAURI_INVOKE)
participant Backend as Rust backend (src-tauri)
Client->>Bind: call commands.fetchUpdate()
Bind->>Tauri: __TAURI_INVOKE("fetch_update", ...)
Tauri->>Backend: dispatch to Rust handler
Backend-->>Tauri: return serialized payload
Tauri-->>Bind: resolve invoke promise
Bind-->>Client: return typed {status:"ok"| "error", data|error}
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
Rust Tauri Coverage ReportCoverage Details |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src-tauri/src/enums/settings.rs (1)
12-32:⚠️ Potential issue | 🟠 Major | ⚡ Quick winKeep reading legacy
"ocean"values during upgrade.Renaming the stored theme literal without a compatibility alias turns existing persisted settings into deserialization failures. Please accept
"ocean"as an alias forTheme::Sky(or migrate the stored value before reading it) so current installs keep their saved theme.Minimal compatibility fix
- "sky" => Ok(Theme::Sky), + "sky" | "ocean" => Ok(Theme::Sky),- ("\"sky\"", Theme::Sky), + ("\"sky\"", Theme::Sky), + ("\"ocean\"", Theme::Sky),As per coding guidelines,
src/**/*.{ts,tsx}: Use Tauri Store plugin viasrc/lib/tauriStore.tsandsrc/hooks/useTauriStore.tsfor persistent UI settings storage.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src-tauri/src/enums/settings.rs` around lines 12 - 32, The deserializer for Theme must accept legacy "ocean" values so old persisted settings don't fail; update the Deserialize impl for Theme (the deserialize function) to treat the lowercase string "ocean" as an alias for Theme::Sky (i.e., add a match arm mapping "ocean" => Ok(Theme::Sky)) or perform a migration step before deserialization that rewrites "ocean" to "sky" so Theme::Sky is produced; make sure to keep the to_lowercase() usage and the existing match arms intact.
🧹 Nitpick comments (1)
package.json (1)
67-74: ⚡ Quick winFinish the JS-side Tauri upgrade by bumping the CLI too.
These bumps still leave
@tauri-apps/clion^2.10.0at Line 26. Tauri’s update guide explicitly tells you to update the CLI and API together, so this PR leaves the JS toolchain one minor behind the packages it is driving. (v2.tauri.app)Suggested follow-up
- "@tauri-apps/cli": "^2.10.0", + "@tauri-apps/cli": "^2.11.0",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@package.json` around lines 67 - 74, The package.json upgrade updated many `@tauri-apps/`* packages but left "@tauri-apps/cli" at ^2.10.0; update the "@tauri-apps/cli" dependency in package.json to match the upgraded API (e.g., ^2.11.0), then reinstall dependencies (npm/yarn/pnpm) to refresh lockfiles and ensure the JS CLI and the `@tauri-apps/api/plugins` (like "@tauri-apps/api", "@tauri-apps/plugin-shell", "@tauri-apps/plugin-sql", etc.) are in sync.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/rspc/bindings.ts`:
- Around line 405-410: The typedError helper currently rethrows Error instances
(in typedError), violating its non-throwing contract; change the catch block so
it does not throw but instead returns { status: "error", error: <captured-error>
} for all exceptions (including instances of Error) so callers always receive
the error wrapper and can use isError(...) checks; ensure the returned error
preserves the original error value/stack/message (e.g., pass the caught e or a
normalized object) and remove the throw e path from typedError.
---
Outside diff comments:
In `@src-tauri/src/enums/settings.rs`:
- Around line 12-32: The deserializer for Theme must accept legacy "ocean"
values so old persisted settings don't fail; update the Deserialize impl for
Theme (the deserialize function) to treat the lowercase string "ocean" as an
alias for Theme::Sky (i.e., add a match arm mapping "ocean" => Ok(Theme::Sky))
or perform a migration step before deserialization that rewrites "ocean" to
"sky" so Theme::Sky is produced; make sure to keep the to_lowercase() usage and
the existing match arms intact.
---
Nitpick comments:
In `@package.json`:
- Around line 67-74: The package.json upgrade updated many `@tauri-apps/`*
packages but left "@tauri-apps/cli" at ^2.10.0; update the "@tauri-apps/cli"
dependency in package.json to match the upgraded API (e.g., ^2.11.0), then
reinstall dependencies (npm/yarn/pnpm) to refresh lockfiles and ensure the JS
CLI and the `@tauri-apps/api/plugins` (like "@tauri-apps/api",
"@tauri-apps/plugin-shell", "@tauri-apps/plugin-sql", etc.) are in sync.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: f4bf8a13-d836-41b7-97f9-5b5c8d995621
⛔ Files ignored due to path filters (2)
Cargo.lockis excluded by!**/*.lockpackage-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (11)
package.jsonsrc-tauri/Cargo.tomlsrc-tauri/src/enums/error.rssrc-tauri/src/enums/hardware.rssrc-tauri/src/enums/settings.rssrc-tauri/src/lib.rssrc-tauri/src/models/hardware.rssrc/features/settings/hooks/useSettingsAtom.tssrc/hooks/useColorTheme.test.tssrc/rspc/bindings.tssrc/types/result.ts
There was a problem hiding this comment.
Pull request overview
Updates the Tauri / Specta ecosystem and regenerates the frontend bindings to match tauri-specta rc.24, along with a few wire-format/type adjustments needed to keep the Rust↔TS boundary consistent.
Changes:
- Bumped Tauri-related Rust and npm dependencies and updated generated
src/rspc/bindings.tsoutput/runtime. - Moved the
Result<T, E>helper type out of generated bindings intosrc/types/result.tsand updated frontend imports. - Adjusted wire types/serde derives (notably
ProcessInfousage fields + settings enums) and aligned the theme naming used in tests/bindings.
Reviewed changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/result.ts | Defines shared Result<T,E> and helper type guards independent of generated bindings. |
| src/rspc/bindings.ts | Regenerated tauri-specta bindings + runtime helpers (commands/events/types). |
| src/hooks/useColorTheme.test.ts | Updates theme test expectations to use sky. |
| src/features/settings/hooks/useSettingsAtom.ts | Switches Result import to src/types/result.ts while continuing to use generated commands/types. |
| src-tauri/src/models/hardware.rs | Updates Specta wire types for ProcessInfo usage fields (string formatting). |
| src-tauri/src/lib.rs | Updates TS bindings export invocation for the newer tauri-specta output. |
| src-tauri/src/enums/settings.rs | Refactors settings enums to derive Serialize (and renames theme variant to Sky). |
| src-tauri/src/enums/hardware.rs | Refactors hardware enums to derive Serialize instead of manual impls. |
| src-tauri/src/enums/error.rs | Refactors backend error enum to derive Serialize instead of manual impl. |
| src-tauri/Cargo.toml | Bumps Rust-side tauri-specta/specta and plugin versions. |
| package.json | Bumps @tauri-apps/api and dialog/store plugin versions. |
| package-lock.json | Lockfile updates to reflect bumped npm dependencies. |
| Cargo.lock | Lockfile updates for bumped Rust dependencies (Tauri/Specta ecosystem and transitive deps). |
Override tauri-specta's generated typedError helper so command failures always resolve to the Result wrapper instead of rethrowing Error instances. Regenerate TypeScript bindings and keep the generated contract assertion referenced without re-enabling ts-nocheck. Validation: cargo check; npm run build
Remove Deserialize from the output-only ProcessInfo wire type so its string-formatted usage fields do not imply round-trip support. Harden the Result type guard against null and primitive inputs and add focused coverage for the helper behavior. Validation: cargo check; cargo test -p hardware_visualizer models::hardware::tests::serialize_usage; npm run build; npx vitest run src/types/result.test.ts
Summary
Update Tauri, tauri-specta, and related plugin dependencies, then adapt the bindings export code for tauri-specta rc.24.
Add explicit Specta wire types for ProcessInfo usage fields, update enum serde derives, and move the Result helper type out of generated bindings.
Validation:
Related Issues
Type of Change
fix/branch)feat/branch)refactor/branch)docs/branch)chore/branch)Screenshots / Videos
Test Plan
Checklist
npm run lint && npm run format/cargo tauri-lint && cargo tauri-fmt)npm test/cargo tauri-test)Summary by CodeRabbit
New Features
Improvements
Tests