Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Real-time collaborative textarea? #167

Closed
earthling4211573 opened this issue Nov 10, 2013 · 4 comments
Closed

Real-time collaborative textarea? #167

earthling4211573 opened this issue Nov 10, 2013 · 4 comments

Comments

@earthling4211573
Copy link

Is it possible to do something similar to Google Docs type collaboration of text in hoodie? A kind of real-time collaborative textarea.

I tried something like this:

hoodie.store.on('update:plaindoc:'+currentDoc, function (obj) { 
            editor.getSession().setValue(obj.text);
});

and opened up two browser windows and started typing but it wasn't really responsive enough to be useful, even on localhost.

Is it possible if I approach it differently?

@earthling4211573
Copy link
Author

After looking into it a bit more it seems like I should use ShareJS with Hoodie: http://sharejs.org/

@janl
Copy link
Member

janl commented Nov 11, 2013

On 11 Nov 2013, at 06:22 , gautamadude [email protected] wrote:

After looking into it a bit more it seems like I should use ShareJS with Hoodie: http://sharejs.org/

Yeah, good call. You could try and take out the 2 second delay that Hoodie adds by default for syncing to get things more fluently, but I’d say using share.js for the realtime editing and then snapshotting the textarea to hoodie.store periodically on each client would be the thing to do here.

@gr2m
Copy link
Member

gr2m commented Nov 22, 2013

I'll remove the 2s timeout, it was an app-specific thing, that should help.

But besides the timeout, hoodie does not allow for partial updates that'd allow mulitple users to add the same text at the same time. Each update is a replace of the current object, if multiple people work on it simultaneously, it will end up with lots of conflicts and data loss.

I don't know if you can come up with a better data model for it, e.g. create new objects for each change to the text and then have logic in the browser that puts it together. But hoodie doesn't do that by default

@janl
Copy link
Member

janl commented Nov 22, 2013

@gr2m I don’ t think the realtime collar part is a good fit for hoodie and that share.js or something like it is better and Hoodie can be used to store snapshots and backups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants