Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsJul 5, 2026·3 min de lectura

Loro — High-Performance CRDTs for Local-First Collaboration

A reimagined Conflict-free Replicated Data Type (CRDT) library built in Rust with bindings for JavaScript/TypeScript. Enables real-time and async collaboration with document-level version control.

Listo para agents

Instalación lista para agent

Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
Loro CRDT
Comando de instalación directa
npx -y tokrepo@latest install c6580a10-782b-11f1-9bc6-00163e2b0d79 --target codex

Ejecutar después de confirmar el plan con dry-run.

Introduction

Loro is a CRDT library that makes building local-first, collaborative applications practical. Written in Rust for performance, it provides rich data types (text, lists, maps, trees, counters) that merge automatically without a central server, along with built-in document history and time travel.

What Loro Does

  • Provides rich CRDT containers including text with formatting (Peritext-based), lists, maps, trees, and counters
  • Merges concurrent edits from multiple users automatically without conflicts
  • Tracks full document history with time-travel capabilities for undo, versioning, and audit trails
  • Encodes documents into compact binary snapshots for efficient storage and network transfer
  • Offers first-class JavaScript/TypeScript and Rust APIs with Swift and Python bindings in progress

Architecture Overview

Loro implements a novel event graph-based CRDT architecture. Each edit is recorded as an operation in a directed acyclic graph (the event graph), which preserves causality. This design separates the merge semantics from the storage format, enabling compact encoding and fast replay. The Rust core is compiled to WebAssembly for browser use, delivering near-native performance in JavaScript environments.

Self-Hosting & Configuration

  • Install via npm (loro-crdt) for JavaScript or add loro as a Cargo dependency for Rust
  • No server required for basic local-first use; documents sync peer-to-peer via exported binary diffs
  • For server-mediated sync, use doc.export({ mode: "updates" }) to send incremental changes
  • Apply remote changes with doc.import(bytes) on any peer to merge state automatically
  • Persist documents as snapshots to any storage backend (file system, IndexedDB, S3)

Key Features

  • Peritext-based rich text CRDT that correctly handles concurrent formatting changes
  • Movable tree container for hierarchical data like outlines, file trees, and kanban boards
  • Sub-document composition for modular, independently-syncable document sections
  • Compact binary encoding that is significantly smaller than JSON-based CRDT formats
  • Full event graph history enables branching, merging, and checkout of any past version

Comparison with Similar Tools

  • Yjs — mature and widely adopted text CRDT library; Loro adds richer data types, built-in history, and a Rust core for higher throughput
  • Automerge — another Rust-based CRDT with a JSON document model; Loro offers more specialized containers and different merge semantics for text
  • Diamond Types — high-performance text CRDT focused on a single data type; Loro provides a full suite of composable containers
  • ShareDB — OT-based real-time collaboration that requires a central server; Loro is decentralized by design

FAQ

Q: Does Loro work in the browser? A: Yes. The Rust core compiles to WebAssembly, and the npm package works in all modern browsers and Node.js.

Q: How does Loro handle conflicts in rich text? A: Loro implements the Peritext algorithm, which correctly merges concurrent bold, italic, and other formatting operations according to user intent.

Q: Do I need a server to use Loro? A: No. Loro is transport-agnostic. You can sync over WebSocket, WebRTC, HTTP, or even sneakernet via exported binary files.

Q: How large are Loro documents? A: Loro uses a compact binary format. A document with thousands of edits typically compresses to a few kilobytes, much smaller than equivalent JSON representations.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados