Sairin is a fine-grained reactive UI framework built around a virtual filesystem model. Every piece of state lives at a path, and reactivity flows through those paths like a living directory tree.
| Feature | Description |
|---|---|
| Path-Based Graph | Signals at paths like /user/name, subscribe to namespaces |
| Fine-Grained Updates | Only exactly what changes gets updated |
| Three Scheduling Tiers | Sync, microtask, and idle effects |
| Locks and Ownership | Prevent writes from outside designated scopes |
| Memory Efficient | Incremental cleanup, effect pooling, retained memory caps |
| Satori Integration | Structured logging with full context |
import { signal, effect, path } from 'sairin';
const count = signal(path("counter", "value"), 0);
effect(() => {
console.log("Count is now:", count.get());
});
count.set(1); // Logs: "Count is now: 1"Most reactive systems use a flat model:
signal -> Set<subscriber>Sairin uses a filesystem model:
/user/name <- signal
/user/age <- signal
/user <- namespace
/ui/header <- derived, depends on /user/nameThis gives you namespace subscriptions, natural scoping, and path-based debugging.
npm install @nisoku/sairinSairin is available on NPM!
| Section | Description |
|---|---|
| Quick Start | Your first Sairin app |
| Configuration | Lock behavior and logging |
| Path System | Paths, globs, and aliases |
| Signals | Creating and using signals |
| Effects | Running code when signals change |
| Derived | Computed values that auto-update |
| Batching | Grouping updates efficiently |
| Locks | Preventing unauthorized writes |
| API Reference | Complete API documentation |
- Sakko - A DSL compiler that uses Sairin for reactive state in compiled components
Sairin/
Build/ # Source code and build config
src/ # TypeScript source
kernel/ # Core reactivity (signals, effects, derived)
store/ # Reactive data structures
flow/ # Async flow utilities
async/ # Async patterns
dom/ # DOM bindings
Docs/ # Documentation (docmd)cd Build && npm installcd Build && npm testcd Build && npm run typecheckcd Build && npm run buildcd ../Docs && npm run build