Frontend And Webview Model

Tauri is frontend-agnostic, but it is not frontend-magic. The safest default is a static Vite app loaded into a system webview.

Frontend Choices

FrontendFit
React plus ViteGood lab default because existing React skills transfer
Svelte plus ViteGood for small desktop UIs with less runtime code
Vue plus ViteGood if the team already prefers Vue
Solid plus ViteGood for small reactive UIs and low overhead
Plain TypeScriptGood for utilities and small control panels
Leptos/TrunkUseful for Rust-heavy teams, but adds a different frontend learning curve
SSR meta-frameworkUse only in static output or explicitly supported client-server mode

Static Output Rule

build.frontendDist should point at static assets produced by your frontend build. Do not assume a Node server runs inside the desktop app.

{
  "build": {
    "frontendDist": "../dist",
    "devUrl": "http://localhost:1420",
    "beforeDevCommand": "npm run dev",
    "beforeBuildCommand": "npm run build"
  }
}

Webview Backends

PlatformWebviewPractical effect
WindowsMicrosoft Edge WebView2Runtime install/update choice is part of release planning
macOS/iOSWKWebViewSafari/WebKit behavior affects CSS, APIs, and automation
LinuxWebKitGTKDistro packages and WebKitGTK versions affect runtime behavior
AndroidAndroid WebViewDevice WebView version and low-end devices matter

Renderer Testing

Use frontend tests for UI logic and mocked IPC. Use WebDriver or release smoke tests for behavior that depends on the real shell, platform webview, menus, dialogs, files, sidecars, or installer.

Practical Constraints

  • Keep raw invoke calls in a small wrapper module.
  • Keep secrets out of frontend state and local storage.
  • Avoid broad CSP relaxations such as release-only unsafe-eval unless you can justify them.
  • Test CSS and browser APIs on each target webview, not only in Chrome.
  • For mobile dev, expect extra network/dev-server setup because the device or emulator must reach the dev server.