← Back to Blog

Electrobun + WGPU

WebGPU is here

Electrobun now ships first-class WGPU, so you can render straight to GPU or use our Three.js/Babylon adapters in Bun without touching a webview.

You can open high-performance native windows with only a GPU rendering surface, or integrate GPU surfaces into your webview UIs with our new <electrobun-wgpu> HTML element that works similarly to our <electrobun-webview> OOPIFs.

Even if your app has tons of dependencies, think huge games or bundling lightweight inference models that run on WGPU, pay a fraction of the cost of distribution thanks to Electrobun's batteries-included state-of-the-art zstd self-extractor and differential updates as small as 4KB.

Why Now?

v1 launched 4 weeks ago. The first week was quiet as the gravitational shift propagated through spacetime re-shaping the universe. After I added demo videos, the star chart pinned vertical, twitter viral, and people have been non-stop sending me net-new production apps they've already shipped—and existing apps migrated from Electron or Tauri in under an hour.

Some see a summary that Electrobun uses the system webview by default and because they've lived in a world of choosing between Electron (Chromium) and Tauri (system webview) for so long they don't digest the "by default". Electrobun has had a bundleCEF flag since before we shipped Windows and Linux support that lets you choose to use Chromium for projects where you're willing to pay the file size cost for consistency or Chrome-specific functionality.

But to really communicate Electrobun's next-generation architecture I wanted to ship a non-webview renderer you can optionally bundle in your Electrobun apps. As I iterated on WGPU I realized how groundbreaking what it unlocks is. It's not just games, it's also AI inference and other GPU workloads.

The result is you can now build performant games and direct-to-GPU inference loads right in your Electrobun apps with only a tiny increase in file size. You can open pure native GPU windows, or mix and match direct-to-GPU surfaces among your webviews that are far more powerful than a standard <canvas> element.

How It Works

We provide pre-built dynamic libraries of Dawn (Chrome's WGPU implementation). When you add a bundleWGPU: true flag to your electrobun.config.ts the Electrobun CLI automatically pulls in the right one for the target platform and wires it into your app. You can then import our three.js, Babylon.js, or raw WGPU FFI methods from Electrobun's Bun API, or write low-level code in Zig, Rust, C, or anything, using WGPU's FFI directly—bundling your own binaries right in your Electrobun app.

What Can You Build With Electrobun + WGPU

WGPU ships today.

Instant Templates

We've added 4 new WGPU templates so you can start building in seconds.

npx electrobun init wgpu
A pure TypeScript -> raw WGPU shader app that responds to mouse movement without a webview.

npx electrobun init wgpu-three
A three.js physics demo with falling cubes that you can drag around running in a GpuWindow, and a separate BrowserWindow with UI that lets you control the simulation.

npx electrobun init wgpu-babylon
A pure TypeScript -> Babylon.js platformer game where you use your keyboard to hop Electrobun's bunny around eating carrots.

npx electrobun init wgpu-mlp
A digit classifier. Using a Webview and <canvas> elements to draw digits for training and inference input and Bun TypeScript running inference directly on GPU

Video Demos

Kitchen Sink: Shader in a GpuWindow

Kitchen Sink: Three.js interactive bunny cube animation

Kitchen Sink: Babylon.js spinning cube with lighting effects

Template: wgpu-babylon template with the bunny platformer game

Template: wgpu-mlp digit classifier

DOOM: Doom 2 ways, using C doom with electrobun WGPU, and a WIP full TypeScript port

Kitchen Sink: <electrobun-wgpu> tag in a webview

3rd party: zig-based game engine and IDE built with Electrobun WGPU

Open source projects already shipping with Electrobun

DOOM: This is the open source repo for the video demo linked above

CDP automation CLI for Electrobun desktop apps

Markdown Browser - See the web like an AI does

Advanced screen recording studio / editing tool

GIT GUI with integrated AI

3rd party Claude skill for migrating Electron to Electrobun

A Voice cloning and TTS tool wrapping the latest Qwen TTS models

Turn any website into an Electrobun desktop app in 20 seconds with deskdown

A hybrid web browser + local code editor with integrated PTY Terminal and AI designed for startup builders who need to move fast.

It's not the Future, it's the Nowture

Looking forward, we're expanding Electrobun's GPU capabilities with a Steam-sdk integration for Bun TypeScript, and a tinygrad-like Engine to make heavier inference workloads easier.

I can't wait to see what you build.

Don't forget to give Electrobun a star on Github https://github.com/blackboardsh/electrobun