hasgeek / baseframe

Baseframe for Hasgeek projects
BSD 3-Clause "New" or "Revised" License
11 stars 17 forks source link

Realtime edit synchronization #50

Open jace opened 10 years ago

jace commented 10 years ago

Collaborative editing of forms is becoming increasingly necessary. While a large text field can be setup with something like Etherpad Lite, there's no obvious solution for forms with many fields. I propose we do this as a standard solution with Baseframe's render_form.

  1. This only applies to /edit endpoints. /new is not shared.
  2. When an edit page is loaded, render_form creates a redis-backed cache of the form (not the source object).
  3. As the form is edited, data (single field at a time) is submitted back to the server (preferably via a websocket) and the cache is updated without form validation.
  4. All other instances of the same page get a push notification (preferably via a websocket) with the updated data and will update the form in place.

This solution doesn't work for client-side forms such as dynamically added fields without additional work, but it's a useful start. It's also inefficient for textareas and may interfere with the user's own editing, so we may have to disable it there.

miteshashar commented 10 years ago
  1. Fair amount of complexities.
    1. State management will be a huge concern to handle. One needs to know what state he/she is looking at; draft or published, while both co-exist.
    2. Field contentions & locks.
    3. Mobile compatibility.
    4. Cross-compatibility with input-involving plugins like Codemirror, TinyMCE, etc.
  2. @jace Reminds me of the conversation on hipchat, where you mentioned we are less likely to need two-way websockets. Here is a big use case.

Interesting find. Sadly not in active development. Promising nodejs port of mobwrite. But, again not in active development.

Interesting slideshow Further finds from the slideshow:

cscott commented 10 years ago

https://togetherjs.com/ is related as well.