Merge branch 'yjs:main' into main

This commit is contained in:
Nik Graf 2023-10-07 20:41:08 +02:00 committed by GitHub
commit 22814bbfe6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 15 deletions

View File

@ -149,8 +149,8 @@ concepts that can be used to create a custom network protocol:
* `update`: The Yjs document can be encoded to an *update* object that can be
parsed to reconstruct the document. Also every change on the document fires
an incremental document updates that allows clients to sync with each other.
The update object is an Uint8Array that efficiently encodes `Item` objects and
an incremental document update that allows clients to sync with each other.
The update object is a Uint8Array that efficiently encodes `Item` objects and
the delete set.
* `state vector`: A state vector defines the known state of each user (a set of
tuples `(client, clock)`). This object is also efficiently encoded as a

View File

@ -789,7 +789,7 @@ const diff2 = Y.diffUpdate(currentState2, stateVector1)
// sync clients
currentState1 = Y.mergeUpdates([currentState1, diff2])
currentState1 = Y.mergeUpdates([currentState1, diff1])
currentState2 = Y.mergeUpdates([currentState2, diff1])
```
#### Obfuscating Updates

14
package-lock.json generated
View File

@ -1,15 +1,15 @@
{
"name": "yjs",
"version": "13.6.7",
"version": "13.6.8",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "yjs",
"version": "13.6.7",
"version": "13.6.8",
"license": "MIT",
"dependencies": {
"lib0": "^0.2.74"
"lib0": "^0.2.86"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^24.0.1",
@ -2481,9 +2481,9 @@
}
},
"node_modules/lib0": {
"version": "0.2.74",
"resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.74.tgz",
"integrity": "sha512-roj9i46/JwG5ik5KNTkxP2IytlnrssAkD/OhlAVtE+GqectrdkfR+pttszVLrOzMDeXNs1MPt6yo66MUolWSiA==",
"version": "0.2.86",
"resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.86.tgz",
"integrity": "sha512-kxigQTM4Q7NwJkEgdqQvU21qiR37twcqqLmh+/SbiGbRLfPlLVbHyY9sWp7PwXh0Xus9ELDSjsUOwcrdt5yZ4w==",
"dependencies": {
"isomorphic.js": "^0.2.4"
},
@ -2492,7 +2492,7 @@
"0serve": "bin/0serve.js"
},
"engines": {
"node": ">=14"
"node": ">=16"
},
"funding": {
"type": "GitHub Sponsors ❤",

View File

@ -1,6 +1,6 @@
{
"name": "yjs",
"version": "13.6.7",
"version": "13.6.8",
"description": "Shared Editing Library",
"main": "./dist/yjs.cjs",
"module": "./dist/yjs.mjs",
@ -75,7 +75,7 @@
},
"homepage": "https://docs.yjs.dev",
"dependencies": {
"lib0": "^0.2.74"
"lib0": "^0.2.86"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^24.0.1",

View File

@ -389,9 +389,8 @@ export class Item extends AbstractStruct {
}
if ((this.left && this.left.constructor === GC) || (this.right && this.right.constructor === GC)) {
this.parent = null
}
// only set parent if this shouldn't be garbage collected
if (!this.parent) {
} else if (!this.parent) {
// only set parent if this shouldn't be garbage collected
if (this.left && this.left.constructor === Item) {
this.parent = this.left.parent
this.parentSub = this.left.parentSub