Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54529ab1e7 | ||
|
|
e165c5ee2a | ||
|
|
7b3693aff3 | ||
|
|
f75f47646b | ||
|
|
64044123e3 | ||
|
|
a286162ace | ||
|
|
f739f3b5d7 | ||
|
|
f2052f95f8 | ||
|
|
81324dc7d4 |
@@ -49,7 +49,7 @@ Install yjs and its modules with [bower](http://bower.io/), or with [npm](https:
|
|||||||
|
|
||||||
### Bower
|
### Bower
|
||||||
```
|
```
|
||||||
bower install yjs
|
bower install yjs --save
|
||||||
```
|
```
|
||||||
Then you include the libraries directly from the installation folder.
|
Then you include the libraries directly from the installation folder.
|
||||||
```
|
```
|
||||||
|
|||||||
16
bower.json
16
bower.json
@@ -1,19 +1,19 @@
|
|||||||
{
|
{
|
||||||
"name": "yjs",
|
"name": "yjs",
|
||||||
"version": "0.8.21",
|
"version": "9.0.1",
|
||||||
"homepage": "y-js.org",
|
"homepage": "y-js.org",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Kevin Jahns <kevin.jahns@rwth-aachen.de>"
|
"Kevin Jahns <kevin.jahns@rwth-aachen.de>"
|
||||||
],
|
],
|
||||||
"description": "A Framework that enables Real-Time collaboration on arbitrary data structures.",
|
"description": "A Framework for shared editing on any data",
|
||||||
"main": "y.js",
|
"main": "./y.js",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"OT",
|
"OT",
|
||||||
"collaboration",
|
"Collaboration",
|
||||||
"synchronization",
|
"Synchronization",
|
||||||
"sharejs",
|
"Sharejs",
|
||||||
"coweb",
|
"Coweb",
|
||||||
"concurrency"
|
"Concurrency"
|
||||||
],
|
],
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
|
|||||||
21
y.es6
21
y.es6
@@ -52,6 +52,7 @@ module.exports = function (Y/* :any */) {
|
|||||||
this.broadcastedHB = false
|
this.broadcastedHB = false
|
||||||
this.syncStep2 = Promise.resolve()
|
this.syncStep2 = Promise.resolve()
|
||||||
this.broadcastOpBuffer = []
|
this.broadcastOpBuffer = []
|
||||||
|
this.protocolVersion = 8
|
||||||
}
|
}
|
||||||
reconnect () {
|
reconnect () {
|
||||||
}
|
}
|
||||||
@@ -208,6 +209,18 @@ module.exports = function (Y/* :any */) {
|
|||||||
if (this.debug) {
|
if (this.debug) {
|
||||||
console.log(`receive ${sender} -> ${this.userId}: ${message.type}`, JSON.parse(JSON.stringify(message))) // eslint-disable-line
|
console.log(`receive ${sender} -> ${this.userId}: ${message.type}`, JSON.parse(JSON.stringify(message))) // eslint-disable-line
|
||||||
}
|
}
|
||||||
|
if (message.protocolVersion != null && message.protocolVersion !== this.protocolVersion) {
|
||||||
|
console.error(
|
||||||
|
`You tried to sync with a yjs instance that has a different protocol version
|
||||||
|
(You: ${this.protocolVersion}, Client: ${message.protocolVersion}).
|
||||||
|
The sync was stopped. You need to upgrade your dependencies (especially Yjs & the Connector)!
|
||||||
|
`)
|
||||||
|
this.send(sender, {
|
||||||
|
type: 'sync stop',
|
||||||
|
protocolVersion: this.protocolVersion
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
if (message.type === 'sync step 1') {
|
if (message.type === 'sync step 1') {
|
||||||
// TODO: make transaction, stream the ops
|
// TODO: make transaction, stream the ops
|
||||||
let conn = this
|
let conn = this
|
||||||
@@ -783,8 +796,8 @@ module.exports = function (Y /* :any */) {
|
|||||||
missing: ids.length
|
missing: ids.length
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let key in ids) {
|
for (let i = 0; i < ids.length; i++) {
|
||||||
let id = ids[key]
|
let id = ids[i]
|
||||||
let sid = JSON.stringify(id)
|
let sid = JSON.stringify(id)
|
||||||
let l = this.listenersById[sid]
|
let l = this.listenersById[sid]
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
@@ -827,8 +840,8 @@ module.exports = function (Y /* :any */) {
|
|||||||
if (op == null) {
|
if (op == null) {
|
||||||
store.listenersById[sid] = l
|
store.listenersById[sid] = l
|
||||||
} else {
|
} else {
|
||||||
for (let key in l) {
|
for (let i = 0; i < l.length; i++) {
|
||||||
let listener = l[key]
|
let listener = l[i]
|
||||||
let o = listener.op
|
let o = listener.op
|
||||||
if (--listener.missing === 0) {
|
if (--listener.missing === 0) {
|
||||||
yield* store.tryExecute.call(this, o)
|
yield* store.tryExecute.call(this, o)
|
||||||
|
|||||||
Reference in New Issue
Block a user