0.21.3 • Published 9 months ago

ywasm v0.21.3

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Ywasm

This project is a wrapper around Yrs and targets Web Assembly bindings.

It's a library used on collaborative document editing using Conflict-free Replicated Data Types. This enables to provide a shared document editing experience on a client devices without explicit requirement for hosting a single server - CRDTs can resolve potential update conflicts on their own with no central authority - as well as provide first-class offline editing capabilities, where document replicas are modified without having connection to each other, and then synchronize automatically once such connection is enabled.

Documentation

Example

import * as Y from 'ywasm';

const doc = new Y.YDoc()
const text = doc.getText('name')

// append text to our collaborative document
text.insert(0, 'hello world', { bold: true })

// simulate update with remote peer
const remoteDoc = new Y.YDoc()
const remoteText = remoteDoc.getText('name')

// in order to exchange data with other documents
// we first need to create a state vector
const remoteSV = Y.encodeStateVector(remoteDoc)
// now compute a differential update based on remote document's state vector
const update = Y.encodeStateAsUpdate(doc, remoteSV)
// both update and state vector are serializable, we can pass them over the wire
// now apply update to a remote document
Y.applyUpdate(remoteDoc, update)

const str = remoteText.toString()
console.log(str)
0.21.3

9 months ago

0.21.2

9 months ago

0.21.1

10 months ago

0.21.0

11 months ago

0.20.0

11 months ago

0.19.0

1 year ago

0.19.1

1 year ago

0.19.2

12 months ago

0.18.8

1 year ago

0.18.4

1 year ago

0.18.5

1 year ago

0.18.6

1 year ago

0.18.7

1 year ago

0.18.3

1 year ago

0.18.2

1 year ago

0.18.1

1 year ago

0.18.0

1 year ago

0.17.4

1 year ago

0.17.3

1 year ago

0.17.2

2 years ago

0.17.0

2 years ago

0.17.1

2 years ago

0.16.10

2 years ago

0.16.6

2 years ago

0.16.7

2 years ago

0.16.8

2 years ago

0.16.9

2 years ago

0.16.3

2 years ago

0.16.4

2 years ago

0.16.5

2 years ago

0.15.0

2 years ago

0.16.0

2 years ago

0.16.1

2 years ago

0.16.2

2 years ago

0.13.0

3 years ago

0.12.1

3 years ago

0.14.0

3 years ago

0.12.2

3 years ago

0.14.1

3 years ago

0.12.0

3 years ago

0.9.3

3 years ago

0.11.0

3 years ago

0.10.1

3 years ago

0.11.1

3 years ago

0.10.2

3 years ago

0.11.2

3 years ago

0.10.3

3 years ago

0.10.4

3 years ago

0.10.5

3 years ago

0.10.6

3 years ago

0.10.0

3 years ago

0.9.0

3 years ago

0.8.1

3 years ago

0.9.2

3 years ago

0.9.1

3 years ago

0.8.0

3 years ago

0.7.1

3 years ago

0.7.0

3 years ago

0.6.2

3 years ago

0.5.0

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.4.0

3 years ago

0.1.0

4 years ago