explaingit

loro-dev/loro

5,613RustAudience · developerComplexity · 3/5Setup · moderate

TLDR

Loro is a Rust library for building apps where multiple users can edit the same data at once, syncing changes automatically even when offline, using CRDTs to merge edits without a central server.

Mindmap

mindmap
  root((repo))
    What it does
      Sync data offline
      Merge edits
      Version history
      Time travel
    Data types
      Rich text
      Lists and maps
      Tree structures
    Tech stack
      Rust core
      WASM for web
      Swift for iOS
    Use cases
      Collaborative editors
      Offline first apps
      Shared whiteboards
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build a collaborative text editor where two users can type at the same time and changes merge automatically without conflicts.

USE CASE 2

Create a shared to-do list that works offline and syncs with other users when internet is restored.

USE CASE 3

Add Git-style version history to any shared document app, letting users step back through past states of their data.

USE CASE 4

Build a mobile app with the Swift bindings that syncs data across devices when reconnected to the internet.

Tech stack

RustWebAssemblyJavaScriptSwift

Getting it running

Difficulty · moderate Time to first run · 30min

Browser usage requires a bundler that handles WebAssembly, the WASM module must be loaded before the library is usable.

In plain English

Loro is a library that helps developers build apps where multiple people can edit the same data at the same time, even without a constant internet connection. It is built around a concept called CRDTs (Conflict-free Replicated Data Types), which is a technique for keeping data in sync across different devices without needing a central server to arbitrate who made what change. When two people edit the same document offline and then reconnect, Loro merges their changes automatically without losing either person's work. The library works with JSON-like data structures: lists, maps, and text. You can use it to build collaborative text editors, shared to-do lists, real-time whiteboards, or any other app where multiple users need to see and change the same state. Loro supports rich text editing, tree structures where items can be moved around, and a version history system that works similarly to how Git tracks changes in code. Loro is written in Rust but can also be used from JavaScript (via a compiled WASM module) and Swift, making it accessible for web apps, mobile apps, and server-side code. The library includes a time-travel feature that lets you step through the history of a document and see what it looked like at any past point. It also supports a shallow snapshot mode, similar to Git's shallow clone, which lets you load a document's current state without pulling in its entire change history. A visual inspector tool is available at a separate website, letting developers examine the internal state and history of a Loro document during development. The project has documentation, a getting-started guide, and an active Discord community. It reached version 1.0 and is actively maintained by the loro-dev team, who have published blog posts explaining the design decisions behind the library's text editing and tree algorithms.

Copy-paste prompts

Prompt 1
Using the Loro JavaScript and WASM library, write code to create a shared text document that two browser tabs can edit simultaneously and merge without conflicts.
Prompt 2
Show me how to use Loro's time-travel feature to display what a shared document looked like at a specific past point in time.
Prompt 3
Help me build a collaborative to-do list using Loro where users can add and check off items while offline, then sync automatically when they reconnect.
Prompt 4
Using Loro's tree structure type, write code to build a shared outline where users can move items around and changes sync across all devices in real time.
Open on GitHub → Explain another repo

← loro-dev on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.