Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51c8d3bdc6 | ||
|
|
0f86b71f78 | ||
|
|
fafda2726f | ||
|
|
116770fbce | ||
|
|
5286f507c8 | ||
|
|
2f7349b712 | ||
|
|
54529ab1e7 | ||
|
|
e165c5ee2a | ||
|
|
7b3693aff3 |
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"
|
||||||
|
|||||||
14
README.md
14
README.md
@@ -168,18 +168,20 @@ The promise returns an instance of Y. We denote it with a lower case `y`.
|
|||||||
* y.db.userId :: String
|
* y.db.userId :: String
|
||||||
* The used user id for this client. **Never overwrite this**
|
* The used user id for this client. **Never overwrite this**
|
||||||
|
|
||||||
|
|
||||||
# Status
|
|
||||||
Yjs is a work in progress. Different versions of the *y-* repositories may not work together. Just drop me a line if you run into troubles.
|
|
||||||
|
|
||||||
## Get help
|
## Get help
|
||||||
There are some friendly people on [](https://gitter.im/y-js/yjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) who may help you with your problem, and answer your questions.
|
There are some friendly people on [](https://gitter.im/y-js/yjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) who may help you with your problem, and answer your questions.
|
||||||
|
|
||||||
Please report _any_ issues to the [Github issue page](https://github.com/y-js/yjs/issues)! I try to fix them very soon, if possible.
|
Please report _any_ issues to the [Github issue page](https://github.com/y-js/yjs/issues)! I try to fix them very soon, if possible.
|
||||||
|
If you want to see an issue fixed, please subscribe to the thread (or remind me via gitter).
|
||||||
|
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
### 1.0.0
|
|
||||||
This is a complete rewrite of the 0.5 version of Yjs. Since Yjs 1.0 it is possible to work asynchronously on a persistent database, which enables offline support.
|
### 9.0.0
|
||||||
|
There were several rolling updates from 0.6 to 0.8. We'll now follow the semver versioning scheme. This is all what this jump from 0.8 to 9.0 is about.
|
||||||
|
|
||||||
|
### 0.6.0
|
||||||
|
This is a complete rewrite of the 0.5 version of Yjs. Since Yjs 0.6.0 it is possible to work asynchronously on a persistent database, which enables offline support.
|
||||||
* Switched to semver versioning
|
* Switched to semver versioning
|
||||||
* Requires a promise implementation in environment (es6 promises suffice, included in all the major browsers). Otherwise you have to include a polyfill
|
* Requires a promise implementation in environment (es6 promises suffice, included in all the major browsers). Otherwise you have to include a polyfill
|
||||||
* Y.Object has been renamed to Y.Map
|
* Y.Object has been renamed to Y.Map
|
||||||
|
|||||||
20
bower.json
20
bower.json
@@ -1,19 +1,21 @@
|
|||||||
{
|
{
|
||||||
"name": "yjs",
|
"name": "yjs",
|
||||||
"version": "0.8.27",
|
"version": "9.0.4",
|
||||||
"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": []
|
||||||
}
|
}
|
||||||
|
|||||||
33
y.es6
33
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
|
||||||
@@ -2695,13 +2708,21 @@ function Y (opts/* :YOptions */) /* :Promise<YConfig> */ {
|
|||||||
}
|
}
|
||||||
Y.sourceDir = opts.sourceDir
|
Y.sourceDir = opts.sourceDir
|
||||||
return Y.requestModules(modules).then(function () {
|
return Y.requestModules(modules).then(function () {
|
||||||
return new Promise(function (resolve) {
|
return new Promise(function (resolve, reject) {
|
||||||
var yconfig = new YConfig(opts)
|
if (opts == null) reject('An options object is expected! ')
|
||||||
yconfig.db.whenUserIdSet(function () {
|
else if (opts.connector == null) reject('You must specify a connector! (missing connector property)')
|
||||||
yconfig.init(function () {
|
else if (opts.connector.name == null) reject('You must specify connector name! (missing connector.name property)')
|
||||||
resolve(yconfig)
|
else if (opts.db == null) reject('You must specify a database! (missing db property)')
|
||||||
|
else if (opts.connector.name == null) reject('You must specify db name! (missing db.name property)')
|
||||||
|
else if (opts.share == null) reject('You must specify a set of shared types!')
|
||||||
|
else {
|
||||||
|
var yconfig = new YConfig(opts)
|
||||||
|
yconfig.db.whenUserIdSet(function () {
|
||||||
|
yconfig.init(function () {
|
||||||
|
resolve(yconfig)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user