@pluv/crdt-loro 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 +6 -6
- package/CHANGELOG.md +107 -100
- package/package.json +7 -7
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/crdt-loro@2.2.
|
|
2
|
+
> @pluv/crdt-loro@2.2.2 build /home/runner/work/pluv/pluv/packages/crdt-loro
|
|
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
|
-
[32mCJS[39m [1mdist/index.js [22m[32m15.55 KB[39m
|
|
12
|
-
[32mCJS[39m ⚡️ Build success in 165ms
|
|
13
11
|
[32mESM[39m [1mdist/index.mjs [22m[32m14.35 KB[39m
|
|
14
|
-
[32mESM[39m ⚡️ Build success in
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 78ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m15.55 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 80ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 4059ms
|
|
17
17
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m4.60 KB[39m
|
|
18
18
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m4.60 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @pluv/crdt-loro
|
|
2
2
|
|
|
3
|
+
## 2.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @pluv/crdt@2.2.2
|
|
8
|
+
- @pluv/types@2.2.2
|
|
9
|
+
|
|
3
10
|
## 2.2.1
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -27,10 +34,10 @@
|
|
|
27
34
|
|
|
28
35
|
- 945c47d: Updated deprecation warnings to read that features will be removed in v3 instead of v2.
|
|
29
36
|
|
|
30
|
-
|
|
37
|
+
Due to an [extremely unfortunate bug in changesets](https://github.com/changesets/changesets/issues/1011), minor and patch changes will create major releases. This caused an unintended v2 release that had no breaking changes. To avoid backtracking and deleting deprecated functionalities right away, the deprecation warnings have been updated so that those APIs will be removed in v3 instead of v2.
|
|
31
38
|
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
- @pluv/crdt@2.0.2
|
|
40
|
+
- @pluv/types@2.0.2
|
|
34
41
|
|
|
35
42
|
## 2.0.1
|
|
36
43
|
|
|
@@ -45,42 +52,42 @@
|
|
|
45
52
|
|
|
46
53
|
- 0b234d1: **Deprecated** Declaring top-level types on your CRDT storage via the `loro` utility (e.g. `loro.list`) is now deprecated, to be removed in the next major release (v2). Continuing to use the `loro` utility to declare top-level types will log a warning to your console while in development mode (i.e. when `process.env.NODE_ENV === "development"`). To declare top-level types, you should now use the builder type exposed in the storage factory function. See the example below:
|
|
47
54
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
55
|
+
```ts
|
|
56
|
+
import { loro } from "@pluv/crdt-loro";
|
|
57
|
+
|
|
58
|
+
// Before
|
|
59
|
+
loro.doc(() => ({
|
|
60
|
+
// Using the `loro` utility (in this case `loro.map`) when declaring
|
|
61
|
+
// top-level types is now deprecated
|
|
62
|
+
topType: loro.map({
|
|
63
|
+
key1: loro.text(""),
|
|
64
|
+
key2: loro.text(""),
|
|
65
|
+
}),
|
|
66
|
+
}));
|
|
67
|
+
|
|
68
|
+
// After
|
|
69
|
+
loro.doc((t) => ({
|
|
70
|
+
// Top-level properties must now use the builder (in this case `t`).
|
|
71
|
+
// This effectively calls `loro.getMap("topType")` to instantiate the type on
|
|
72
|
+
// the root document.
|
|
73
|
+
// This simply returns the native Loro container type (e.g. LoroMap), which
|
|
74
|
+
// allows you operate on your loro container types in a more native way.
|
|
75
|
+
topType: t.map("topType", {
|
|
76
|
+
// Declaring nested types should continue to use the `loro` utilities
|
|
77
|
+
// you've used before
|
|
78
|
+
key1: loro.text(""),
|
|
79
|
+
key2: loro.text(""),
|
|
80
|
+
}),
|
|
81
|
+
}));
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The functions on the builder type calls the native loro container instantiating methods and returns the native types (e.g. `t.map("topType")` is simply just a `LoroDoc.getMap("topType")`) call under the hood. This allows you to declare your type in a more loro-native and predictable way, and enables declaring more complex initial storage states if needed.
|
|
78
85
|
|
|
79
86
|
### Patch Changes
|
|
80
87
|
|
|
81
88
|
- Updated dependencies [047a1d8]
|
|
82
|
-
|
|
83
|
-
|
|
89
|
+
- @pluv/types@2.0.0
|
|
90
|
+
- @pluv/crdt@2.0.0
|
|
84
91
|
|
|
85
92
|
## 1.0.2
|
|
86
93
|
|
|
@@ -102,15 +109,15 @@
|
|
|
102
109
|
|
|
103
110
|
- af94706: pluv.io is now stable and production ready!
|
|
104
111
|
|
|
105
|
-
|
|
112
|
+
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.
|
|
106
113
|
|
|
107
|
-
|
|
114
|
+
Checkout the [full documentation here](https://pluv.io/docs/introduction) to get started today!
|
|
108
115
|
|
|
109
116
|
### Patch Changes
|
|
110
117
|
|
|
111
118
|
- Updated dependencies [af94706]
|
|
112
|
-
|
|
113
|
-
|
|
119
|
+
- @pluv/crdt@1.0.0
|
|
120
|
+
- @pluv/types@1.0.0
|
|
114
121
|
|
|
115
122
|
## 0.44.2
|
|
116
123
|
|
|
@@ -341,8 +348,8 @@
|
|
|
341
348
|
### Patch Changes
|
|
342
349
|
|
|
343
350
|
- Updated dependencies [f4ceca3]
|
|
344
|
-
|
|
345
|
-
|
|
351
|
+
- @pluv/types@0.38.0
|
|
352
|
+
- @pluv/crdt@0.38.0
|
|
346
353
|
|
|
347
354
|
## 0.37.7
|
|
348
355
|
|
|
@@ -419,16 +426,16 @@
|
|
|
419
426
|
### Patch Changes
|
|
420
427
|
|
|
421
428
|
- 7c8e7ef: Upgraded `loro-crdt` from `1.3.1` to `1.3.2`.
|
|
422
|
-
|
|
423
|
-
|
|
429
|
+
- @pluv/crdt@0.35.3
|
|
430
|
+
- @pluv/types@0.35.3
|
|
424
431
|
|
|
425
432
|
## 0.35.2
|
|
426
433
|
|
|
427
434
|
### Patch Changes
|
|
428
435
|
|
|
429
436
|
- Updated dependencies [81cb692]
|
|
430
|
-
|
|
431
|
-
|
|
437
|
+
- @pluv/types@0.35.2
|
|
438
|
+
- @pluv/crdt@0.35.2
|
|
432
439
|
|
|
433
440
|
## 0.35.1
|
|
434
441
|
|
|
@@ -436,8 +443,8 @@
|
|
|
436
443
|
|
|
437
444
|
- 9822786: Added missing `Tree` and `MovableList` types.
|
|
438
445
|
- 3cd6571: Added support for undo/redo for `@pluv/crdt-loro`.
|
|
439
|
-
|
|
440
|
-
|
|
446
|
+
- @pluv/crdt@0.35.1
|
|
447
|
+
- @pluv/types@0.35.1
|
|
441
448
|
|
|
442
449
|
## 0.35.0
|
|
443
450
|
|
|
@@ -469,16 +476,16 @@
|
|
|
469
476
|
### Patch Changes
|
|
470
477
|
|
|
471
478
|
- f54d8ce: Update internal, deprecated `loro-crdt` methods.
|
|
472
|
-
|
|
473
|
-
|
|
479
|
+
- @pluv/crdt@0.33.0
|
|
480
|
+
- @pluv/types@0.33.0
|
|
474
481
|
|
|
475
482
|
## 0.32.9
|
|
476
483
|
|
|
477
484
|
### Patch Changes
|
|
478
485
|
|
|
479
486
|
- cef5911: Bump `loro-crdt` from `0.16.12` to `1.0.8`.
|
|
480
|
-
|
|
481
|
-
|
|
487
|
+
- @pluv/crdt@0.32.9
|
|
488
|
+
- @pluv/types@0.32.9
|
|
482
489
|
|
|
483
490
|
## 0.32.8
|
|
484
491
|
|
|
@@ -569,8 +576,8 @@
|
|
|
569
576
|
### Patch Changes
|
|
570
577
|
|
|
571
578
|
- 7246a9e: Added `CrdtLibraryType` so that `@pluv/crdt-yjs` and `@pluv/crdt-loro` export a new property `kind` containing an identifier for the crdt.
|
|
572
|
-
|
|
573
|
-
|
|
579
|
+
- @pluv/crdt@0.30.0
|
|
580
|
+
- @pluv/types@0.30.0
|
|
574
581
|
|
|
575
582
|
## 0.29.0
|
|
576
583
|
|
|
@@ -683,76 +690,76 @@
|
|
|
683
690
|
|
|
684
691
|
- 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.
|
|
685
692
|
|
|
686
|
-
|
|
693
|
+
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.
|
|
687
694
|
|
|
688
|
-
|
|
695
|
+
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.
|
|
689
696
|
|
|
690
|
-
|
|
691
|
-
|
|
697
|
+
```ts
|
|
698
|
+
// Before
|
|
692
699
|
|
|
693
|
-
|
|
700
|
+
import { yjs } from "@pluv/crdt-yjs";
|
|
694
701
|
|
|
695
|
-
|
|
696
|
-
|
|
702
|
+
yjs.array([]); // Returns CrdtYjsArray
|
|
703
|
+
yjs.object([]); // Returns CrdtYjsObject
|
|
697
704
|
|
|
698
|
-
|
|
705
|
+
const room: PluvRoom = /* ... */;
|
|
699
706
|
|
|
700
|
-
|
|
707
|
+
room.getStorage("messages"); // Returns AbstractCrdtType
|
|
701
708
|
|
|
702
|
-
|
|
703
|
-
|
|
709
|
+
const [, sharedType] = useStorage("messages"); // sharedType is an AbstractCrdtType
|
|
710
|
+
```
|
|
704
711
|
|
|
705
|
-
|
|
706
|
-
|
|
712
|
+
```ts
|
|
713
|
+
// Now
|
|
707
714
|
|
|
708
|
-
|
|
715
|
+
import { yjs } from "@pluv/crdt-yjs";
|
|
709
716
|
|
|
710
|
-
|
|
711
|
-
|
|
717
|
+
yjs.array([]); // Returns yjs.Array
|
|
718
|
+
yjs.object([]); // Returns yjs.Map
|
|
712
719
|
|
|
713
|
-
|
|
720
|
+
const room: PluvRoom = /* ... */;
|
|
714
721
|
|
|
715
|
-
|
|
722
|
+
room.getStorage("messages"); // Returns yjs.AbstractType
|
|
716
723
|
|
|
717
|
-
|
|
718
|
-
|
|
724
|
+
const [, sharedType] = useStorage("messages"); // sharedType is a yjs.AbstractType
|
|
725
|
+
```
|
|
719
726
|
|
|
720
|
-
|
|
727
|
+
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:
|
|
721
728
|
|
|
722
|
-
|
|
723
|
-
|
|
729
|
+
```ts
|
|
730
|
+
// Before
|
|
724
731
|
|
|
725
|
-
|
|
732
|
+
const [data, container] = useStorage("messages");
|
|
726
733
|
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
734
|
+
// This automatically called Loro.commit under the hood and rerendered the page with updated data.
|
|
735
|
+
container.push(loro.object({ name: "John Doe", age: 35 }));
|
|
736
|
+
```
|
|
730
737
|
|
|
731
|
-
|
|
732
|
-
|
|
738
|
+
```ts
|
|
739
|
+
// Now
|
|
733
740
|
|
|
734
|
-
|
|
741
|
+
const [data, container] = useStorage("messages");
|
|
735
742
|
|
|
736
|
-
|
|
737
|
-
|
|
743
|
+
const doc = useDoc();
|
|
744
|
+
const transact = useTransact();
|
|
738
745
|
|
|
739
|
-
|
|
740
|
-
|
|
746
|
+
// Updates need to be committed back to the doc whenever the changes need to be emitted to other users
|
|
747
|
+
// The returned data also will not update until the changes are commited
|
|
741
748
|
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
749
|
+
// The two operations below are functionally equivalent
|
|
750
|
+
transact(() => {
|
|
751
|
+
container.push(loro.object({ name: "John Doe", age: 35 }));
|
|
752
|
+
});
|
|
746
753
|
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
754
|
+
container.push(loro.object({ name: "John Doe", age: 35 }));
|
|
755
|
+
doc.value.commit();
|
|
756
|
+
```
|
|
750
757
|
|
|
751
758
|
### Patch Changes
|
|
752
759
|
|
|
753
760
|
- Updated dependencies [9492085]
|
|
754
|
-
|
|
755
|
-
|
|
761
|
+
- @pluv/crdt@0.20.0
|
|
762
|
+
- @pluv/types@0.20.0
|
|
756
763
|
|
|
757
764
|
## 0.19.0
|
|
758
765
|
|
|
@@ -766,8 +773,8 @@
|
|
|
766
773
|
### Patch Changes
|
|
767
774
|
|
|
768
775
|
- Updated dependencies [99b5ca9]
|
|
769
|
-
|
|
770
|
-
|
|
776
|
+
- @pluv/types@0.18.0
|
|
777
|
+
- @pluv/crdt@0.18.0
|
|
771
778
|
|
|
772
779
|
## 0.17.3
|
|
773
780
|
|
|
@@ -795,8 +802,8 @@
|
|
|
795
802
|
### Patch Changes
|
|
796
803
|
|
|
797
804
|
- Updated dependencies [507bc00]
|
|
798
|
-
|
|
799
|
-
|
|
805
|
+
- @pluv/types@0.17.0
|
|
806
|
+
- @pluv/crdt@0.17.0
|
|
800
807
|
|
|
801
808
|
## 0.16.3
|
|
802
809
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/crdt-loro",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "loro for @pluv/io",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,19 +19,19 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@types/node": "^22.15.18",
|
|
21
21
|
"js-base64": "^3.7.7",
|
|
22
|
-
"@pluv/crdt": "^2.2.
|
|
23
|
-
"@pluv/types": "^2.2.
|
|
22
|
+
"@pluv/crdt": "^2.2.2",
|
|
23
|
+
"@pluv/types": "^2.2.2"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"loro-crdt": "^1.0.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"eslint": "^9.
|
|
29
|
+
"eslint": "^9.27.0",
|
|
30
30
|
"loro-crdt": "^1.5.5",
|
|
31
|
-
"tsup": "^8.
|
|
31
|
+
"tsup": "^8.5.0",
|
|
32
32
|
"typescript": "^5.8.3",
|
|
33
|
-
"@pluv/tsconfig": "^2.2.
|
|
34
|
-
"eslint-config-pluv": "^2.2.
|
|
33
|
+
"@pluv/tsconfig": "^2.2.2",
|
|
34
|
+
"eslint-config-pluv": "^2.2.2"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|