Architecture¶
This page is a high-level summary aimed at first-time readers of the docs site. The canonical, in-depth treatment lives in the internal docs/architecture.md (Japanese).
Overview¶
rescript-tauri is a pnpm-workspace monorepo of ReScript binding packages around Tauri 2.x’s official JS SDK (@tauri-apps/api). The core package, @rescript-tauri/core, exposes the entire upstream public API surface (IPC, Event, Window, Webview, Menu, Tray, etc.) with idiomatic ReScript types.
┌──────────────────────────────────────────────┐
│ Layer 3: @rescript-tauri/schema │
│ └─ Command.fromSchemas (rescript-schema) │
├──────────────────────────────────────────────┤
│ Layer 2: Core.Command │
│ └─ make / invoke / invokeExn │
├──────────────────────────────────────────────┤
│ Layer 1: Core.Raw │
│ └─ invoke / convertFileSrc │
└──────────────────────────────────────────────┘
↓ JS bridge
@tauri-apps/api/core (upstream)
Key components¶
Package |
Role |
|---|---|
|
Core bindings for the entire |
|
Bindings for |
|
Bindings for |
|
|
|
Buildable usage examples (CI gate on 3 OS) |
Design principles¶
The full discussion is in docs/architecture.md §3. The headline principles, mirroring the README highlights:
Idiomatic ReScript.
variant/option/result/ polymorphic variants replace theunknownand string-literal-union escape hatches that TypeScript users reach for.Faithful to Tauri. Near-1:1 mapping with the JS API surface so that the official Tauri docs remain directly applicable. Each
.residoc comment links to the corresponding Tauri page.Three-layer IPC. Layer 1 (Raw) / Layer 2 (typed Command) / Layer 3 (Schema) lets users pick the safety/ergonomics trade-off that fits.
Maintainable monorepo. Mirrors the structure of
@tauri-apps/plugin-*. Each package versions independently. Designed to remain sustainable for a 1–3 person maintainer team.
Where to dig deeper¶
Topic |
Source |
|---|---|
Module-by-module API specifications |
|
Cross-cutting design (error / lifetime / JSON / variants / inheritance) |
|
Original RFC |
|
Repository layout (canonical) |
|