y-js / y-websockets-server Goto Github PK
View Code? Open in Web Editor NEWWebsocket connector for Yjs (Node server)
Websocket connector for Yjs (Node server)
It would be useful to have access to the joinRoom, yjsEvent and disconnect events on both server and client.
By intercepting data being sent to the client and adding your own from the server, you'd be able to leave the following y-richtext issues up to QuillJS & websockets. #8, #85, #87, #88 and #99.
Should also help out with issue #95.
Currently, the npm install command fails with the message
UNMET PEER DEPENDENCY [email protected]
which is (as I see it) caused by the optional leveldb dependency which is optionally required in version 0.0.0, but yjs 12 is only compatible with leveldb 0.0.1
[email protected] requires a peer of yjs@^11.0.0 && >=11.2.4 but none was installed.
Workaround: install via
npm i --save y-websockets-server --no-optional
Would be great to add as soon as possible a better logging mechamism for this.
Starting the websockets server Docker container, the only available console log output is of the form User X joins room: Y.
I would like to have also the timestamp included, or a better solution to log all messages. It is very important here that we have a location where the log file is stored and can be checked, regardless of the option taked for starting the Websocketsserver.
It took me a while to figure out how to execute the binary file.
Updating the README with this information would be helpful for others confused about how to perform this step.
y-websockets-server should emit 'leaveRoom' when a client disconnection un-gracefully.
In the README you install the y-websockets-server globally. Is that really necessary?
Make sure to handle those in server.js
Following the instructions in the README file, the Docker image builds, but crashes on startup.
> [email protected] start /usr/src/app
> DEBUG=y*,-y:connector-message node ./src/server.js
module.js:341
throw err;
^
Error: Cannot find module '../../yjs/y.node.js'
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Module.require (module.js:367:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/src/app/src/server.js:5:11)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
npm info lifecycle [email protected]~start: Failed to exec start script
npm ERR! Linux 4.9.87-linuxkit-aufs
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v5.12.0
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `DEBUG=y*,-y:connector-message node ./src/server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'DEBUG=y*,-y:connector-message node ./src/server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the y-websockets-server package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! DEBUG=y*,-y:connector-message node ./src/server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs y-websockets-server
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls y-websockets-server
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /usr/src/app/npm-debug.log
error: ‘class v8::Object’ has no member named ‘ForceSet’
it can't be installed for the package depends can't be installed in node version 10.x.x
Using y-websockets-server and y-websockets-client in a React app.
When running React app, it compiles with warnings:
Compiled with warnings.
./node_modules/yjs/src/y.js
74:10-29 Critical dependency: the request of a dependency is an expression
Line 74 of ./node_modules/yjs/src/y.js:
require(modulename)(Y)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.