-
Notifications
You must be signed in to change notification settings - Fork 8
fork & merge threads: staging->master update pattern #19
Comments
Incidentally, I looked into trying to create a draft mechanism for an Automerge / Hypermerge document store. Automerge doesn't directly support forking and architecturally favors convergence of replicas over other use cases. According to one of the automerge devs:
Notes & code here: https://repl.it/@100ideas/playing-with-automerge |
Hi @100ideas, super long delay in updates and responding. But wondering if some recent changes here might get you closer to what you're looking for now. So by separating out the 'Store' from the 'Database', you can have a 'local only' 'Store' for any staged changes (using its own dispatcher), and then when finalized, push the accepted changes onto a 'live' thread for replication etc. |
Happy to discuss these ideas further with you on or offline! |
Closing this as "stale". In fact, ongoing work as part of The Great Refactor (#414) should cover this usage pattern quite nicely. |
problem: how to implement "draft" or "staging" system for a textile thread. In draft mode, local changes to a thread or threads drive the UI like normal without changing the original threads. If the user commits the draft, the original threads are updated and changes are transmitted across network. Otherwise the draft/staging branch is discarded.
More generally, I'd like to be able to:
Describe the solution you'd like
A Thread or set of dependant Threads can be transiently forked or copied into a new set of Threads. The app + UI switches to using these, thus allowing the frontend<->textile data bindings to remain the same. At some point, these threads are merged back into the originals, or discarded. Either way, the app switches back to using the original threads. Perhaps the merge operation works simply by updating the original Threads with just the HEAD values from the draft threads - i.e. no history is merged.
As an example, consider a textile webapp, say draft-js text editor w/ support for images. It uses textile for "everything" (replicated data store + redux event sourcing style bindings for frontend view), making use of several Threads in the process.
Goal: implement a local only "draft stage" that lets the user make changes to their document & files via the ui, see the results, then optionally commit them or revert them. conceptually like git staging. Draft changes do not need to be synchronized across network, although that would be cool.
Describe alternatives you've considered
Instead of implenting directly with Threads, an App could implement a client-only data layer on top of textile that shadows the Threads. In draft mode, the UI makes changes to and previews the results of editing this draft data layer. To commit the draft, the shadow layer is applied to the appropriate Textile threads. Upsides to this approach: may be simpler than that proposed above. Downsides: clientside "shadow threads" require their own UI & data bindings for draft mode. Should shadow threads provide the same / subset API as textile client?
Additional context
I originally asked about this on Textile slack chat. Below is a transcript:
The text was updated successfully, but these errors were encountered: