@pluv/crdt-loro 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.
@@ -1,18 +1,18 @@
1
1
 
2
- > @pluv/crdt-loro@2.2.0 build /home/runner/work/pluv/pluv/packages/crdt-loro
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
  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 76ms
13
11
  ESM dist/index.mjs 14.35 KB
14
12
  ESM ⚡️ Build success in 78ms
13
+ CJS dist/index.js 15.55 KB
14
+ CJS ⚡️ Build success in 80ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 4061ms
16
+ DTS ⚡️ Build success in 4059ms
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.2
4
+
5
+ ### Patch Changes
6
+
7
+ - @pluv/crdt@2.2.2
8
+ - @pluv/types@2.2.2
9
+
10
+ ## 2.2.1
11
+
12
+ ### Patch Changes
13
+
14
+ - @pluv/crdt@2.2.1
15
+ - @pluv/types@2.2.1
16
+
3
17
  ## 2.2.0
4
18
 
5
19
  ### Patch Changes
@@ -20,10 +34,10 @@
20
34
 
21
35
  - 945c47d: Updated deprecation warnings to read that features will be removed in v3 instead of v2.
22
36
 
23
- 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.
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.
24
38
 
25
- - @pluv/crdt@2.0.2
26
- - @pluv/types@2.0.2
39
+ - @pluv/crdt@2.0.2
40
+ - @pluv/types@2.0.2
27
41
 
28
42
  ## 2.0.1
29
43
 
@@ -38,42 +52,42 @@
38
52
 
39
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:
40
54
 
41
- ```ts
42
- import { loro } from "@pluv/crdt-loro";
43
-
44
- // Before
45
- loro.doc(() => ({
46
- // Using the `loro` utility (in this case `loro.map`) when declaring
47
- // top-level types is now deprecated
48
- topType: loro.map({
49
- key1: loro.text(""),
50
- key2: loro.text(""),
51
- }),
52
- }));
53
-
54
- // After
55
- loro.doc((t) => ({
56
- // Top-level properties must now use the builder (in this case `t`).
57
- // This effectively calls `loro.getMap("topType")` to instantiate the type on
58
- // the root document.
59
- // This simply returns the native Loro container type (e.g. LoroMap), which
60
- // allows you operate on your loro container types in a more native way.
61
- topType: t.map("topType", {
62
- // Declaring nested types should continue to use the `loro` utilities
63
- // you've used before
64
- key1: loro.text(""),
65
- key2: loro.text(""),
66
- }),
67
- }));
68
- ```
69
-
70
- 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.
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.
71
85
 
72
86
  ### Patch Changes
73
87
 
74
88
  - Updated dependencies [047a1d8]
75
- - @pluv/types@2.0.0
76
- - @pluv/crdt@2.0.0
89
+ - @pluv/types@2.0.0
90
+ - @pluv/crdt@2.0.0
77
91
 
78
92
  ## 1.0.2
79
93
 
@@ -95,15 +109,15 @@
95
109
 
96
110
  - af94706: pluv.io is now stable and production ready!
97
111
 
98
- 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.
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.
99
113
 
100
- Checkout the [full documentation here](https://pluv.io/docs/introduction) to get started today!
114
+ Checkout the [full documentation here](https://pluv.io/docs/introduction) to get started today!
101
115
 
102
116
  ### Patch Changes
103
117
 
104
118
  - Updated dependencies [af94706]
105
- - @pluv/crdt@1.0.0
106
- - @pluv/types@1.0.0
119
+ - @pluv/crdt@1.0.0
120
+ - @pluv/types@1.0.0
107
121
 
108
122
  ## 0.44.2
109
123
 
@@ -334,8 +348,8 @@
334
348
  ### Patch Changes
335
349
 
336
350
  - Updated dependencies [f4ceca3]
337
- - @pluv/types@0.38.0
338
- - @pluv/crdt@0.38.0
351
+ - @pluv/types@0.38.0
352
+ - @pluv/crdt@0.38.0
339
353
 
340
354
  ## 0.37.7
341
355
 
@@ -412,16 +426,16 @@
412
426
  ### Patch Changes
413
427
 
414
428
  - 7c8e7ef: Upgraded `loro-crdt` from `1.3.1` to `1.3.2`.
415
- - @pluv/crdt@0.35.3
416
- - @pluv/types@0.35.3
429
+ - @pluv/crdt@0.35.3
430
+ - @pluv/types@0.35.3
417
431
 
418
432
  ## 0.35.2
419
433
 
420
434
  ### Patch Changes
421
435
 
422
436
  - Updated dependencies [81cb692]
423
- - @pluv/types@0.35.2
424
- - @pluv/crdt@0.35.2
437
+ - @pluv/types@0.35.2
438
+ - @pluv/crdt@0.35.2
425
439
 
426
440
  ## 0.35.1
427
441
 
@@ -429,8 +443,8 @@
429
443
 
430
444
  - 9822786: Added missing `Tree` and `MovableList` types.
431
445
  - 3cd6571: Added support for undo/redo for `@pluv/crdt-loro`.
432
- - @pluv/crdt@0.35.1
433
- - @pluv/types@0.35.1
446
+ - @pluv/crdt@0.35.1
447
+ - @pluv/types@0.35.1
434
448
 
435
449
  ## 0.35.0
436
450
 
@@ -462,16 +476,16 @@
462
476
  ### Patch Changes
463
477
 
464
478
  - f54d8ce: Update internal, deprecated `loro-crdt` methods.
465
- - @pluv/crdt@0.33.0
466
- - @pluv/types@0.33.0
479
+ - @pluv/crdt@0.33.0
480
+ - @pluv/types@0.33.0
467
481
 
468
482
  ## 0.32.9
469
483
 
470
484
  ### Patch Changes
471
485
 
472
486
  - cef5911: Bump `loro-crdt` from `0.16.12` to `1.0.8`.
473
- - @pluv/crdt@0.32.9
474
- - @pluv/types@0.32.9
487
+ - @pluv/crdt@0.32.9
488
+ - @pluv/types@0.32.9
475
489
 
476
490
  ## 0.32.8
477
491
 
@@ -562,8 +576,8 @@
562
576
  ### Patch Changes
563
577
 
564
578
  - 7246a9e: Added `CrdtLibraryType` so that `@pluv/crdt-yjs` and `@pluv/crdt-loro` export a new property `kind` containing an identifier for the crdt.
565
- - @pluv/crdt@0.30.0
566
- - @pluv/types@0.30.0
579
+ - @pluv/crdt@0.30.0
580
+ - @pluv/types@0.30.0
567
581
 
568
582
  ## 0.29.0
569
583
 
@@ -676,76 +690,76 @@
676
690
 
677
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.
678
692
 
679
- 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.
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.
680
694
 
681
- 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.
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.
682
696
 
683
- ```ts
684
- // Before
697
+ ```ts
698
+ // Before
685
699
 
686
- import { yjs } from "@pluv/crdt-yjs";
700
+ import { yjs } from "@pluv/crdt-yjs";
687
701
 
688
- yjs.array([]); // Returns CrdtYjsArray
689
- yjs.object([]); // Returns CrdtYjsObject
702
+ yjs.array([]); // Returns CrdtYjsArray
703
+ yjs.object([]); // Returns CrdtYjsObject
690
704
 
691
- const room: PluvRoom = /* ... */;
705
+ const room: PluvRoom = /* ... */;
692
706
 
693
- room.getStorage("messages"); // Returns AbstractCrdtType
707
+ room.getStorage("messages"); // Returns AbstractCrdtType
694
708
 
695
- const [, sharedType] = useStorage("messages"); // sharedType is an AbstractCrdtType
696
- ```
709
+ const [, sharedType] = useStorage("messages"); // sharedType is an AbstractCrdtType
710
+ ```
697
711
 
698
- ```ts
699
- // Now
712
+ ```ts
713
+ // Now
700
714
 
701
- import { yjs } from "@pluv/crdt-yjs";
715
+ import { yjs } from "@pluv/crdt-yjs";
702
716
 
703
- yjs.array([]); // Returns yjs.Array
704
- yjs.object([]); // Returns yjs.Map
717
+ yjs.array([]); // Returns yjs.Array
718
+ yjs.object([]); // Returns yjs.Map
705
719
 
706
- const room: PluvRoom = /* ... */;
720
+ const room: PluvRoom = /* ... */;
707
721
 
708
- room.getStorage("messages"); // Returns yjs.AbstractType
722
+ room.getStorage("messages"); // Returns yjs.AbstractType
709
723
 
710
- const [, sharedType] = useStorage("messages"); // sharedType is a yjs.AbstractType
711
- ```
724
+ const [, sharedType] = useStorage("messages"); // sharedType is a yjs.AbstractType
725
+ ```
712
726
 
713
- 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:
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:
714
728
 
715
- ```ts
716
- // Before
729
+ ```ts
730
+ // Before
717
731
 
718
- const [data, container] = useStorage("messages");
732
+ const [data, container] = useStorage("messages");
719
733
 
720
- // This automatically called Loro.commit under the hood and rerendered the page with updated data.
721
- container.push(loro.object({ name: "John Doe", age: 35 }));
722
- ```
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
+ ```
723
737
 
724
- ```ts
725
- // Now
738
+ ```ts
739
+ // Now
726
740
 
727
- const [data, container] = useStorage("messages");
741
+ const [data, container] = useStorage("messages");
728
742
 
729
- const doc = useDoc();
730
- const transact = useTransact();
743
+ const doc = useDoc();
744
+ const transact = useTransact();
731
745
 
732
- // Updates need to be committed back to the doc whenever the changes need to be emitted to other users
733
- // The returned data also will not update until the changes are commited
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
734
748
 
735
- // The two operations below are functionally equivalent
736
- transact(() => {
737
- container.push(loro.object({ name: "John Doe", age: 35 }));
738
- });
749
+ // The two operations below are functionally equivalent
750
+ transact(() => {
751
+ container.push(loro.object({ name: "John Doe", age: 35 }));
752
+ });
739
753
 
740
- container.push(loro.object({ name: "John Doe", age: 35 }));
741
- doc.value.commit();
742
- ```
754
+ container.push(loro.object({ name: "John Doe", age: 35 }));
755
+ doc.value.commit();
756
+ ```
743
757
 
744
758
  ### Patch Changes
745
759
 
746
760
  - Updated dependencies [9492085]
747
- - @pluv/crdt@0.20.0
748
- - @pluv/types@0.20.0
761
+ - @pluv/crdt@0.20.0
762
+ - @pluv/types@0.20.0
749
763
 
750
764
  ## 0.19.0
751
765
 
@@ -759,8 +773,8 @@
759
773
  ### Patch Changes
760
774
 
761
775
  - Updated dependencies [99b5ca9]
762
- - @pluv/types@0.18.0
763
- - @pluv/crdt@0.18.0
776
+ - @pluv/types@0.18.0
777
+ - @pluv/crdt@0.18.0
764
778
 
765
779
  ## 0.17.3
766
780
 
@@ -788,8 +802,8 @@
788
802
  ### Patch Changes
789
803
 
790
804
  - Updated dependencies [507bc00]
791
- - @pluv/types@0.17.0
792
- - @pluv/crdt@0.17.0
805
+ - @pluv/types@0.17.0
806
+ - @pluv/crdt@0.17.0
793
807
 
794
808
  ## 0.16.3
795
809
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/crdt-loro",
3
- "version": "2.2.0",
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.0",
23
- "@pluv/types": "^2.2.0"
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.26.0",
29
+ "eslint": "^9.27.0",
30
30
  "loro-crdt": "^1.5.5",
31
- "tsup": "^8.4.0",
31
+ "tsup": "^8.5.0",
32
32
  "typescript": "^5.8.3",
33
- "@pluv/tsconfig": "^2.2.0",
34
- "eslint-config-pluv": "^2.2.0"
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",