Loro
High-performance CRDT library that makes JSON data collaborative and version-controlled
Repository Health
Technical Analysis
Loro is a Conflict-free Replicated Data Type (CRDT) library that lets applications treat rich JSON-like data (maps, lists, text, trees) as collaboratively editable and automatically mergeable across devices and offline periods, without a central server arbitrating conflicts. Its core is written in Rust and compiled to WebAssembly, exposed to JavaScript/TypeScript via the loro-crdt npm package, giving web apps native-speed CRDT operations.
Beyond basic merge semantics, Loro adds built-in version control — time-travel, branching, and diffing over the document’s history — plus a specialized rich-text CRDT type designed for real collaborative text editors (not just JSON merging). It targets local-first and offline-first application architectures where clients need to keep working without connectivity and reconcile changes automatically when they reconnect.
What You Get
- CRDT container types for Map, List, Text, Tree, and MovableList that auto-merge concurrent edits
- A Rust core compiled to WASM, exposed to JS/TS via the
loro-crdtnpm package for near-native performance in the browser - Built-in version control: checkout arbitrary history points, branch, and diff document versions
- A dedicated rich-text CRDT type suited for real collaborative editors, distinct from plain JSON merge semantics
- A compact binary export/import format for efficient sync and persistence
- Native bindings beyond JS (Rust crate, with community bindings for other languages) sharing the same core
Common Use Cases
- Building local-first apps (note-taking, whiteboards, documents) that keep working fully offline and sync automatically when reconnected
- Powering real-time collaborative text editors that need conflict-free merging of concurrent typing
- Adding undo/redo and version history to an app for free by using Loro’s built-in time-travel over document state
- Syncing structured app state (not just documents) across multiple devices or tabs without a central authority resolving conflicts
Under The Hood
Architecture - The core CRDT algorithms live in the crates/loro/loro-internal Rust crates (shared logic for containers, operation log, and history), with loro-common providing shared types and loro-wasm compiling that core to WebAssembly and wrapping it in the TypeScript-friendly API published as loro-crdt; fractional_index, generic-btree, delta, and rle crates implement the underlying data structures (ordered position indices, run-length encoding, B-trees) that make Loro’s operation log compact and fast to replay.
Tech Stack - Rust for the CRDT engine and WASM compilation target, TypeScript for the loro-js bindings and public JS/TS API surface, with a pnpm/moon-based monorepo managing the JS packages and Cargo workspaces for the Rust crates; deny.toml/supply-chain files show active Rust dependency auditing.
Code Quality - The repo includes a dedicated fuzz crate for property/fuzz-testing the CRDT merge logic (critical correctness surface for any CRDT implementation), benchmarks directories on both the Rust and JS sides for tracking performance regressions, and CI running across the Rust and JS toolchains; commit velocity is high (26+ commits/month, 100 tagged releases) with an active Discord community and its own documentation site.
API Design - The container-based API (doc.getMap(), doc.getText(), doc.getList()) mirrors familiar JSON/collection APIs closely, keeping the learning curve low for developers without CRDT background, while version-control operations (doc.checkout(), doc.fork()) are clearly named and map onto git-like mental models developers already have.
Used by 2 apps in this directory
Dify
No Code Platforms · AI Development · Developer Tools
Visual LLM workflow platform with RAG pipelines, agent capabilities, and model management for building production AI applications.
marimo
Developer Tools · Data Engineering
A reactive Python notebook that eliminates hidden state, runs reproducibly, and deploys as a web app or script — stored as pure Python, built for the AI era.