#crdt #leptos #offline #sync #local-first

leptos-sync-core

Core synchronization library for Leptos applications

11 releases (7 breaking)

0.9.0 Sep 21, 2025
0.8.4 Sep 7, 2025
0.7.0 Sep 5, 2025
0.6.0 Sep 4, 2025
0.2.0 Sep 4, 2025

#726 in Asynchronous

Download history 16/week @ 2025-10-03 3/week @ 2025-10-10 9/week @ 2025-10-17 3/week @ 2025-10-24

678 downloads per month
Used in 3 crates

MIT/Apache

1MB
24K SLoC

leptos-sync-core

Core synchronization library for Leptos applications, providing local-first data synchronization with advanced conflict resolution and real-time capabilities.

Features

  • CRDT Implementation: Conflict-free replicated data types (LWW, MV-Register, GCounter)
  • Advanced Conflict Resolution: Multiple strategies with custom conflict handling
  • Real-time Synchronization: Live updates with presence detection
  • Security Features: Encryption, compression, and secure key derivation
  • Storage Abstraction: Hybrid storage with automatic fallback
  • Transport Layer: WebSocket, in-memory, and hybrid transport options

Usage

use leptos_sync_core::{
    LocalFirstCollection, 
    HybridStorage, 
    HybridTransport,
    LwwRegister
};

// Create a collection with automatic sync
let storage = HybridStorage::new();
let transport = HybridTransport::new();
let collection = LocalFirstCollection::<TodoItem>::new(
    "todos".to_string(),
    storage,
    transport
);

// Use reactive queries
let todos = collection.query().watch();

Documentation

See the main project README for comprehensive documentation and examples.

License

Licensed under either of

at your option.

Dependencies

~32–55MB
~804K SLoC