Skip to content

Commit 41d198d

Browse files
chore: version packages (#333)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 35b9b6e commit 41d198d

File tree

5 files changed

+79
-38
lines changed

5 files changed

+79
-38
lines changed

.changeset/tidy-cameras-scream.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

crates/loro-wasm/CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
# Changelog
22

3+
## 0.15.0
4+
5+
### Minor Changes
6+
7+
- 35b9b6e: Movable List (#293)
8+
9+
Loro's List supports insert and delete operations but lacks built-in methods for `set` and `move`. To simulate set and move, developers might combine delete and insert. However, this approach can lead to issues during concurrent operations on the same element, often resulting in duplicate entries upon merging.
10+
11+
For instance, consider a list [0, 1, 2]. If user A moves the element '0' to position 1, while user B moves it to position 2, the ideal merged outcome should be either [1, 0, 2] or [1, 2, 0]. However, using the delete-insert method to simulate a move results in [1, 0, 2, 0], as both users delete '0' from its original position and insert it independently at new positions.
12+
13+
To address this, we introduce a MovableList container. This new container type directly supports move and set operations, aligning more closely with user expectations and preventing the issues associated with simulated moves.
14+
15+
## Example
16+
17+
```ts
18+
import { Loro } from "loro-crdt";
19+
import { expect } from "vitest";
20+
21+
const doc = new Loro();
22+
const list = doc.getMovableList("list");
23+
list.push("a");
24+
list.push("b");
25+
list.push("c");
26+
expect(list.toArray()).toEqual(["a", "b", "c"]);
27+
list.set(2, "d");
28+
list.move(0, 1);
29+
const doc2 = new Loro();
30+
const list2 = doc2.getMovableList("list");
31+
expect(list2.length).toBe(0);
32+
doc2.import(doc.exportFrom());
33+
expect(list2.length).toBe(3);
34+
expect(list2.get(0)).toBe("b");
35+
expect(list2.get(1)).toBe("a");
36+
expect(list2.get(2)).toBe("d");
37+
```
38+
339
## 0.14.6
440

541
### Patch Changes

crates/loro-wasm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "loro-wasm",
3-
"version": "0.14.6",
3+
"version": "0.15.0",
44
"description": "Loro CRDTs is a high-performance CRDT framework that makes your app state synchronized, collaborative and maintainable effortlessly.",
55
"keywords": [
66
"crdt",

loro-js/CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,46 @@
11
# Changelog
22

3+
## 0.15.0
4+
5+
### Minor Changes
6+
7+
- 35b9b6e: Movable List (#293)
8+
9+
Loro's List supports insert and delete operations but lacks built-in methods for `set` and `move`. To simulate set and move, developers might combine delete and insert. However, this approach can lead to issues during concurrent operations on the same element, often resulting in duplicate entries upon merging.
10+
11+
For instance, consider a list [0, 1, 2]. If user A moves the element '0' to position 1, while user B moves it to position 2, the ideal merged outcome should be either [1, 0, 2] or [1, 2, 0]. However, using the delete-insert method to simulate a move results in [1, 0, 2, 0], as both users delete '0' from its original position and insert it independently at new positions.
12+
13+
To address this, we introduce a MovableList container. This new container type directly supports move and set operations, aligning more closely with user expectations and preventing the issues associated with simulated moves.
14+
15+
## Example
16+
17+
```ts
18+
import { Loro } from "loro-crdt";
19+
import { expect } from "vitest";
20+
21+
const doc = new Loro();
22+
const list = doc.getMovableList("list");
23+
list.push("a");
24+
list.push("b");
25+
list.push("c");
26+
expect(list.toArray()).toEqual(["a", "b", "c"]);
27+
list.set(2, "d");
28+
list.move(0, 1);
29+
const doc2 = new Loro();
30+
const list2 = doc2.getMovableList("list");
31+
expect(list2.length).toBe(0);
32+
doc2.import(doc.exportFrom());
33+
expect(list2.length).toBe(3);
34+
expect(list2.get(0)).toBe("b");
35+
expect(list2.get(1)).toBe("a");
36+
expect(list2.get(2)).toBe("d");
37+
```
38+
39+
### Patch Changes
40+
41+
- Updated dependencies [35b9b6e]
42+
43+
344
## 0.14.6
445

546
### Patch Changes

loro-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "loro-crdt",
3-
"version": "0.14.6",
3+
"version": "0.15.0",
44
"description": "Loro CRDTs is a high-performance CRDT framework that makes your app state synchronized, collaborative and maintainable effortlessly.",
55
"keywords": [
66
"crdt",

0 commit comments

Comments
 (0)