DEV Community

Cover image for Electron, It's done bro
Swapnil
Swapnil

Posted on

Electron, It's done bro

I own a base Macbook Air M3 with a crisp 8 gigs of RAM which literally burns away in a matter of seconds when I fire up my development environment with VS Code, Spotify and just a few browser tabs. I had always known this was because of Electron, and even replaced VS Code with Zed, a native code editor built in Rust, and have migrated from different Electron/Chromium apps to native ones built with SwiftUI, Go or Flutter. but i was never able to find a good enough native music player alternative to replace the official Spotify Desktop app. I already explored projects like Spotube and more - these worked fine but lacked some key features like Spotify Jam and Spotify Connect integration which connects all your logged in devices with Spotify and let's you control your music playback from any device. On top of that, I used to use Spicetify with Spicy Lyrics to customise my Electron based Spotify client and this is exactly where the native apps fell short for me. I wanted to be able to use my custom themes and lyrics on a native app, but none of the native apps supported this.

That frustration led me down an open-source rabbit hole this week—one that introduced me to the next frontier of native desktop development and an incredible project: Sonora.

The Turning Point: The Rise of Rust and GPUI

Recently, editors like Zed proved that cross-platform desktop apps don’t need to be sluggish or memory-hungry. Instead of wrapping Chromium, Zed literally built their own GPU-accelerated UI framework from scratch in Rust called GPUI, delivering buttery-smooth 120 FPS rendering while sipping a mere 50–100 MB of RAM out of the box - and I loved it.

Enter Sonora.

Sonora is a free, open-source native music player built by @sonorahq using Rust and GPUI. It unifies local music libraries and streaming platforms like Spotify, Apple Music, and YouTube Music into a blazing-fast, cohesive desktop experience with an awesome UI for lyrics and sound visualisation.


Digging into Sonora’s Architecture

Curious about how it worked under the hood, I dove straight into their GitHub repository. A few architectural choices immediately stood out:

  1. Bare-Metal Rendering with GPUI: Instead of parsing massive DOM trees with CSS rules, Sonora paints directly to your GPU using native graphics backends (Metal on macOS, Vulkan on Linux). Keystrokes, navigation, and queue updates happen with zero perceptible latency.
  2. Deterministic Memory via Rust: Unlike Electron (JavaScript) or Flutter (Dart), Rust has no background Garbage Collector. There are no sudden GC pauses mid-scroll or while buffering high-bitrate audio.
  3. Decoupled Audio Core (librespot): Sonora interacts directly with Spotify’s streaming backend via open-source protocol implementations like librespot, keeping audio decoding completely separate from the UI thread.

The Feature I Needed: The Story of PR #895

While exploring native alternatives to Spotify, I had one non-negotiable requirement: Spotify Connect.

I wanted to control my desktop audio directly from my phone and have my desktop client appear as an active playback target. Moreover, I didn’t want to sacrifice my yearly Spotify Wrapped listening data.

When I checked Sonora's stable release, Spotify Connect receiver mode wasn’t visible yet. So I headed to the GitHub repository’s Pull Requests tab to see what was being worked on.

Sure enough, I found PR #895: feat(music): show sonora as a spotify connect device opened by contributor Tu2525.

Reading through the PR was an eye-opener:

  • It implemented the mDNS / Zeroconf network discovery layer needed to announce Sonora across the local network.
  • It registered Sonora as an active Spotify Connect playback target directly to the authenticated user's device pool.
  • Best of all: It was already reviewed and merged into main!

The Open Source Lesson: Merged vs. Released

A common question when diving into open source is: “If it’s merged, why isn’t it in the latest download on the Releases page?”

Exploring this taught me a valuable lesson in software delivery pipelines:

  • main is a moving target: Merged PRs land on the development branch immediately, but maintainers intentionally hold protocol-level changes for rigorous testing across macOS, Linux, and Windows before cutting a tagged release (like v0.2.0).
  • CI Artifacts to the rescue: Instead of waiting weeks for a new release, open source allows you to either grab the automated build artifact from GitHub Actions or simply clone the repo and run cargo run --release to enjoy the feature today.

What Exploring Sonora Taught Me

  1. Native is making a massive comeback: We are entering a post-Electron era where frameworks like GPUI, Tauri, and native Rust tooling enable developers to build cross-platform apps without sacrificing performance.
  2. GitHub PRs are the best changelogs: If software is missing a feature you love, don't just abandon it—check the Issues and PRs. More often than not, passionate open-source contributors are already building it in the open.
  3. The power of open collaboration: Seeing how quickly contributors added Spotify Connect discovery to a Rust GPUI codebase showed me the true spirit of open-source velocity.

Huge kudos to the Sonora maintainers and contributors for pushing desktop music clients forward. If you’re tired of heavy desktop apps hogging your system resources, definitely give Sonora a star on GitHub!


Top comments (0)