• Stars
    star
    205
  • Rank 185,566 (Top 4 %)
  • Language
    Swift
  • License
    MIT License
  • Created about 1 year ago
  • Updated 20 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Swift language bindings presenting Automerge

Automerge-swift

An Automerge implementation for swift.

This is a low-level library with few concessions to ergonomics, meant to interact directly with the low-level Automerge API. Additional API that is more ergonomic is being added into the repository as this project evolves.

Automerge-Swift API Documentation is available on the Automerge site. A command-line demonstration application (contaaacts) is available that shows using the lower level API.

Note: There was an earlier Swift language bindings for Automerge here at automerge/automerge-swift. The repository was renamed and archived, but is available if you are looking for it.

Quickstart

Add a dependency in Package.swift, as the following example shows:

let package = Package(
    ...
    dependencies: [
        ...
        .package(url: "https://github.com/automerge/automerge-swift.git", from: "0.5.2")
    ],
    targets: [
        .executableTarget(
            ...
            dependencies: [.product(name: "Automerge", package: "automerge-swift")],
            ...
        )
    ]
)

Now you can create a document and do all sorts of Automerge things with it

let doc = Document()
let list = try! doc.putObject(obj: ObjId.ROOT, key: "colours", ty: .List)
try! doc.insert(obj: list, index: 0, .String("blue"))
try! doc.insert(obj: list, index: 1, .String("red"))

let doc2 = doc.fork()
try! doc2.insert(obj: list, index: 0, .String("green"))

try! doc.delete(obj: list, index: 0)

try! doc.merge(doc2) // `doc` now contains {"colours": ["green", "red"]}

For more details on the API, see the Automerge-swift API documentation and the articles within.

More Repositories

1

automerge-classic

A JSON-like data structure (a CRDT) that can be modified concurrently by different users, and merged again automatically.
JavaScript
14,768
star
2

automerge

A JSON-like data structure (a CRDT) that can be modified concurrently by different users, and merged again automatically.
JavaScript
3,205
star
3

hypermerge

Build p2p collaborative applications without any server infrastructure in Node.js
TypeScript
1,277
star
4

pushpin

A collaborative corkboard app
TypeScript
619
star
5

trellis

Trello clone / sample app for Automerge persistence library
JavaScript
497
star
6

automerge-repo

TypeScript
401
star
7

mpl

a p2p document synchronization system for automerge
JavaScript
278
star
8

autosurgeon

Rust
249
star
9

pixelpusher

pushin' pix
JavaScript
219
star
10

automerge-swift-archived

Wrapper around Swift types that can be modified concurrently by different users, and merged again automatically (a CRDT).
Swift
159
star
11

automerge-go

Go
79
star
12

MeetingNotes

An example application that uses Automerge-Swift to provide collaborative note taking for meetings.
Swift
50
star
13

automerge-py

Rust
35
star
14

automerge-perf

Performance tests for Automerge
JavaScript
35
star
15

automerge-repo-rs

Rust
31
star
16

pinecone

An example Electron + React + Hypermerge application designed to be a starting point for your own ideas.
TypeScript
29
star
17

automerge-net

Network examples for Automerge
JavaScript
25
star
18

automerge-codemirror

TypeScript
21
star
19

automerge-prosemirror

TypeScript
20
star
20

automerge-java

Java
15
star
21

automerge.github.io

JavaScript
14
star
22

automerge-connection

A generic network synchronisation protocol for Automerge
JavaScript
12
star
23

sync-server

Simple WebSocket server for syncing Automerge clients
JavaScript
12
star
24

automerge-repo-swift

Extends the Automerge-swift library, providing support for working with multiple Automerge documents at once, with pluggable network and storage providers.
Swift
11
star
25

automerge-repo-sync-server

JavaScript
9
star
26

contaaacts

An automerge-swifter demo app
Swift
5
star
27

pixelpusherd

An archiver daemon for pixelpusher
JavaScript
5
star
28

automerge-swift-backend

A XCFramework wrapper for the rs-backend
Shell
5
star
29

automerge-repo-quickstart

TypeScript
5
star
30

prosemirror-quickstart

An example of using Automerge + Prosemirror
TypeScript
3
star
31

automerge-repo-network-peerjs

Network adapter for automerge-repo using peerjs
TypeScript
1
star