@pluv/crdt 2.2.1 → 2.2.3
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 +61 -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.3 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
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m1.55 KB[39m
|
|
12
|
-
[32mESM[39m ⚡️ Build success in 21ms
|
|
13
11
|
[32mCJS[39m [1mdist/index.js [22m[32m2.68 KB[39m
|
|
14
12
|
[32mCJS[39m ⚡️ Build success in 22ms
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m1.55 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 23ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 502ms
|
|
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,17 @@
|
|
|
1
1
|
# @pluv/crdt
|
|
2
2
|
|
|
3
|
+
## 2.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @pluv/types@2.2.3
|
|
8
|
+
|
|
9
|
+
## 2.2.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- @pluv/types@2.2.2
|
|
14
|
+
|
|
3
15
|
## 2.2.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -36,7 +48,7 @@
|
|
|
36
48
|
|
|
37
49
|
- 047a1d8: Moved several internal types to `@pluv/types`.
|
|
38
50
|
- Updated dependencies [047a1d8]
|
|
39
|
-
|
|
51
|
+
- @pluv/types@2.0.0
|
|
40
52
|
|
|
41
53
|
## 1.0.2
|
|
42
54
|
|
|
@@ -56,14 +68,14 @@
|
|
|
56
68
|
|
|
57
69
|
- af94706: pluv.io is now stable and production ready!
|
|
58
70
|
|
|
59
|
-
|
|
71
|
+
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
72
|
|
|
61
|
-
|
|
73
|
+
Checkout the [full documentation here](https://pluv.io/docs/introduction) to get started today!
|
|
62
74
|
|
|
63
75
|
### Patch Changes
|
|
64
76
|
|
|
65
77
|
- Updated dependencies [af94706]
|
|
66
|
-
|
|
78
|
+
- @pluv/types@1.0.0
|
|
67
79
|
|
|
68
80
|
## 0.44.2
|
|
69
81
|
|
|
@@ -262,7 +274,7 @@
|
|
|
262
274
|
### Patch Changes
|
|
263
275
|
|
|
264
276
|
- Updated dependencies [f4ceca3]
|
|
265
|
-
|
|
277
|
+
- @pluv/types@0.38.0
|
|
266
278
|
|
|
267
279
|
## 0.37.7
|
|
268
280
|
|
|
@@ -335,7 +347,7 @@
|
|
|
335
347
|
### Patch Changes
|
|
336
348
|
|
|
337
349
|
- Updated dependencies [81cb692]
|
|
338
|
-
|
|
350
|
+
- @pluv/types@0.35.2
|
|
339
351
|
|
|
340
352
|
## 0.35.1
|
|
341
353
|
|
|
@@ -547,70 +559,70 @@
|
|
|
547
559
|
|
|
548
560
|
- 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
561
|
|
|
550
|
-
|
|
562
|
+
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
563
|
|
|
552
|
-
|
|
564
|
+
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
565
|
|
|
554
|
-
|
|
555
|
-
|
|
566
|
+
```ts
|
|
567
|
+
// Before
|
|
556
568
|
|
|
557
|
-
|
|
569
|
+
import { yjs } from "@pluv/crdt-yjs";
|
|
558
570
|
|
|
559
|
-
|
|
560
|
-
|
|
571
|
+
yjs.array([]); // Returns CrdtYjsArray
|
|
572
|
+
yjs.object([]); // Returns CrdtYjsObject
|
|
561
573
|
|
|
562
|
-
|
|
574
|
+
const room: PluvRoom = /* ... */;
|
|
563
575
|
|
|
564
|
-
|
|
576
|
+
room.getStorage("messages"); // Returns AbstractCrdtType
|
|
565
577
|
|
|
566
|
-
|
|
567
|
-
|
|
578
|
+
const [, sharedType] = useStorage("messages"); // sharedType is an AbstractCrdtType
|
|
579
|
+
```
|
|
568
580
|
|
|
569
|
-
|
|
570
|
-
|
|
581
|
+
```ts
|
|
582
|
+
// Now
|
|
571
583
|
|
|
572
|
-
|
|
584
|
+
import { yjs } from "@pluv/crdt-yjs";
|
|
573
585
|
|
|
574
|
-
|
|
575
|
-
|
|
586
|
+
yjs.array([]); // Returns yjs.Array
|
|
587
|
+
yjs.object([]); // Returns yjs.Map
|
|
576
588
|
|
|
577
|
-
|
|
589
|
+
const room: PluvRoom = /* ... */;
|
|
578
590
|
|
|
579
|
-
|
|
591
|
+
room.getStorage("messages"); // Returns yjs.AbstractType
|
|
580
592
|
|
|
581
|
-
|
|
582
|
-
|
|
593
|
+
const [, sharedType] = useStorage("messages"); // sharedType is a yjs.AbstractType
|
|
594
|
+
```
|
|
583
595
|
|
|
584
|
-
|
|
596
|
+
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
597
|
|
|
586
|
-
|
|
587
|
-
|
|
598
|
+
```ts
|
|
599
|
+
// Before
|
|
588
600
|
|
|
589
|
-
|
|
601
|
+
const [data, container] = useStorage("messages");
|
|
590
602
|
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
603
|
+
// This automatically called Loro.commit under the hood and rerendered the page with updated data.
|
|
604
|
+
container.push(loro.object({ name: "John Doe", age: 35 }));
|
|
605
|
+
```
|
|
594
606
|
|
|
595
|
-
|
|
596
|
-
|
|
607
|
+
```ts
|
|
608
|
+
// Now
|
|
597
609
|
|
|
598
|
-
|
|
610
|
+
const [data, container] = useStorage("messages");
|
|
599
611
|
|
|
600
|
-
|
|
601
|
-
|
|
612
|
+
const doc = useDoc();
|
|
613
|
+
const transact = useTransact();
|
|
602
614
|
|
|
603
|
-
|
|
604
|
-
|
|
615
|
+
// Updates need to be committed back to the doc whenever the changes need to be emitted to other users
|
|
616
|
+
// The returned data also will not update until the changes are commited
|
|
605
617
|
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
618
|
+
// The two operations below are functionally equivalent
|
|
619
|
+
transact(() => {
|
|
620
|
+
container.push(loro.object({ name: "John Doe", age: 35 }));
|
|
621
|
+
});
|
|
610
622
|
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
623
|
+
container.push(loro.object({ name: "John Doe", age: 35 }));
|
|
624
|
+
doc.value.commit();
|
|
625
|
+
```
|
|
614
626
|
|
|
615
627
|
### Patch Changes
|
|
616
628
|
|
|
@@ -627,7 +639,7 @@
|
|
|
627
639
|
### Patch Changes
|
|
628
640
|
|
|
629
641
|
- Updated dependencies [99b5ca9]
|
|
630
|
-
|
|
642
|
+
- @pluv/types@0.18.0
|
|
631
643
|
|
|
632
644
|
## 0.17.3
|
|
633
645
|
|
|
@@ -652,7 +664,7 @@
|
|
|
652
664
|
### Patch Changes
|
|
653
665
|
|
|
654
666
|
- Updated dependencies [507bc00]
|
|
655
|
-
|
|
667
|
+
- @pluv/types@0.17.0
|
|
656
668
|
|
|
657
669
|
## 0.16.3
|
|
658
670
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/crdt",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.3",
|
|
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.3"
|
|
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.3",
|
|
27
|
+
"eslint-config-pluv": "^2.2.3"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|