@pluv/crdt 2.2.0 → 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 +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.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,17 @@
|
|
|
1
1
|
# @pluv/crdt
|
|
2
2
|
|
|
3
|
+
## 2.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @pluv/types@2.2.2
|
|
8
|
+
|
|
9
|
+
## 2.2.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- @pluv/types@2.2.1
|
|
14
|
+
|
|
3
15
|
## 2.2.0
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -30,7 +42,7 @@
|
|
|
30
42
|
|
|
31
43
|
- 047a1d8: Moved several internal types to `@pluv/types`.
|
|
32
44
|
- Updated dependencies [047a1d8]
|
|
33
|
-
|
|
45
|
+
- @pluv/types@2.0.0
|
|
34
46
|
|
|
35
47
|
## 1.0.2
|
|
36
48
|
|
|
@@ -50,14 +62,14 @@
|
|
|
50
62
|
|
|
51
63
|
- af94706: pluv.io is now stable and production ready!
|
|
52
64
|
|
|
53
|
-
|
|
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.
|
|
54
66
|
|
|
55
|
-
|
|
67
|
+
Checkout the [full documentation here](https://pluv.io/docs/introduction) to get started today!
|
|
56
68
|
|
|
57
69
|
### Patch Changes
|
|
58
70
|
|
|
59
71
|
- Updated dependencies [af94706]
|
|
60
|
-
|
|
72
|
+
- @pluv/types@1.0.0
|
|
61
73
|
|
|
62
74
|
## 0.44.2
|
|
63
75
|
|
|
@@ -256,7 +268,7 @@
|
|
|
256
268
|
### Patch Changes
|
|
257
269
|
|
|
258
270
|
- Updated dependencies [f4ceca3]
|
|
259
|
-
|
|
271
|
+
- @pluv/types@0.38.0
|
|
260
272
|
|
|
261
273
|
## 0.37.7
|
|
262
274
|
|
|
@@ -329,7 +341,7 @@
|
|
|
329
341
|
### Patch Changes
|
|
330
342
|
|
|
331
343
|
- Updated dependencies [81cb692]
|
|
332
|
-
|
|
344
|
+
- @pluv/types@0.35.2
|
|
333
345
|
|
|
334
346
|
## 0.35.1
|
|
335
347
|
|
|
@@ -541,70 +553,70 @@
|
|
|
541
553
|
|
|
542
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.
|
|
543
555
|
|
|
544
|
-
|
|
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.
|
|
545
557
|
|
|
546
|
-
|
|
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.
|
|
547
559
|
|
|
548
|
-
|
|
549
|
-
|
|
560
|
+
```ts
|
|
561
|
+
// Before
|
|
550
562
|
|
|
551
|
-
|
|
563
|
+
import { yjs } from "@pluv/crdt-yjs";
|
|
552
564
|
|
|
553
|
-
|
|
554
|
-
|
|
565
|
+
yjs.array([]); // Returns CrdtYjsArray
|
|
566
|
+
yjs.object([]); // Returns CrdtYjsObject
|
|
555
567
|
|
|
556
|
-
|
|
568
|
+
const room: PluvRoom = /* ... */;
|
|
557
569
|
|
|
558
|
-
|
|
570
|
+
room.getStorage("messages"); // Returns AbstractCrdtType
|
|
559
571
|
|
|
560
|
-
|
|
561
|
-
|
|
572
|
+
const [, sharedType] = useStorage("messages"); // sharedType is an AbstractCrdtType
|
|
573
|
+
```
|
|
562
574
|
|
|
563
|
-
|
|
564
|
-
|
|
575
|
+
```ts
|
|
576
|
+
// Now
|
|
565
577
|
|
|
566
|
-
|
|
578
|
+
import { yjs } from "@pluv/crdt-yjs";
|
|
567
579
|
|
|
568
|
-
|
|
569
|
-
|
|
580
|
+
yjs.array([]); // Returns yjs.Array
|
|
581
|
+
yjs.object([]); // Returns yjs.Map
|
|
570
582
|
|
|
571
|
-
|
|
583
|
+
const room: PluvRoom = /* ... */;
|
|
572
584
|
|
|
573
|
-
|
|
585
|
+
room.getStorage("messages"); // Returns yjs.AbstractType
|
|
574
586
|
|
|
575
|
-
|
|
576
|
-
|
|
587
|
+
const [, sharedType] = useStorage("messages"); // sharedType is a yjs.AbstractType
|
|
588
|
+
```
|
|
577
589
|
|
|
578
|
-
|
|
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:
|
|
579
591
|
|
|
580
|
-
|
|
581
|
-
|
|
592
|
+
```ts
|
|
593
|
+
// Before
|
|
582
594
|
|
|
583
|
-
|
|
595
|
+
const [data, container] = useStorage("messages");
|
|
584
596
|
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
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
|
+
```
|
|
588
600
|
|
|
589
|
-
|
|
590
|
-
|
|
601
|
+
```ts
|
|
602
|
+
// Now
|
|
591
603
|
|
|
592
|
-
|
|
604
|
+
const [data, container] = useStorage("messages");
|
|
593
605
|
|
|
594
|
-
|
|
595
|
-
|
|
606
|
+
const doc = useDoc();
|
|
607
|
+
const transact = useTransact();
|
|
596
608
|
|
|
597
|
-
|
|
598
|
-
|
|
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
|
|
599
611
|
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
612
|
+
// The two operations below are functionally equivalent
|
|
613
|
+
transact(() => {
|
|
614
|
+
container.push(loro.object({ name: "John Doe", age: 35 }));
|
|
615
|
+
});
|
|
604
616
|
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
617
|
+
container.push(loro.object({ name: "John Doe", age: 35 }));
|
|
618
|
+
doc.value.commit();
|
|
619
|
+
```
|
|
608
620
|
|
|
609
621
|
### Patch Changes
|
|
610
622
|
|
|
@@ -621,7 +633,7 @@
|
|
|
621
633
|
### Patch Changes
|
|
622
634
|
|
|
623
635
|
- Updated dependencies [99b5ca9]
|
|
624
|
-
|
|
636
|
+
- @pluv/types@0.18.0
|
|
625
637
|
|
|
626
638
|
## 0.17.3
|
|
627
639
|
|
|
@@ -646,7 +658,7 @@
|
|
|
646
658
|
### Patch Changes
|
|
647
659
|
|
|
648
660
|
- Updated dependencies [507bc00]
|
|
649
|
-
|
|
661
|
+
- @pluv/types@0.17.0
|
|
650
662
|
|
|
651
663
|
## 0.16.3
|
|
652
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",
|