Skip to content

Commit

Permalink
v0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjg committed Jul 30, 2023
1 parent 1d93a12 commit 2e9aa7a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 9 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## 0.0.4

* Upgrade to automerge rust 0.5.1
* `Transaction` no longer has a generic parameter and the `HashAndPatches`
version is gone. Instead call `Document.startTransaction(PatchLog)` to get
patches created during the transaction.
* Added `Document.startTransactionAt` to start a transaction at a given set of
heads rather than the current heads of the document
* All the `*ForPatches` methods have been removed and replaced with overloads
which take a `PatchLog` as an argument. To obtain patches first call these
various methods, passing in a `PatchLog` and then use `Document.makePatches`
to turn the patch log into a list of patches.
* Added `Document.diff` to obtain a list of patches representing the difference
between two different sets of heads of the document.
* Make `MapEntry` public

## 0.0.3

* Added SyncState.isInSync
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ Documentation is mostly just [the API docs](https://www.javadoc.io/doc/org.autom
<dependency>
<groupId>org.automerge</groupId>
<artifactId>automerge</artifactId>
<version>0.0.3</version>
<version>0.0.4</version>
</dependency>
```

### Gradle (including android)

```kotlin
dependencies {
implementation group: 'org.automerge', name: 'automerge', version: "0.0.3"
implementation group: 'org.automerge', name: 'automerge', version: "0.0.4"
}
```

### Leiningen

```
:dependencies [[org.automerge/automerge "0.0.3"]]
:dependencies [[org.automerge/automerge "0.0.4"]]
```

## A quick example
Expand All @@ -49,7 +49,7 @@ public class App {
Document doc = new Document();

ObjectId text;
try(Transaction<ChangeHash> tx = doc.startTransaction()) {
try(Transaction tx = doc.startTransaction()) {
// Create a text object under the "text" key of the root map
text = tx.set(ObjectId.ROOT, "text", ObjectType.TEXT);
tx.spliceText(text, 0, 0, "Hello world");
Expand All @@ -64,13 +64,13 @@ public class App {
System.out.println(doc2.text(text).get().toString()); // Prints "Hello world"

// Modify the doc in doc2
try(Transaction<ChangeHash> tx = doc2.startTransaction()) {
try(Transaction tx = doc2.startTransaction()) {
tx.spliceText(text, 5, 0, " beautiful");
tx.commit();
}

// Modify the doc in doc1
try(Transaction<ChangeHash> tx = doc.startTransaction()) {
try(Transaction tx = doc.startTransaction()) {
tx.spliceText(text, 5, 0, " there");
tx.commit();
}
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ publishing {
register<MavenPublication>("automerge") {
groupId = "org.automerge"
artifactId = "androidnative"
version = "0.0.3"
version = "0.0.4"
afterEvaluate {
from(components["release"])
}
Expand Down
2 changes: 1 addition & 1 deletion lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ spotless {
}
}

project.version = "0.0.3"
project.version = "0.0.4"

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[package]
name = "automerge_jni"
version = "0.1.0"
version = "0.2.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down

0 comments on commit 2e9aa7a

Please sign in to comment.