
Tauri v2 Has a Free API That Builds Desktop Apps 10x Smaller Than Electron
Tauri v2 builds native desktop apps using web technologies. Your app uses the OS webview instead of bundling Chromium — resulting in 600KB apps instead of 150MB. Frontend: Any Framework // src/App.tsx — React, Vue, Svelte, or plain HTML import { invoke } from " @tauri-apps/api/core " ; function App () { const [ result , setResult ] = useState ( "" ); async function scrape () { const data = await invoke ( " scrape_url " , { url : " https://example.com " }); setResult ( data ); } return ( < div > < button onClick = { scrape } > Scrape < /button > < pre > { result } < /pre > < /div > ); } Backend: Rust Commands // src-tauri/src/lib.rs #[tauri::command] async fn scrape_url ( url : String ) -> Result < String , String > { let response = reqwest :: get ( & url ) .await .map_err (| e | e .to_string ()) ? ; let html = response .text () .await .map_err (| e | e .to_string ()) ? ; Ok ( html ) } #[tauri::command] fn read_file ( path : String ) -> Result < String , String > { std :: fs :: read_to_
Continue reading on Dev.to Webdev
Opens in a new tab



