How blackboardsh/electrobun works
Main Components
a) Core Runtime Components:
• Bun Runtime (Main Process)
• Native Bindings (Zig)
• System WebView
• RPC Communication Layer
b) Build & Distribution System:
• CLI Tools
• Bundler
• Updater System
• Package Manager Integration
Architecture Layers
┌─────────────────────────────────────────┐
• Application Layer │
• (User's TypeScript Code - Main/Views) │
• ┤
• Electrobun Framework Layer │
• Browser APIs │
• Bun APIs │
• RPC System │
• ┤
• Native Bridge Layer │
• Zig Bindings │
• ObjectiveC Integration │
• ┤
• Platform Layer │
• System WebView │
• OS Integration │
• ┘
Key Relationships to Highlight
a) Process Communication:
• RPC system (src/bun/core/Socket.ts)
• Isolation boundaries between processes
b) Native Integration:
• How Zig bindings connect to platform APIs
• Bridge between TypeScript and native code
Specific Components to Detail
a) Core Services (from src/bun/core):
• ApplicationMenu
• BrowserWindow
• BrowserView
• Tray
• Updater
b) Event System (from src/bun/events):
• ApplicationEvents
• TrayEvents
• WebviewEvents
• WindowEvents
Build & Distribution Flow
• Build Process
• Packaging
• Update Distribution (bsdiff system)
• Self-extracting bundles