npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dotted-logootsplit

v0.3.0

Published

Dotted version of LogootSplit

Downloads

43

Readme

Dotted LogootSplit: A delta block-wise sequence CRDT

travis NPM version

A CRDT is a data structure which can be replicated over multiple devices and thus concurrently edited. Most of the CRDT embeds metadata in order to avoid conflicting edits. The challenge is to keep these metadata as small as possible.

LogootSplit [1] is a sequence CRDT which reduces the metadata of preceding sequence CRDT; to do so it aggregates elements.

LogootSplit is an operation-based CRDT. Hence, it is necessary to use a network layer to deliver exactly-once the operations. It requires also to deliver removals after insertions. In practice, this is difficult to implement.

Delta-based CRDT [2] have less assumptions. Most of delta-based CRDT simply assume a FIFO delivery (deltas from a same replica, are merged in-order). They also enable to merge two states. This is particularly interesting for intensive collaborative sessions with long periods of disconnection.

Dotted LogootSplit offers a delta-based version of LogootSplit with smaller metadata. We provide both op-based and delta-based synchronizations.

Publication

Coming soon...

References

[1] Luc André, Stéphane Martin, Gérald Oster, Claudia-Lavinia Ignat. Supporting Adaptable Granularity of Changes for Massive-scale Collaborative Editing. In Proceedings of the international conference on collaborative computing: networking, applications and worksharing - CollaborateCom 2013. IEEE Computer Society, october 2013, pages 50–59. hal-00903813

[2] Paulo Sérgio Almeida,, Ali Shoker, Carlos Baquero. Delta State Replicated Data Types, Journal of Parallel and Distributed Computing, Volume 111, January 2018, Pages 162-173. arXiv:1603.01529

Usage

npm install dotted-logootsplit

The following example craetes two replicas and uses delta-based synchornozations.

import { avl, SimpleDotBlockFactory } from "dotted-logootsplit"

const seed = "dotted-logootsplit" // for reproducibility

const replicaA = 0
const strategyA = SimpleBlockFactory.from(replicaA, seed)
const stateA = avl.deltaEditableList(strategyA, "")

const replicaB = 1
const strategyB = SimpleBlockFactory.from(replicaB, seed)
const stateB = avl.deltaEditableList(strategyB, "")

const deltaA1 = stateA.insertAt(0, "Helo  ")
const deltaA2 = stateA.insertAt(6, "world!")
console.log(stateA.concatenated(""))
// A: "Helo  world!"

// delta sync
stateB.applyDelta(deltaA1)
console.log(stateB.concatenated(""))
// B: "Helo  "

const deltaB1 = stateB.insertAt(2, "l")
console.log(stateB.concatenated(""))
// B: "Hello  "

stateB.applyDelta(deltaA2)
console.log(stateB.concatenated(""))
// B: "Hello  world!"

const deltasB2 = stateB.removeAt(5, 1) // remove a space
console.log(stateB.concatenated(""))
// B: "Hello world!"

stateA.applyDelta(deltaB1)
for (const d of deltasB2) {
    stateA.applyDelta(d)
}
console.log(stateA.concatenated(""))
// A: "Hello world!"

TODO

  • [x] Local editing
  • [x] Op-based sync
  • [x] causal delta-based sync
  • [ ] Out-of-order delta-based sync (WIP)
  • [x] state-based sync (state merging)
  • [ ] Anchors (a participant cursor is an anchor)
  • [ ] LSeq-like positions and generation strategies
  • [ ] Simpler balanced tree implementation