agent-orchestrator/ui-electrobun
Hibryda b79fbf688e perf(electrobun): JS blink replaces CSS animation, 1.13% CPU (was 6.5%)
JS setInterval(500ms) toggles .blink-off class instead of CSS @keyframes.
WebKitGTK handles discrete class toggle efficiently (single repaint per toggle).
0.7% idle + 0.43% blink overhead = 1.13% total.

Comparison:
- CSS @keyframes: 6.5% (continuous compositor animation)
- JS class toggle: 1.13% (2 repaints/sec)
- No animation: 0.7% (baseline)
- Tauri (CSS): ~0% (browser compositor optimized)
- GPUI (custom Element): 2.17%
2026-03-20 01:35:33 +01:00
..
build/dev-linux-x64/AgentOrchestrator-dev perf(electrobun): JS blink replaces CSS animation, 1.13% CPU (was 6.5%) 2026-03-20 01:35:33 +01:00
src perf(electrobun): JS blink replaces CSS animation, 1.13% CPU (was 6.5%) 2026-03-20 01:35:33 +01:00
bun.lock feat: Electrobun Svelte+WGPU prototype (Dawn GPU confirmed on Linux) 2026-03-20 01:25:41 +01:00
electrobun.config.ts feat: Electrobun Svelte+WGPU prototype (Dawn GPU confirmed on Linux) 2026-03-20 01:25:41 +01:00
llms.txt feat: Electrobun Svelte+WGPU prototype (Dawn GPU confirmed on Linux) 2026-03-20 01:25:41 +01:00
package.json feat: Electrobun Svelte+WGPU prototype (Dawn GPU confirmed on Linux) 2026-03-20 01:25:41 +01:00
README.md feat: Electrobun Svelte+WGPU prototype (Dawn GPU confirmed on Linux) 2026-03-20 01:25:41 +01:00
svelte.config.js feat: Electrobun Svelte+WGPU prototype (Dawn GPU confirmed on Linux) 2026-03-20 01:25:41 +01:00
tsconfig.json feat: Electrobun Svelte+WGPU prototype (Dawn GPU confirmed on Linux) 2026-03-20 01:25:41 +01:00
vite.config.ts feat: Electrobun Svelte+WGPU prototype (Dawn GPU confirmed on Linux) 2026-03-20 01:25:41 +01:00

Svelte Electrobun Template

A fast Electrobun desktop app template with Svelte 5 and Vite for hot module replacement (HMR).

Getting Started

# Install dependencies
bun install

# Development without HMR (uses bundled assets)
bun run dev

# Development with HMR (recommended)
bun run dev:hmr

# Build for production
bun run build

# Build for production release
bun run build:prod

How HMR Works

When you run bun run dev:hmr:

  1. Vite dev server starts on http://localhost:5173 with HMR enabled
  2. Electrobun starts and detects the running Vite server
  3. The app loads from the Vite dev server instead of bundled assets
  4. Changes to Svelte components update instantly without full page reload

When you run bun run dev (without HMR):

  1. Electrobun starts and loads from views://mainview/index.html
  2. You need to rebuild (bun run build) to see changes

Project Structure

├── src/
│   ├── bun/
│   │   └── index.ts        # Main process (Electrobun/Bun)
│   └── mainview/
│       ├── App.svelte      # Svelte app component
│       ├── main.ts         # Svelte entry point
│       ├── index.html      # HTML template
│       └── app.css         # Global styles
├── electrobun.config.ts    # Electrobun configuration
├── vite.config.ts          # Vite configuration
├── svelte.config.js        # Svelte configuration
└── package.json

Svelte 5 Features

This template uses Svelte 5 with the new runes syntax:

  • $state() - reactive state
  • $derived() - computed values
  • $effect() - side effects

Customizing

  • Svelte components: Edit files in src/mainview/
  • Global styles: Edit src/mainview/app.css
  • Vite settings: Edit vite.config.ts
  • Window settings: Edit src/bun/index.ts
  • App metadata: Edit electrobun.config.ts