Skip to main content

crdt_lf_hive 0.5.3 copy "crdt_lf_hive: ^0.5.3" to clipboard
crdt_lf_hive: ^0.5.3 copied to clipboard

Hive adapters for CRDT LF library objects, providing persistence for Change and Snapshot objects.

CRDT LF Hive #

crdt_lf_hive_badge pub points pub likes codecov ci_badge License: MIT pub publisher

A Hive storage adapter for crdt_lf: it keeps your documents on the device, and reads them back on launch. It runs on the web with no setup.

Read the full documentation

πŸ“– The full persistence guide β€” which adapter to pick, history, backups, compaction β€” is on mattiapispisa.it/crdt.

Features #

  • 🌐 Runs everywhere: Dart VM, Flutter, and the web
  • ⚑ Synchronous reads: a box is in memory, so a document is restored before the first frame
  • πŸ—‚οΈ Boxes per document, plus a small registry of document ids
  • 🀝 Shared boxes: a box closes with its last user, so two replicas can share them
  • πŸ“¦ Compact binary: one TypeAdapter each for Change and Snapshot
  • πŸͺͺ Peer identity: the device writes under the same author on every launch
  • 🧩 Same contract as the SQLite and Drift adapters: change backend with one line
  • βž• …and more: everything else is in the documentation

Quick start #

flutter pub add crdt_lf crdt_lf_hive hive path_provider
// On the web Hive uses IndexedDB and needs no path.
if (!kIsWeb) {
  Hive.init((await getApplicationDocumentsDirectory()).path);
}
CRDTHive.initialize();
// One backend for the whole app: it lives as long as the app does.
final backend = await CRDTHive.open();

Then backend.openDocument('note') reads a document back and follows it. The complete app, a text field saved on the device and tested in CI, is the recipe.

Every change is written down from there on. This package re-exports the whole crdt_lf_persistence API, so it is the only storage package your pubspec.yaml needs.

Greyhound Markdown keeps its rooms in the browser with this adapter.

Documentation #

Roadmap #

Roadmap: done, in progress, to do

πŸ—ΊοΈ The project board shows what is done, what is in progress and what comes next, for this package and the rest of the workspace. Missing something? Open an issue: requests go on the board too.

Apps #

Packages #

Other bricks of the crdt "system" are:

0
likes
160
points
171
downloads

Documentation

API reference

Publisher

verified publishermattiapispisa.it

Weekly Downloads

Hive adapters for CRDT LF library objects, providing persistence for Change and Snapshot objects.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#crdt #local-first #hive #persistence #dart

License

MIT (license)

Dependencies

crdt_lf, crdt_lf_persistence, hive, hlc_dart

More

Packages that depend on crdt_lf_hive