Replies: 1 comment 1 reply
-
How would the supported formats be selected in the "curated format support" option? cf. "You use what is chosen for you by the Earthstar project." Would that mean waiting for a new release if some other format gets in (through voting) ? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In order for Earthstar to support documents associated with big blobs, I'll be adding a new document format.
Whatever this format will look like, we'll want to use it alongside the existing
es.4
document format so that people can keep using the documents they've written already.This means Earthstar replicas need to support multiple format validators when ingesting and setting documents. This is quite a big change, as the codebase currently assumes all documents will follow the
es.4
document format at every level.I started experimenting with different implementations of this a few days ago. I have two different approaches so far, each with different trade-offs:
Omnivorous multi-format support
With this approach, users can provide whichever formats they want, even their own. Constructing an replica looks like this:
Pros
Cons
Peer
will only be able to accept replicas of the same type. If you have a replica which only deals withes.4
, and one which deals withes.4
andesblob
, you will need to construct separate Peers to manage them.new Peer<typeof ValidatorEs4>()
or arguments it can infer the type from (e.g.new Peer([ValidatorEs4])
). Maybe peers could take aonCreateShare
callback, so that you could add replicas to a peer using just a share address?Curated multi-format support
In this approach the formats Earthstar replicas use have been decided up front for you . Constructing an replica looks like this:
Pros
Cons
I really like the omnivorous approaches' flexibility. But speaking as the sole maintainer of the Earthstar project, the complexity it adds to the codebase concerns me. And no-one has ever expressed any interest in using Earthstar with their own format.
The curated approach is more proscriptive, but makes the API and concepts simpler. The implementation is significantly simpler. And it doesn't close the door to adopting true omnivorous approach in the future, e.g. if Typescript's generic typings get better.
I know which way I'm leaning, but I'm interested if anyone feels one way is better than the other.
3 votes ·
Beta Was this translation helpful? Give feedback.
All reactions