@pluv/crdt-loro 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.
@@ -1,18 +1,18 @@
1
1
 
2
- > @pluv/crdt-loro@2.2.1 build /home/runner/work/pluv/pluv/packages/crdt-loro
2
+ > @pluv/crdt-loro@2.2.3 build /home/runner/work/pluv/pluv/packages/crdt-loro
3
3
  > tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
- CLI tsup v8.4.0
7
+ CLI tsup v8.5.0
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- CJS dist/index.js 15.55 KB
12
- CJS ⚡️ Build success in 165ms
13
11
  ESM dist/index.mjs 14.35 KB
14
- ESM ⚡️ Build success in 174ms
12
+ ESM ⚡️ Build success in 81ms
13
+ CJS dist/index.js 15.55 KB
14
+ CJS ⚡️ Build success in 82ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 3917ms
16
+ DTS ⚡️ Build success in 3927ms
17
17
  DTS dist/index.d.mts 4.60 KB
18
18
  DTS dist/index.d.ts 4.60 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @pluv/crdt-loro
2
2
 
3
+ ## 2.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - @pluv/crdt@2.2.3
8
+ - @pluv/types@2.2.3
9
+
10
+ ## 2.2.2
11
+
12
+ ### Patch Changes
13
+
14
+ - @pluv/crdt@2.2.2
15
+ - @pluv/types@2.2.2
16
+
3
17
  ## 2.2.1
4
18
 
5
19
  ### Patch Changes
@@ -27,10 +41,10 @@
27
41
 
28
42
  - 945c47d: Updated deprecation warnings to read that features will be removed in v3 instead of v2.
29
43
 
30
- 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.
44
+ 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
45
 
32
- - @pluv/crdt@2.0.2
33
- - @pluv/types@2.0.2
46
+ - @pluv/crdt@2.0.2
47
+ - @pluv/types@2.0.2
34
48
 
35
49
  ## 2.0.1
36
50
 
@@ -45,42 +59,42 @@
45
59
 
46
60
  - 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
61
 
48
- ```ts
49
- import { loro } from "@pluv/crdt-loro";
50
-
51
- // Before
52
- loro.doc(() => ({
53
- // Using the `loro` utility (in this case `loro.map`) when declaring
54
- // top-level types is now deprecated
55
- topType: loro.map({
56
- key1: loro.text(""),
57
- key2: loro.text(""),
58
- }),
59
- }));
60
-
61
- // After
62
- loro.doc((t) => ({
63
- // Top-level properties must now use the builder (in this case `t`).
64
- // This effectively calls `loro.getMap("topType")` to instantiate the type on
65
- // the root document.
66
- // This simply returns the native Loro container type (e.g. LoroMap), which
67
- // allows you operate on your loro container types in a more native way.
68
- topType: t.map("topType", {
69
- // Declaring nested types should continue to use the `loro` utilities
70
- // you've used before
71
- key1: loro.text(""),
72
- key2: loro.text(""),
73
- }),
74
- }));
75
- ```
76
-
77
- 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.
62
+ ```ts
63
+ import { loro } from "@pluv/crdt-loro";
64
+
65
+ // Before
66
+ loro.doc(() => ({
67
+ // Using the `loro` utility (in this case `loro.map`) when declaring
68
+ // top-level types is now deprecated
69
+ topType: loro.map({
70
+ key1: loro.text(""),
71
+ key2: loro.text(""),
72
+ }),
73
+ }));
74
+
75
+ // After
76
+ loro.doc((t) => ({
77
+ // Top-level properties must now use the builder (in this case `t`).
78
+ // This effectively calls `loro.getMap("topType")` to instantiate the type on
79
+ // the root document.
80
+ // This simply returns the native Loro container type (e.g. LoroMap), which
81
+ // allows you operate on your loro container types in a more native way.
82
+ topType: t.map("topType", {
83
+ // Declaring nested types should continue to use the `loro` utilities
84
+ // you've used before
85
+ key1: loro.text(""),
86
+ key2: loro.text(""),
87
+ }),
88
+ }));
89
+ ```
90
+
91
+ 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
92
 
79
93
  ### Patch Changes
80
94
 
81
95
  - Updated dependencies [047a1d8]
82
- - @pluv/types@2.0.0
83
- - @pluv/crdt@2.0.0
96
+ - @pluv/types@2.0.0
97
+ - @pluv/crdt@2.0.0
84
98
 
85
99
  ## 1.0.2
86
100
 
@@ -102,15 +116,15 @@
102
116
 
103
117
  - af94706: pluv.io is now stable and production ready!
104
118
 
105
- 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.
119
+ 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
120
 
107
- Checkout the [full documentation here](https://pluv.io/docs/introduction) to get started today!
121
+ Checkout the [full documentation here](https://pluv.io/docs/introduction) to get started today!
108
122
 
109
123
  ### Patch Changes
110
124
 
111
125
  - Updated dependencies [af94706]
112
- - @pluv/crdt@1.0.0
113
- - @pluv/types@1.0.0
126
+ - @pluv/crdt@1.0.0
127
+ - @pluv/types@1.0.0
114
128
 
115
129
  ## 0.44.2
116
130
 
@@ -341,8 +355,8 @@
341
355
  ### Patch Changes
342
356
 
343
357
  - Updated dependencies [f4ceca3]
344
- - @pluv/types@0.38.0
345
- - @pluv/crdt@0.38.0
358
+ - @pluv/types@0.38.0
359
+ - @pluv/crdt@0.38.0
346
360
 
347
361
  ## 0.37.7
348
362
 
@@ -419,16 +433,16 @@
419
433
  ### Patch Changes
420
434
 
421
435
  - 7c8e7ef: Upgraded `loro-crdt` from `1.3.1` to `1.3.2`.
422
- - @pluv/crdt@0.35.3
423
- - @pluv/types@0.35.3
436
+ - @pluv/crdt@0.35.3
437
+ - @pluv/types@0.35.3
424
438
 
425
439
  ## 0.35.2
426
440
 
427
441
  ### Patch Changes
428
442
 
429
443
  - Updated dependencies [81cb692]
430
- - @pluv/types@0.35.2
431
- - @pluv/crdt@0.35.2
444
+ - @pluv/types@0.35.2
445
+ - @pluv/crdt@0.35.2
432
446
 
433
447
  ## 0.35.1
434
448
 
@@ -436,8 +450,8 @@
436
450
 
437
451
  - 9822786: Added missing `Tree` and `MovableList` types.
438
452
  - 3cd6571: Added support for undo/redo for `@pluv/crdt-loro`.
439
- - @pluv/crdt@0.35.1
440
- - @pluv/types@0.35.1
453
+ - @pluv/crdt@0.35.1
454
+ - @pluv/types@0.35.1
441
455
 
442
456
  ## 0.35.0
443
457
 
@@ -469,16 +483,16 @@
469
483
  ### Patch Changes
470
484
 
471
485
  - f54d8ce: Update internal, deprecated `loro-crdt` methods.
472
- - @pluv/crdt@0.33.0
473
- - @pluv/types@0.33.0
486
+ - @pluv/crdt@0.33.0
487
+ - @pluv/types@0.33.0
474
488
 
475
489
  ## 0.32.9
476
490
 
477
491
  ### Patch Changes
478
492
 
479
493
  - cef5911: Bump `loro-crdt` from `0.16.12` to `1.0.8`.
480
- - @pluv/crdt@0.32.9
481
- - @pluv/types@0.32.9
494
+ - @pluv/crdt@0.32.9
495
+ - @pluv/types@0.32.9
482
496
 
483
497
  ## 0.32.8
484
498
 
@@ -569,8 +583,8 @@
569
583
  ### Patch Changes
570
584
 
571
585
  - 7246a9e: Added `CrdtLibraryType` so that `@pluv/crdt-yjs` and `@pluv/crdt-loro` export a new property `kind` containing an identifier for the crdt.
572
- - @pluv/crdt@0.30.0
573
- - @pluv/types@0.30.0
586
+ - @pluv/crdt@0.30.0
587
+ - @pluv/types@0.30.0
574
588
 
575
589
  ## 0.29.0
576
590
 
@@ -683,76 +697,76 @@
683
697
 
684
698
  - 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
699
 
686
- 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.
700
+ 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
701
 
688
- 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.
702
+ 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
703
 
690
- ```ts
691
- // Before
704
+ ```ts
705
+ // Before
692
706
 
693
- import { yjs } from "@pluv/crdt-yjs";
707
+ import { yjs } from "@pluv/crdt-yjs";
694
708
 
695
- yjs.array([]); // Returns CrdtYjsArray
696
- yjs.object([]); // Returns CrdtYjsObject
709
+ yjs.array([]); // Returns CrdtYjsArray
710
+ yjs.object([]); // Returns CrdtYjsObject
697
711
 
698
- const room: PluvRoom = /* ... */;
712
+ const room: PluvRoom = /* ... */;
699
713
 
700
- room.getStorage("messages"); // Returns AbstractCrdtType
714
+ room.getStorage("messages"); // Returns AbstractCrdtType
701
715
 
702
- const [, sharedType] = useStorage("messages"); // sharedType is an AbstractCrdtType
703
- ```
716
+ const [, sharedType] = useStorage("messages"); // sharedType is an AbstractCrdtType
717
+ ```
704
718
 
705
- ```ts
706
- // Now
719
+ ```ts
720
+ // Now
707
721
 
708
- import { yjs } from "@pluv/crdt-yjs";
722
+ import { yjs } from "@pluv/crdt-yjs";
709
723
 
710
- yjs.array([]); // Returns yjs.Array
711
- yjs.object([]); // Returns yjs.Map
724
+ yjs.array([]); // Returns yjs.Array
725
+ yjs.object([]); // Returns yjs.Map
712
726
 
713
- const room: PluvRoom = /* ... */;
727
+ const room: PluvRoom = /* ... */;
714
728
 
715
- room.getStorage("messages"); // Returns yjs.AbstractType
729
+ room.getStorage("messages"); // Returns yjs.AbstractType
716
730
 
717
- const [, sharedType] = useStorage("messages"); // sharedType is a yjs.AbstractType
718
- ```
731
+ const [, sharedType] = useStorage("messages"); // sharedType is a yjs.AbstractType
732
+ ```
719
733
 
720
- 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:
734
+ 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
735
 
722
- ```ts
723
- // Before
736
+ ```ts
737
+ // Before
724
738
 
725
- const [data, container] = useStorage("messages");
739
+ const [data, container] = useStorage("messages");
726
740
 
727
- // This automatically called Loro.commit under the hood and rerendered the page with updated data.
728
- container.push(loro.object({ name: "John Doe", age: 35 }));
729
- ```
741
+ // This automatically called Loro.commit under the hood and rerendered the page with updated data.
742
+ container.push(loro.object({ name: "John Doe", age: 35 }));
743
+ ```
730
744
 
731
- ```ts
732
- // Now
745
+ ```ts
746
+ // Now
733
747
 
734
- const [data, container] = useStorage("messages");
748
+ const [data, container] = useStorage("messages");
735
749
 
736
- const doc = useDoc();
737
- const transact = useTransact();
750
+ const doc = useDoc();
751
+ const transact = useTransact();
738
752
 
739
- // Updates need to be committed back to the doc whenever the changes need to be emitted to other users
740
- // The returned data also will not update until the changes are commited
753
+ // Updates need to be committed back to the doc whenever the changes need to be emitted to other users
754
+ // The returned data also will not update until the changes are commited
741
755
 
742
- // The two operations below are functionally equivalent
743
- transact(() => {
744
- container.push(loro.object({ name: "John Doe", age: 35 }));
745
- });
756
+ // The two operations below are functionally equivalent
757
+ transact(() => {
758
+ container.push(loro.object({ name: "John Doe", age: 35 }));
759
+ });
746
760
 
747
- container.push(loro.object({ name: "John Doe", age: 35 }));
748
- doc.value.commit();
749
- ```
761
+ container.push(loro.object({ name: "John Doe", age: 35 }));
762
+ doc.value.commit();
763
+ ```
750
764
 
751
765
  ### Patch Changes
752
766
 
753
767
  - Updated dependencies [9492085]
754
- - @pluv/crdt@0.20.0
755
- - @pluv/types@0.20.0
768
+ - @pluv/crdt@0.20.0
769
+ - @pluv/types@0.20.0
756
770
 
757
771
  ## 0.19.0
758
772
 
@@ -766,8 +780,8 @@
766
780
  ### Patch Changes
767
781
 
768
782
  - Updated dependencies [99b5ca9]
769
- - @pluv/types@0.18.0
770
- - @pluv/crdt@0.18.0
783
+ - @pluv/types@0.18.0
784
+ - @pluv/crdt@0.18.0
771
785
 
772
786
  ## 0.17.3
773
787
 
@@ -795,8 +809,8 @@
795
809
  ### Patch Changes
796
810
 
797
811
  - Updated dependencies [507bc00]
798
- - @pluv/types@0.17.0
799
- - @pluv/crdt@0.17.0
812
+ - @pluv/types@0.17.0
813
+ - @pluv/crdt@0.17.0
800
814
 
801
815
  ## 0.16.3
802
816
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/crdt-loro",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "description": "loro for @pluv/io",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -17,21 +17,21 @@
17
17
  "access": "public"
18
18
  },
19
19
  "dependencies": {
20
- "@types/node": "^22.15.18",
20
+ "@types/node": "^22.15.21",
21
21
  "js-base64": "^3.7.7",
22
- "@pluv/crdt": "^2.2.1",
23
- "@pluv/types": "^2.2.1"
22
+ "@pluv/crdt": "^2.2.3",
23
+ "@pluv/types": "^2.2.3"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "loro-crdt": "^1.0.0"
27
27
  },
28
28
  "devDependencies": {
29
- "eslint": "^9.26.0",
30
- "loro-crdt": "^1.5.5",
31
- "tsup": "^8.4.0",
29
+ "eslint": "^9.27.0",
30
+ "loro-crdt": "^1.5.6",
31
+ "tsup": "^8.5.0",
32
32
  "typescript": "^5.8.3",
33
- "@pluv/tsconfig": "^2.2.1",
34
- "eslint-config-pluv": "^2.2.1"
33
+ "@pluv/tsconfig": "^2.2.3",
34
+ "eslint-config-pluv": "^2.2.3"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "tsup src/index.ts --format esm,cjs --dts",