-
Notifications
You must be signed in to change notification settings - Fork 279
feat: migrate from Electron to Tauri v2 #2479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Pretty cool, nice work @afonsojramos I'll need some time to review a PR of this size... I'm on the fence re the amount of Rust code tbh. Shall we mark this PR as draft in the interim? |
Thanks @setchy! Happy to mark this as draft while you (or anyone else) review. Regarding Rust code - it's kept to the minimum needed for Tauri (tray management, window positioning, clipboard, keyboard shortcuts). The core business logic remains in TypeScript. Most Rust is just wiring Tauri plugins together. Happy to discuss specific parts if anything seems redundant. As for Electron vs Tauri, I think that Electron makes sense for apps that need a full browser (Slack, VS Code, Discord), but Gitify is a focused, lightweight utility that ends up:
Tauri gives us exactly what we need without the bloat (which is considerable - I do sometimes run out of memory on my machine, unfortunately). This results in a 4-5x reduction in memory and binary size, which is considerable. |
This is a complete migration of Gitify from Electron to Tauri v2. Changes include: - Remove Electron main/preload processes and webpack configs - Add Tauri v2 backend with Rust (src-tauri/) - Add Vite bundler configuration - Migrate renderer code from src/renderer/ to src/ - Migrate tests from Jest to Vitest - Update all dependencies for Tauri compatibility - Add type-safe context hook (useAppContext) - Fix strict TypeScript mode issues BREAKING CHANGE: This replaces the Electron backend with Tauri.
- Update test snapshots for vitest migration - Fix Tailwind config path from ../../ to ../ - Skip flaky nock replyWithError tests
- Replace @tailwindcss/postcss with @tailwindcss/vite - Remove postcss.config.js - Update vite.config.ts with tailwindcss plugin - Remove @config directive from App.css (Vite plugin reads config automatically)
Add tauri-plugin-http to bypass WebView CORS restrictions when making API requests to GitHub. This fixes the PAT login network error. - Add tauri-plugin-http to Cargo dependencies - Initialize HTTP plugin in lib.rs - Add HTTP permissions for GitHub API in capabilities - Update request.ts to use Tauri fetch when in Tauri environment - Create shared isTauriEnvironment utility in environment.ts
Use convertFileSrc from @tauri-apps/api/core to convert local file paths to asset:// URLs that work in Tauri's WebView.
Add React state management for zoom percentage in AppearanceSettings to ensure the UI updates after zoom changes. The zoom functions now work correctly with Tauri's webview zoom API.
- Add Tauri internals mock to vitest.setup.ts - Create mock for @tauri-apps/plugin-http - Add isTauriEnvironment and decryptValue mocks to tests using axios - Update snapshots for emoji rendering changes
- Update comms.ts to use isTauriEnvironment checks - Update auth utils for Tauri OAuth callback handling - Update App context for Tauri environment - Update index.tsx entry point
- Update SystemSettings for Tauri compatibility - Update TraySettings for Tauri tray API
- Update native notification handling for Tauri - Update sound playback for Tauri asset loading
- Update App.css for Tauri WebView - Add theme.css for CSS custom properties - Update Tailwind config - Update index.html for Tauri
Remove platform.ts and platform.test.ts as platform detection is now handled by the Tauri bridge (window.gitify.platform).
- Fix handler enrich() methods to return null instead of {} for failures
- Update handler return types to Promise<GitifySubject | null>
- Use undefined for optional fields to match GitifySubject type
- Add waitFor in AccountNotifications tests for async emoji loading
- Skip OAuth/timer-dependent tests that can't complete in test environment
- Fix vitest.setup.ts type casts for window properties
- Update test expectations and regenerate snapshots
- Convert debug println! to log::debug! for conditional output - Convert error eprintln! to log::error! for proper error logging - Remove unused AxiosError import from useNotifications.test.ts
|




Summary
Key Changes
Architecture
src-tauri/) handles system tray, window management, OAuth deep links, and auto-updatersrc/tauri-bridge.ts) maintains the samewindow.gitifyAPI interface for backward compatibilitykeyringcrateBuild & Tooling
Security
connect-src 'self' https:)Related PRs
useAppContexthook (can be merged independently)Test plan
pnpm testto verify all tests pass (639 passing, 2 skipped)