Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fafda2726f | ||
|
|
116770fbce | ||
|
|
5286f507c8 | ||
|
|
2f7349b712 | ||
|
|
54529ab1e7 | ||
|
|
e165c5ee2a | ||
|
|
7b3693aff3 | ||
|
|
f75f47646b |
7
.gitignore
vendored
7
.gitignore
vendored
@@ -1,8 +1 @@
|
|||||||
node_modules
|
|
||||||
bower_components
|
bower_components
|
||||||
.directory
|
|
||||||
.codio
|
|
||||||
.settings
|
|
||||||
.jshintignore
|
|
||||||
.jshintrc
|
|
||||||
.validate.json
|
|
||||||
|
|||||||
@@ -7,8 +7,7 @@ Y({
|
|||||||
},
|
},
|
||||||
connector: {
|
connector: {
|
||||||
name: 'websockets-client',
|
name: 'websockets-client',
|
||||||
room: 'Textarea-example',
|
room: 'Textarea-example'
|
||||||
url: '127.0.0.1:1234'
|
|
||||||
},
|
},
|
||||||
sourceDir: '/bower_components',
|
sourceDir: '/bower_components',
|
||||||
share: {
|
share: {
|
||||||
|
|||||||
@@ -9,15 +9,15 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"yjs": "~0.7.6",
|
"yjs": "latest",
|
||||||
"y-array": "~0.7.5",
|
"y-array": "latest",
|
||||||
"y-map": "~0.7.2",
|
"y-map": "latest",
|
||||||
"y-memory": "~0.7.0",
|
"y-memory": "latest",
|
||||||
"y-richtext": "~0.7.5",
|
"y-richtext": "latest",
|
||||||
"y-webrtc": "~0.7.1",
|
"y-webrtc": "latest",
|
||||||
"y-websockets-client": "~0.7.10",
|
"y-websockets-client": "latest",
|
||||||
"y-text": "~0.7.1",
|
"y-text": "latest",
|
||||||
"y-indexeddb": "~0.7.1",
|
"y-indexeddb": "latest",
|
||||||
"quill": "~0.20.1",
|
"quill": "~0.20.1",
|
||||||
"ace": "~1.2.3",
|
"ace": "~1.2.3",
|
||||||
"ace-builds": "~1.2.3"
|
"ace-builds": "~1.2.3"
|
||||||
|
|||||||
20
bower.json
20
bower.json
@@ -1,19 +1,21 @@
|
|||||||
{
|
{
|
||||||
"name": "yjs",
|
"name": "yjs",
|
||||||
"version": "0.8.26",
|
"version": "9.0.3",
|
||||||
"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": [
|
||||||
|
"Yjs",
|
||||||
"OT",
|
"OT",
|
||||||
"collaboration",
|
"Collaboration",
|
||||||
"synchronization",
|
"Synchronization",
|
||||||
"sharejs",
|
"ShareJS",
|
||||||
"coweb",
|
"Coweb",
|
||||||
"concurrency"
|
"Concurrency"
|
||||||
],
|
],
|
||||||
"license": "MIT"
|
"license": "MIT",
|
||||||
|
"ignore": []
|
||||||
}
|
}
|
||||||
|
|||||||
13
y.es6
13
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
|
||||||
|
|||||||
Reference in New Issue
Block a user