Comments (2)
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.
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)
- add configurable find timeout when waiting for responses from peers
- flaky test - testCreateAndObserveChange
- Exception in Repo.updateDoc when document has been deleted locally HOT 4
- Document added to repo doesn't seem to get state from web socket peer until it sends state of own HOT 18
- DocumentId doesn't always convert down to String and back HOT 2
- test extended idle connection with WebSocket provider
- sync functional, but not near-realtime HOT 6
- Logging is useful when you need it, but an annoying flood otherwise
- websocket failing and never reconnecting HOT 3
- Should create multiple documents with same id throw error? HOT 36
- WebSocketProvider: Connect - Disconnect - Connect always fails HOT 1
- Infinite WEBSOCKET: Error reading websocket scenarios HOT 14
- Repo.find behavior HOT 5
- add network availability event feed into WebSocket to inform retry loops HOT 5
- add combine publisher to provide information about state updates in WebSocketNetworkProvider
- Add maximum retry configuration to WebSocket network provider
- Assert failing in WebSocketProvider.connect after repo.find HOT 6
- What is expected behavior if I create/delete/create using the same ID? HOT 1
- add a Storage Provider that works against an iOS or macOS provided fileURL HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from automerge-repo-swift.