Architecture Overview
This library has two cooperating layers:
-
Runtime layer (
@electron-ipc-bridge/core)- Registers controller handlers on Electron
ipcMain - Injects event-derived parameters (
@Sender(),@Window(),@RawEvent(),@Channel(), etc.) - Optionally wraps handler execution in correlation context
- Registers controller handlers on Electron
-
Build layer (
@electron-ipc-bridge/vite-plugin)- Parses
createIpcApp(...)from your main entry - Finds controllers and extracts handler signatures
- Generates renderer-facing type artifacts (
ipc.types.tsandipc.d.ts)
- Parses
End-to-end flow
Design constraints
- Controllers must be statically discoverable from
createIpcApp(...)for type generation to work. - Duplicate namespaces are rejected at app creation time.
- The preload
namespacemust match what the renderer expects (defaults toipc).