Giter VIP home page Giter VIP logo

Comments (2)

heckj avatar heckj commented on August 19, 2024 1

Thanks @jessegrosjean - super useful insight as usual!

I replicated the top-level functions (without change or really, any thought) from the Javascript automerge-repo. The import, export, and clone also seemed somewhat repetitive to me, being used to working with getting data in and out of an Automerge doc directly doc.save(), doc.fork(), etc.

In the JS side of the world, this is also more of a server component, and in particular there's some interesting wrangling of mixing together full syncs and "local changes" and persisting those separately (and later recombining them) that's embedded in the concept of the storage adapter - and I suspect that may have impacted the concept of the import and export - those are always as compacted documents, where the storage adapter works quite differently (but does support concurrent updates of multiple peers to a single filesystem location)

The notable factor of clone is that it makes a new document ID alongside the forked document, in essence doing exactly the same thing you're outlining in repo.create(doc: docHandle.doc.fork()) - so yeah, definitely repetitive with that concept.

from automerge-repo-swift.

jessegrosjean avatar jessegrosjean commented on August 19, 2024

Same question about repo.clone()? It also seems to be a new api/terminology that isn't super necessary. And the underlying implementation uses doc.fork() which is a detail that seems like it might be of interest to clients. In my mind it might make more sense to:

  • remove clone and client code can just using existing API repo.create(doc: docHandle.doc.fork())
  • or rename clone to repo.fork(id: id) so that API is reusing existing automerge terminology to describe more exactly what is happening.

Of course these are just outsider thoughts/suggestions without me knowing to much. Close and ignore as needed :)

from automerge-repo-swift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.