@pluv/crdt 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +55 -49
- package/package.json +6 -6
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/crdt@2.2.
|
|
2
|
+
> @pluv/crdt@2.2.2 build /home/runner/work/pluv/pluv/packages/crdt
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
-
[34mCLI[39m tsup v8.
|
|
7
|
+
[34mCLI[39m tsup v8.5.0
|
|
8
8
|
[34mCLI[39m Target: es6
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[32mESM[39m [1mdist/index.mjs [22m[32m1.55 KB[39m
|
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 26ms
|
|
13
13
|
[32mCJS[39m [1mdist/index.js [22m[32m2.68 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 26ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 504ms
|
|
17
17
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m2.64 KB[39m
|
|
18
18
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m2.64 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @pluv/crdt
|
|
2
2
|
|
|
3
|
+
## 2.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @pluv/types@2.2.2
|
|
8
|
+
|
|
3
9
|
## 2.2.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -36,7 +42,7 @@
|
|
|
36
42
|
|
|
37
43
|
- 047a1d8: Moved several internal types to `@pluv/types`.
|
|
38
44
|
- Updated dependencies [047a1d8]
|
|
39
|
-
|
|
45
|
+
- @pluv/types@2.0.0
|
|
40
46
|
|
|
41
47
|
## 1.0.2
|
|
42
48
|
|
|
@@ -56,14 +62,14 @@
|
|
|
56
62
|
|
|
57
63
|
- af94706: pluv.io is now stable and production ready!
|
|
58
64
|
|
|
59
|
-
|
|
65
|
+
With this v1 release, pluv.io will now follow [semantic versioning](https://semver.org/) with more comprehensive release notes for future changes to the library.
|
|
60
66
|
|
|
61
|
-
|
|
67
|
+
Checkout the [full documentation here](https://pluv.io/docs/introduction) to get started today!
|
|
62
68
|
|
|
63
69
|
### Patch Changes
|
|
64
70
|
|
|
65
71
|
- Updated dependencies [af94706]
|
|
66
|
-
|
|
72
|
+
- @pluv/types@1.0.0
|
|
67
73
|
|
|
68
74
|
## 0.44.2
|
|
69
75
|
|
|
@@ -262,7 +268,7 @@
|
|
|
262
268
|
### Patch Changes
|
|
263
269
|
|
|
264
270
|
- Updated dependencies [f4ceca3]
|
|
265
|
-
|
|
271
|
+
- @pluv/types@0.38.0
|
|
266
272
|
|
|
267
273
|
## 0.37.7
|
|
268
274
|
|
|
@@ -335,7 +341,7 @@
|
|
|
335
341
|
### Patch Changes
|
|
336
342
|
|
|
337
343
|
- Updated dependencies [81cb692]
|
|
338
|
-
|
|
344
|
+
- @pluv/types@0.35.2
|
|
339
345
|
|
|
340
346
|
## 0.35.1
|
|
341
347
|
|
|
@@ -547,70 +553,70 @@
|
|
|
547
553
|
|
|
548
554
|
- 9492085: **BREAKING**: `@pluv/crdt-yjs` and `@pluv/crdt-loro` have been updated so that the utilities to create shared-types/containers no-longer return a wrapper around the underlying shared-types and containers, but rather return the shared-types/containers directly.
|
|
549
555
|
|
|
550
|
-
|
|
556
|
+
This means that for methods such as `getStorage` from `@pluv/client` and `useStorage` from `@pluv/react`, the shared-types/containers are also returned instead of the wrapper types.
|
|
551
557
|
|
|
552
|
-
|
|
558
|
+
The motivation for these changes are so that pluv.io is supplementary to `yjs` and `loro-crdt`, instead of having these libraries be an internal implementation of pluv.io.
|
|
553
559
|
|
|
554
|
-
|
|
555
|
-
|
|
560
|
+
```ts
|
|
561
|
+
// Before
|
|
556
562
|
|
|
557
|
-
|
|
563
|
+
import { yjs } from "@pluv/crdt-yjs";
|
|
558
564
|
|
|
559
|
-
|
|
560
|
-
|
|
565
|
+
yjs.array([]); // Returns CrdtYjsArray
|
|
566
|
+
yjs.object([]); // Returns CrdtYjsObject
|
|
561
567
|
|
|
562
|
-
|
|
568
|
+
const room: PluvRoom = /* ... */;
|
|
563
569
|
|
|
564
|
-
|
|
570
|
+
room.getStorage("messages"); // Returns AbstractCrdtType
|
|
565
571
|
|
|
566
|
-
|
|
567
|
-
|
|
572
|
+
const [, sharedType] = useStorage("messages"); // sharedType is an AbstractCrdtType
|
|
573
|
+
```
|
|
568
574
|
|
|
569
|
-
|
|
570
|
-
|
|
575
|
+
```ts
|
|
576
|
+
// Now
|
|
571
577
|
|
|
572
|
-
|
|
578
|
+
import { yjs } from "@pluv/crdt-yjs";
|
|
573
579
|
|
|
574
|
-
|
|
575
|
-
|
|
580
|
+
yjs.array([]); // Returns yjs.Array
|
|
581
|
+
yjs.object([]); // Returns yjs.Map
|
|
576
582
|
|
|
577
|
-
|
|
583
|
+
const room: PluvRoom = /* ... */;
|
|
578
584
|
|
|
579
|
-
|
|
585
|
+
room.getStorage("messages"); // Returns yjs.AbstractType
|
|
580
586
|
|
|
581
|
-
|
|
582
|
-
|
|
587
|
+
const [, sharedType] = useStorage("messages"); // sharedType is a yjs.AbstractType
|
|
588
|
+
```
|
|
583
589
|
|
|
584
|
-
|
|
590
|
+
For `@pluv/crdt-loro` specifically, `@pluv/client` relies on [loro events and subscriptions](https://www.loro.dev/docs/tutorial/get_started#event) to detect changes. The `AbstractLoroCrdt` types previously called `Loro.commit` after each change as an abstraction, but now this no-longer happens. To ensure that changes to loro containers are properly handled in `@pluv/react`, make sure to commit your changes whenever possible:
|
|
585
591
|
|
|
586
|
-
|
|
587
|
-
|
|
592
|
+
```ts
|
|
593
|
+
// Before
|
|
588
594
|
|
|
589
|
-
|
|
595
|
+
const [data, container] = useStorage("messages");
|
|
590
596
|
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
597
|
+
// This automatically called Loro.commit under the hood and rerendered the page with updated data.
|
|
598
|
+
container.push(loro.object({ name: "John Doe", age: 35 }));
|
|
599
|
+
```
|
|
594
600
|
|
|
595
|
-
|
|
596
|
-
|
|
601
|
+
```ts
|
|
602
|
+
// Now
|
|
597
603
|
|
|
598
|
-
|
|
604
|
+
const [data, container] = useStorage("messages");
|
|
599
605
|
|
|
600
|
-
|
|
601
|
-
|
|
606
|
+
const doc = useDoc();
|
|
607
|
+
const transact = useTransact();
|
|
602
608
|
|
|
603
|
-
|
|
604
|
-
|
|
609
|
+
// Updates need to be committed back to the doc whenever the changes need to be emitted to other users
|
|
610
|
+
// The returned data also will not update until the changes are commited
|
|
605
611
|
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
612
|
+
// The two operations below are functionally equivalent
|
|
613
|
+
transact(() => {
|
|
614
|
+
container.push(loro.object({ name: "John Doe", age: 35 }));
|
|
615
|
+
});
|
|
610
616
|
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
617
|
+
container.push(loro.object({ name: "John Doe", age: 35 }));
|
|
618
|
+
doc.value.commit();
|
|
619
|
+
```
|
|
614
620
|
|
|
615
621
|
### Patch Changes
|
|
616
622
|
|
|
@@ -627,7 +633,7 @@
|
|
|
627
633
|
### Patch Changes
|
|
628
634
|
|
|
629
635
|
- Updated dependencies [99b5ca9]
|
|
630
|
-
|
|
636
|
+
- @pluv/types@0.18.0
|
|
631
637
|
|
|
632
638
|
## 0.17.3
|
|
633
639
|
|
|
@@ -652,7 +658,7 @@
|
|
|
652
658
|
### Patch Changes
|
|
653
659
|
|
|
654
660
|
- Updated dependencies [507bc00]
|
|
655
|
-
|
|
661
|
+
- @pluv/types@0.17.0
|
|
656
662
|
|
|
657
663
|
## 0.16.3
|
|
658
664
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/crdt",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "crdt base for @pluv/io",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@pluv/types": "^2.2.
|
|
20
|
+
"@pluv/types": "^2.2.2"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"eslint": "^9.
|
|
24
|
-
"tsup": "^8.
|
|
23
|
+
"eslint": "^9.27.0",
|
|
24
|
+
"tsup": "^8.5.0",
|
|
25
25
|
"typescript": "^5.8.3",
|
|
26
|
-
"@pluv/tsconfig": "^2.2.
|
|
27
|
-
"eslint-config-pluv": "^2.2.
|
|
26
|
+
"@pluv/tsconfig": "^2.2.2",
|
|
27
|
+
"eslint-config-pluv": "^2.2.2"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|