# Migrate to Tauri
## Rationale
Electron is a popular and easy to use application environment. However Electron is plagued with security vulnerabilities due to the fact that they ship the whole browser environment inside an application. **Thus they inherit all the vulnerabilities present in browser environments, consume very high RAM and are large applications**. Speed in Firefly is also limited to NodeJS's single threaded model, which causes performance issues when using the bindings through Neon.
Tauri is a new framework that arose to address previous issues. It's an app construction toolkit that can build software for all desktop operating systems using web technologies. Its backend is written in rust, but allows the developer to integrate the frontend/backend with JavaScript functionalities. For those new to the Rust programming language, Tauri provides a comfortable learning environment that will grow with you.
## Firefly Requirements
### Technical
- Show Svelte page
- Migrate from Electron (could be done through stronghold files)
- Handle deep links
- Access local storage (for logs/stronghold/...) or some form of persisted storage / DB
- Automatic app update download and installation
- Open external URL
- Application Menu
- Notifications
- Ledger compatibility
- Importing / managing files and buffers
- Exporting files (e.g. Stronghold, CSV)
- Supports Sentry crash reporting
### Development
- Hot reloading for new changes and quick initialization
- Supports `wallet.rs` bindings (keep track of issue [#1514](https://github.com/tauri-apps/tauri/issues/1514) on Tauri repo)
- Github Actions for building and packaging the binaries
- Supports Webpack / Or some kind of bundling
- Supports unit and integration tests
- Supports import path aliases for TS
## Pros and Cons
**Pros**:
- Better security
- Better performance
- Smaller App size
- Could call rust code directly from front-end
- Better DevEx
- Less maintainance (Electron depends on V8 + Browser's release cadence)
- Now is a good time to switch over, since a new network/Firefly version is released
- Helpful Discord community
- Former IOTA Stronghold incubator, develops Tauri ([`tauri-plugin-stronghold`](https://github.com/tauri-apps/tauri-plugin-stronghold) plugin available) + co-founder also works at IF
**Cons**:
- Tauri uses Webview, which differs on OS implementation. This means that it's possible that there might be minor discrepancies between UI on different OS (see [here](https://tauri.app/about/architecture/#upstream-crates) for more info)
- We don't have an experienced Rust dev on our team (although we could use the bindings in the beginning in Tauri as well)
- Adds extra overhead to our roadmap, while it's already cramped
- Will miss Chromium-based developer tools
## Questions
- **Should we continue using Webpack or migrate to something like [SvelteKit](https://kit.svelte.dev)?**
- **Do we have the time to include this change with the production Stardust release?**
- The IOTA mainnet production release of Stardust requires a profile / DB migration anyway, so if we're planning on upgrading to Tauri at all (which also would require some type of profile / DB migration) then it makes the most sense to include both at the same time to create the least amount of friction.