Ultra-fast reactive primitives (@rapid/signal) and fine-grained framework (@rapid/web)
2.49 KB • 2.97x vs Solid • Auto-tracking • Zero config
Core Package • Framework Integrations • Utilities • Quick Start
Rapid is a revolutionary reactive state management library that combines extreme minimalism with magical auto-tracking. Built for modern applications, Rapid provides the smallest bundle size without sacrificing performance or developer experience.
The Problem:
Traditional state libraries:
- Large bundle sizes ❌
- Manual dependency tracking ❌
- Verbose APIs ❌
- Poor performance ❌
The Solution:
Rapid:
- 2.49 KB gzipped ✅
- Automatic dependency tracking ✅
- Clean, unified API ✅
- Blazing fast performance ✅
Result: Minimal footprint, maximum performance, zero configuration.
| Feature | Description | Benefit |
|---|---|---|
| Ultra-tiny | Only 2.49 KB gzipped (v3.8) | Minimal bundle impact |
| Lightning fast | 2.97x slower vs Solid.js | Competitive performance |
| Zero overhead | Auto-tracking with minimal runtime cost | Optimal performance |
- 🪄 Auto-tracking - Dependencies tracked automatically, no manual lists
- 🎯 Clean API - Unified
.valueeverywhere, noget()/set() - 📦 Framework agnostic - Use with React, Vue, Svelte, Solid, or vanilla JS
- 🔌 Extensible - Modular utilities for persistence, routing, and more
- 💪 TypeScript-first - Full type safety out of the box
- Core reactive primitives (signal, computed, effect)
- Auto-tracking dependency system
- Ultra-tiny bundle (1.75 KB)
- Foundation for Rapid ecosystem
- Web renderer with fine-grained reactivity
- No virtual DOM - direct DOM updates
- Component render once, signals auto-update
- JSX with automatic signal unwrapping
- SSR and hydration support
- Terminal UI renderer for CLI applications
- Build beautiful terminal dashboards
- Same reactive primitives as web
- Box, Text components for layout
@rapid/native (Coming Soon)
- Native renderer for iOS/Android
- React Native-compatible components
- Platform-specific optimizations
# For web applications
npm install @rapid/web
# For terminal/CLI applications
npm install @rapid/tui
# For core reactivity only
npm install @rapid/signal- React hooks integration
- Automatic re-renders
- Concurrent mode compatible
- Vue 3 composition API
- Seamless integration
- Svelte stores compatibility
- Reactive bindings
- Preact signals integration
- Lightweight alternative to React
- SolidJS primitives
- Fine-grained reactivity
# Install framework integration
npm install @rapid/signal-react
# or
npm install @rapid/signal-vue
# or
npm install @rapid/signal-svelte@rapid/signal-patterns - NEW v2.0 🎉
- Useful patterns built on zen core APIs
- Store pattern (Zustand-style)
- Async state management
- Map pattern (key-level reactivity)
- DeepMap pattern (path-level reactivity)
- Only 936 B gzipped
- Immutable state updates
- 1.4-35x faster than immer
- Type-safe mutations
- LocalStorage/SessionStorage persistence
- Automatic synchronization
- Debounced writes
@rapid/router & @rapid/router-react & @rapid/router-preact
- Type-safe routing
- Nested routes support
- Framework-specific bindings
# Install utilities
npm install @rapid/signal-patterns # NEW! Useful patterns
npm install @rapid/signal-craft
npm install @rapid/signal-persistent
npm install @rapid/router-reactimport { signal, computed } from '@rapid/signal';
// Create reactive state
const count = signal(0);
// Auto-tracked computed value (no manual dependencies!)
const double = computed(() => count.value * 2);
// Update state
count.value++;
console.log(double.value); // 2import { useZen } from '@rapid/signal-react';
import { signal } from '@rapid/signal';
const counter = signal(0);
function Counter() {
const count = useZen(counter);
return (
<div>
<p>Count: {count}</p>
<button onClick={() => counter.value++}>Increment</button>
</div>
);
}import { store, computedAsync, map } from '@rapid/signal-patterns';
import { signal } from '@rapid/signal';
// Zustand-style store pattern
const counter = store(() => {
const count = signal(0);
return {
count,
increase: () => count.value++,
decrease: () => count.value--
};
});
// Async state management
const user = computedAsync(async () => {
const res = await fetch('/api/user');
return res.json();
});
// Key-level reactivity for objects
const form = map({
name: '',
email: '',
age: 0
});import { persistent } from '@rapid/signal-persistent';
// Automatically synced with localStorage
const settings = persistent('user-settings', {
theme: 'dark',
language: 'en'
});
// Changes are automatically persisted
settings.value.theme = 'light';| Library | Size (gzipped) | Difference |
|---|---|---|
| Zustand | 1.2 KB | Baseline |
| Rapid v3.8 | 2.49 KB | +108% |
| Jotai | 3.0 KB | +150% |
| Valtio | 5.5 KB | +358% |
| Redux Toolkit | 12+ KB | +900% |
| Library | Performance | Auto-tracking | Computed |
|---|---|---|---|
| Solid.js | 1x (baseline) | ✅ Yes | ✅ Yes |
| Rapid v3.8 | 2.97x slower | ✅ Yes | ✅ Yes |
| Zustand | Manual tracking | ❌ No | ❌ No |
| Valtio | Auto (Proxy) | ✅ Proxy | ❌ No |
| Redux | Manual tracking | ❌ No | ❌ No |
zen/
├── packages/
│ ├── zen-signal/ # @rapid/signal - Reactive primitives
│ ├── zen-web/ # @rapid/web - Web renderer
│ ├── zen-tui/ # @rapid/tui - Terminal UI renderer
│ ├── zen-native/ # @rapid/native - Native renderer (coming soon)
│ ├── zen-runtime/ # @rapid/runtime - Platform-agnostic components
│ ├── zen-signal-react/ # @rapid/signal-react - React integration
│ ├── zen-signal-vue/ # @rapid/signal-vue - Vue integration
│ ├── zen-signal-svelte/ # @rapid/signal-svelte - Svelte integration
│ ├── zen-signal-preact/ # @rapid/signal-preact - Preact integration
│ ├── zen-signal-solid/ # @rapid/signal-solid - SolidJS integration
│ ├── zen-signal-craft/ # @rapid/signal-craft - Immutable utilities
│ ├── zen-signal-patterns/ # @rapid/signal-patterns - Useful patterns
│ ├── zen-signal-persistent/ # @rapid/signal-persistent - Persistence
│ ├── zen-router/ # @rapid/router - Core routing
│ ├── zen-router-react/ # @rapid/router-react - React router
│ └── zen-router-preact/ # @rapid/router-preact - Preact router
├── docs/ # Documentation site
├── package.json
└── README.md
# Install dependencies
bun install
# Build all packages
bun run build
# Run tests
bun test
# Watch mode
bun test:watch
# Linting
bun run lint
bun run lint:fix# Build specific package
bun run build --filter @rapid/signal
# Test specific package
bun test --filter @rapid/signal
# Dev mode for all packages
bun run dev- State - Reactive values that trigger updates
- Computed - Auto-tracked derived values
- Effects - Side effects that run on changes
- Persistence - Automatic storage synchronization
Each framework package provides idiomatic bindings:
- React:
useZen()hook - Vue: Composition API compatible
- Svelte: Store-compatible
- Solid: Signal-compatible
See individual package READMEs for detailed documentation.
import { state, computed } from '@rapid/signal';
const user = state({ name: 'Alice', age: 30 });
const isAdult = computed(() => user.value.age >= 18);const form = state({
email: '',
password: ''
});
const isValid = computed(() =>
form.value.email.includes('@') &&
form.value.password.length >= 8
);const theme = persistent('theme', 'dark');
const sidebar = state({ open: false });
const modal = state({ show: false, content: null });| Component | Technology |
|---|---|
| Language | TypeScript 5.9 |
| Package Manager | pnpm |
| Monorepo | pnpm workspaces + Turbo |
| Testing | Vitest |
| Bundling | tsup |
| Linting | Biome |
| Documentation | VitePress |
- Core reactive state library
- Auto-tracking computed values
- React integration
- Vue integration
- Svelte integration
- Preact integration
- SolidJS integration
- Immutable utilities (zen-craft)
- Persistence utilities
- Routing (zen-router)
- DevTools integration
- Time-travel debugging
- Performance profiler
- React Native support
- SSR optimizations
- More utility packages
Contributions are welcome! Please follow these guidelines:
- Open an issue - Discuss changes before implementing
- Fork the repository
- Create a feature branch -
git checkout -b feature/my-feature - Follow code standards - Run
pnpm lint - Write tests - Maintain high coverage
- Submit a pull request
# 1. Install dependencies
pnpm install
# 2. Make changes to packages
# 3. Build and test
pnpm build
pnpm test
# 4. Lint and format
pnpm lint:fix
pnpm format
# 5. Create changeset
pnpm changeset
# 6. Commit and push
git commit -m "feat: add new feature"
git pushMIT © Sylphx
Built with:
- TypeScript - Language
- pnpm - Package manager
- Turbo - Monorepo tool
- Vitest - Testing framework
- Biome - Linting & formatting
The tiniest, fastest reactive state library
2.49 KB • 2.97x vs Solid • Auto-tracking magic
sylphx.com •
@SylphxAI •
[email protected]