loro-crdt 1.8.9 โ†’ 1.9.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,133 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 10a405b: feat: JSONPath rfc9535 #848
8
+
9
+ Thanks to @zolero for the thorough implementation of JSONPath support!
10
+
11
+ LoroDoc now supports querying and mutating document data using **JSONPath**, following the [RFC 9535](https://www.rfc-editor.org/rfc/rfc9535) specification.
12
+
13
+ ### ๐Ÿงฉ API
14
+
15
+ ```ts
16
+ // Execute a JSONPath query on the document
17
+ doc.JSONPath(path: string): any[];
18
+ ```
19
+
20
+ ### ๐Ÿ“š Query Examples
21
+
22
+ Example data setup
23
+
24
+ ```ts
25
+ const doc = new LoroDoc();
26
+ const store = doc.getMap("store");
27
+
28
+ // Simplified setup for illustration purposes
29
+ store.set("books", [
30
+ {
31
+ title: "1984",
32
+ author: "George Orwell",
33
+ price: 10,
34
+ available: true,
35
+ isbn: "978-0451524935",
36
+ },
37
+ {
38
+ title: "Animal Farm",
39
+ author: "George Orwell",
40
+ price: 8,
41
+ available: true,
42
+ },
43
+ {
44
+ title: "Brave New World",
45
+ author: "Aldous Huxley",
46
+ price: 12,
47
+ available: false,
48
+ },
49
+ {
50
+ title: "Fahrenheit 451",
51
+ author: "Ray Bradbury",
52
+ price: 9,
53
+ available: true,
54
+ },
55
+ {
56
+ title: "The Great Gatsby",
57
+ author: "F. Scott Fitzgerald",
58
+ price: null,
59
+ available: true,
60
+ },
61
+ {
62
+ title: "To Kill a Mockingbird",
63
+ author: "Harper Lee",
64
+ price: 11,
65
+ available: true,
66
+ },
67
+ {
68
+ title: "The Catcher in the Rye",
69
+ author: "J.D. Salinger",
70
+ price: 10,
71
+ available: false,
72
+ },
73
+ {
74
+ title: "Lord of the Flies",
75
+ author: "William Golding",
76
+ price: 9,
77
+ available: true,
78
+ },
79
+ {
80
+ title: "Pride and Prejudice",
81
+ author: "Jane Austen",
82
+ price: 7,
83
+ available: true,
84
+ },
85
+ {
86
+ title: "The Hobbit",
87
+ author: "J.R.R. Tolkien",
88
+ price: 14,
89
+ available: true,
90
+ },
91
+ ]);
92
+ store.set("featured_authors", ["George Orwell", "Jane Austen"]);
93
+ ```
94
+
95
+ ```ts
96
+ // 1. Get all book titles
97
+ doc.JSONPath("$.store.books[*].title");
98
+ // โ†’ ["1984", "Animal Farm", "Brave New World", "The Hobbit"]
99
+
100
+ // 2. Filter: available books only
101
+ doc.JSONPath("$.store.books[?(@.available)].title");
102
+ // โ†’ ["1984", "Animal Farm", "The Hobbit"]
103
+
104
+ // 3. Filter: books with price > 10
105
+ doc.JSONPath("$.store.books[?(@.price > 10)].title");
106
+ // โ†’ ["The Hobbit"]
107
+
108
+ // 4. Use recursive descent to get all prices
109
+ doc.JSONPath("$..price");
110
+ // โ†’ [10, 8, 12, 9, null, 11, 14]
111
+
112
+ // 5. Slice syntax: first three books
113
+ doc.JSONPath("$.store.books[0:3].title");
114
+ // โ†’ ["1984", "Animal Farm", "Brave New World"]
115
+
116
+ // 6. Membership test: authors in featured list
117
+ doc.JSONPath("$.store.books[?(@.author in $.store.featured_authors)].title");
118
+ // โ†’ ["1984", "Animal Farm", "Pride and Prejudice"]
119
+
120
+ // 7. String match using `contains`
121
+ doc.JSONPath("$.store.books[?(@.title contains 'The')].author");
122
+ // โ†’ ["F. Scott Fitzgerald", "J.R.R. Tolkien"]
123
+ ```
124
+
125
+ - 10a405b: refactor!: remove deprecated encoding format in v0.x #849
126
+
127
+ ### Patch Changes
128
+
129
+ - 3af6a85: fix: WASM loading compatibility for esbuild and rsbuild #851
130
+
3
131
  ## 1.8.9
4
132
 
5
133
  ### Patch Changes
@@ -87,6 +215,7 @@
87
215
  ### Minor Changes
88
216
 
89
217
  - 3a0db5b: feat: add APIs to fetch values associated with the top Undo and Redo stack entries (#790)
218
+
90
219
  - JS/WASM: `undo.topUndoValue()` and `undo.topRedoValue()` return the `value` from the top undo/redo item (or `undefined` when empty).
91
220
  - Rust: `UndoManager::{top_undo_meta, top_redo_meta, top_undo_value, top_redo_value}` to inspect top-of-stack metadata and values.
92
221
  - Internal: stack now supports peeking the top item metadata without mutation.
@@ -94,6 +223,7 @@
94
223
  This enables attaching human-readable labels via `onPush`/`onPop` and retrieving them to keep Undo/Redo menu items up to date.
95
224
 
96
225
  - 9a98e8d: Distinguish explicit vs implicit empty commit behavior for commit options.
226
+
97
227
  - Explicit commits (user-invoked `commit()` / `commit_with(...)`): if the transaction is empty, commit options (message/timestamp/origin) are swallowed and will NOT carry over.
98
228
  - Implicit commits (e.g., `export`, `checkout` internal barriers): if the transaction is empty, message/timestamp/origin are preserved for the next transaction.
99
229
 
@@ -437,6 +567,7 @@
437
567
  - ddafb7e: feat: diff, applyDiff, and revertTo #610
438
568
 
439
569
  Add new version-control-related primitives:
570
+
440
571
  - **`diff(from, to)`**: calculate the difference between two versions. The returned results have similar structures to the differences in events.
441
572
  - **`revertTo(targetVersion)`**: revert the document back to the target version. The difference between this and `checkout(targetVersion)` is this method will generate a series of new operations, which will transform the current doc into the same as the target version.
442
573
  - **`applyDiff(diff)`**: you can use it to apply the differences generated from `diff(from, to)`.
@@ -745,9 +876,11 @@
745
876
  - Performance improvement and bug fixes
746
877
 
747
878
  ### ๐Ÿš€ Features
879
+
748
880
  - Redact (#504)
749
881
 
750
882
  ### ๐Ÿ› Bug Fixes
883
+
751
884
  - Ffi Subscription (#505)
752
885
  - Ffi remove try unwrap (#506)
753
886
  - Movable list undo impl (#509)
@@ -755,15 +888,18 @@
755
888
  - IsContainerDeleted cache err (#513)
756
889
 
757
890
  ### ๐Ÿ“š Documentation
891
+
758
892
  - Refine wasm docs
759
893
 
760
894
  ### โšก Performance
895
+
761
896
  - Optimize shrink frontiers
762
897
  - Optimize batch container registrations on arena (#510)
763
898
  - Optimize high concurrency performance (#514)
764
899
  - Use better data structure for frontiers (#515)
765
900
 
766
901
  ### Perf
902
+
767
903
  - Commit speed & text insert cache (#511)
768
904
 
769
905
  ## 1.0.0-alpha.5
@@ -771,9 +907,11 @@
771
907
  ### Patch Changes
772
908
 
773
909
  - ## Fix
910
+
774
911
  - Use release build
775
912
 
776
913
  ## Test
914
+
777
915
  - Add compatibility tests (#503)
778
916
 
779
917
  ## 1.0.0-alpha.4
@@ -781,6 +919,7 @@
781
919
  ### Patch Changes
782
920
 
783
921
  - ### ๐Ÿš€ Features
922
+
784
923
  - _(wasm)_ Commit message & get pending ops length (#477)
785
924
  - Update text by line (#480)
786
925
  - Add clear methods (#478)
@@ -791,6 +930,7 @@
791
930
  - Add import status (#494)
792
931
 
793
932
  ### ๐Ÿ› Bug Fixes
933
+
794
934
  - Get correct tree_cache current vv when retreating (#476)
795
935
  - Gc snapshot error (#481)
796
936
  - Checkout into middle of marks
@@ -802,6 +942,7 @@
802
942
  - Create event cannot find parent (#498)
803
943
 
804
944
  ### ๐Ÿšœ Refactor
945
+
805
946
  - [**breaking**] Don't wait for `commit` to update version info
806
947
  - Avoid footgun of impl ord for cid
807
948
  - Loro import function should return LoroEncodeError (#487)
@@ -810,6 +951,7 @@
810
951
  - [**breaking**] List state snapshot schema for v1.0 (#485)
811
952
 
812
953
  ### โšก Performance
954
+
813
955
  - Make shrink frontiers faster when the peer num is large (#482)
814
956
  - Optimize tree cache find children speed
815
957
  - Avoid memory leak when forking repeatedly (#500)
@@ -818,10 +960,12 @@
818
960
  - Optimize diff calc cache use (#475)
819
961
 
820
962
  ### ๐Ÿงช Testing
963
+
821
964
  - Make awareness more robust
822
965
  - Bench large folder with 1M files & 100M ops (#495)
823
966
 
824
967
  ### โš™๏ธ Miscellaneous Tasks
968
+
825
969
  - Use cached diff calc
826
970
 
827
971
  ## 1.0.0-alpha.3
@@ -829,16 +973,20 @@
829
973
  ### Patch Changes
830
974
 
831
975
  - ### ๐Ÿ› Bug Fixes
976
+
832
977
  - Cursor behavior when using gc-snapshot (#472)
833
978
  - _(wasm)_ Type err
834
979
 
835
980
  ### โš™๏ธ Miscellaneous Tasks
981
+
836
982
  - Make tree parent id pub on loro crate
837
983
 
838
984
  ### Feat
985
+
839
986
  - Allow editing on detached mode (#473)
840
987
 
841
988
  ### Fix
989
+
842
990
  - Get tree's alive children correctly (#474)
843
991
  - Should not emit event when exporting gc-snapshot (#471)
844
992
 
@@ -847,9 +995,11 @@
847
995
  ### Patch Changes
848
996
 
849
997
  - ### ๐Ÿš€ Features
998
+
850
999
  - Fork doc at the target version (#469)
851
1000
 
852
1001
  ### ๐Ÿšœ Refactor
1002
+
853
1003
  - BREAKING CHANGE: Use hierarchy value for tree value (#470)
854
1004
 
855
1005
  ## 1.0.0-alpha.1
@@ -857,20 +1007,24 @@
857
1007
  ### Patch Changes
858
1008
 
859
1009
  - ### ๐Ÿš€ Features
1010
+
860
1011
  - Get shallow value of doc (#463)
861
1012
  - Add state only snapshot & refine check slow test
862
1013
  - Add new cid method to js binding
863
1014
  - Jsonpath experimental support (#466)
864
1015
 
865
1016
  ### ๐Ÿ› Bug Fixes
1017
+
866
1018
  - Raise error if perform action on a deleted container (#465)
867
1019
  - Raise error if moving a deleted node
868
1020
  - Export snapshot error on a gc doc
869
1021
 
870
1022
  ### ๐Ÿšœ Refactor
1023
+
871
1024
  - Tree contains & isDeleted (#467)
872
1025
 
873
1026
  ### ๐Ÿงช Testing
1027
+
874
1028
  - Check state correctness on shallow doc
875
1029
 
876
1030
  ## 1.0.0-alpha.0
@@ -909,22 +1063,27 @@
909
1063
  ### Patch Changes
910
1064
 
911
1065
  - 38b4bcf: Add text update API
1066
+
912
1067
  - Remove the patch for crypto
913
1068
  - Add text update API (#404)
914
1069
  - Check invalid root container name (#411)
915
1070
 
916
1071
  ### ๐Ÿ› Bug Fixes
1072
+
917
1073
  - Workaround lldb bug make loro crate debuggable (#414)
918
1074
  - Delete the **bring back** tree node from the undo container remap (#423)
919
1075
 
920
1076
  ### ๐Ÿ“š Documentation
1077
+
921
1078
  - Fix typo
922
1079
  - Refine docs about event (#417)
923
1080
 
924
1081
  ### ๐ŸŽจ Styling
1082
+
925
1083
  - Use clippy to perf code (#407)
926
1084
 
927
1085
  ### โš™๏ธ Miscellaneous Tasks
1086
+
928
1087
  - Add test tools (#410)
929
1088
 
930
1089
  ## 0.16.7
@@ -934,20 +1093,24 @@
934
1093
  - 45c98d5: Better text APIs and bug fixes
935
1094
 
936
1095
  ### ๐Ÿš€ Features
1096
+
937
1097
  - Add insert_utf8 and delete_utf8 for Rust Text API (#396)
938
1098
  - Add text iter (#400)
939
1099
  - Add more text api (#398)
940
1100
 
941
1101
  ### ๐Ÿ› Bug Fixes
1102
+
942
1103
  - Tree undo when processing deleted node (#399)
943
1104
  - Tree diff calc children should be sorted by idlp (#401)
944
1105
  - When computing the len of the map, do not count elements that are None (#402)
945
1106
 
946
1107
  ### ๐Ÿ“š Documentation
1108
+
947
1109
  - Update wasm docs
948
1110
  - Rm experimental warning
949
1111
 
950
1112
  ### โš™๏ธ Miscellaneous Tasks
1113
+
951
1114
  - Update fuzz config
952
1115
  - Pnpm
953
1116
  - Rename position to fractional_index (#381)
@@ -990,6 +1153,7 @@
990
1153
  - 34f6064: Better undo events & transform cursors by undo manager (#369)
991
1154
 
992
1155
  #### ๐Ÿงช Testing
1156
+
993
1157
  - Enable compatibility test (#367)
994
1158
 
995
1159
  ## 0.16.1
@@ -1009,19 +1173,23 @@
1009
1173
  - c12c2b9: Movable Tree Children & Undo
1010
1174
 
1011
1175
  #### ๐Ÿ› Bug Fixes
1176
+
1012
1177
  - Refine error message on corrupted data (#356)
1013
1178
  - Add MovableList to CONTAINER_TYPES (#359)
1014
1179
  - Better jitter for fractional index (#360)
1015
1180
 
1016
1181
  #### ๐Ÿงช Testing
1182
+
1017
1183
  - Add compatibility tests (#357)
1018
1184
 
1019
1185
  #### Feat
1186
+
1020
1187
  - Make the encoding format forward and backward compatible (#329)
1021
1188
  - Undo (#361)
1022
1189
  - Use fractional index to order the children of the tree (#298)
1023
1190
 
1024
1191
  #### ๐Ÿ› Bug Fixes
1192
+
1025
1193
  - Tree fuzz sort value (#351)
1026
1194
  - Upgrade wasm-bindgen to fix str free err (#353)
1027
1195
 
@@ -1032,11 +1200,13 @@
1032
1200
  - 43506cc: Fix unsound issue caused by wasm-bindgen
1033
1201
 
1034
1202
  #### ๐Ÿ› Bug Fixes
1203
+
1035
1204
  - Fix potential movable list bug (#354)
1036
1205
  - Tree fuzz sort value (#351)
1037
1206
  - Upgrade wasm-bindgen to fix str free err (#353)
1038
1207
 
1039
1208
  #### ๐Ÿ“š Documentation
1209
+
1040
1210
  - Simplify readme (#352)
1041
1211
 
1042
1212
  ## 0.15.2
@@ -1046,12 +1216,15 @@
1046
1216
  - e30678d: Perf: fix deletions merge
1047
1217
 
1048
1218
  #### ๐Ÿ› Bug Fixes
1219
+
1049
1220
  - _(wasm)_ Movable list .kind() (#342)
1050
1221
 
1051
1222
  #### โšก Performance
1223
+
1052
1224
  - Delete span merge err (#348)
1053
1225
 
1054
1226
  #### โš™๏ธ Miscellaneous Tasks
1227
+
1055
1228
  - Warn missing debug impl (#347)
1056
1229
 
1057
1230
  <!-- generated by git-cliff -->
@@ -1063,6 +1236,7 @@
1063
1236
  - 04c6290: Bug fixes and improvements.
1064
1237
 
1065
1238
  #### ๐Ÿ› Bug Fixes
1239
+
1066
1240
  - Impl a few unimplemented! for movable tree (#335)
1067
1241
  - Refine ts type; reject invalid operations (#334)
1068
1242
  - Get cursor err on text and movable list (#337)
@@ -1070,10 +1244,12 @@
1070
1244
  - Upgrade generic-btree to allow large btree (#344)
1071
1245
 
1072
1246
  #### ๐Ÿ“š Documentation
1247
+
1073
1248
  - Add warn(missing_docs) to loro and loro-wasm (#339)
1074
1249
  - Minor fix on set_change_merge_interval api (#341)
1075
1250
 
1076
1251
  #### โš™๏ธ Miscellaneous Tasks
1252
+
1077
1253
  - Skip the checking if not debug_assertions (#340)
1078
1254
 
1079
1255
  <!-- generated by git-cliff -->
@@ -1121,6 +1297,7 @@
1121
1297
  - 24cf9b9: Bug Fix
1122
1298
 
1123
1299
  #### ๐Ÿ› Bug Fixes
1300
+
1124
1301
  - Attached container can be inserted to `Map` or `List` (#331)
1125
1302
 
1126
1303
  ## 0.14.5
@@ -1130,9 +1307,11 @@
1130
1307
  - 73e3ba5: Bug Fix
1131
1308
 
1132
1309
  #### ๐Ÿ› Bug Fixes
1310
+
1133
1311
  - _(js)_ Allow convert from undefined to LoroValue (#323)
1134
1312
 
1135
1313
  #### ๐Ÿšœ Refactor
1314
+
1136
1315
  - Refine ts type (#322)
1137
1316
 
1138
1317
  ## 0.14.4
@@ -1140,10 +1319,12 @@
1140
1319
  ### Patch Changes
1141
1320
 
1142
1321
  - 598d97e: ### ๐Ÿšœ Refactor
1322
+
1143
1323
  - Refine the TS Type of Awareness
1144
1324
  - Parse Uint8array to LoroValue::Binary (#320)
1145
1325
 
1146
1326
  ### ๐Ÿ“š Documentation
1327
+
1147
1328
  - Update how to publish new npm pkgs
1148
1329
 
1149
1330
  ## 0.14.3
@@ -1157,6 +1338,7 @@
1157
1338
  ### Patch Changes
1158
1339
 
1159
1340
  - Refactor rename `StablePosition` to `Cursor`
1341
+
1160
1342
  - Rename stable pos to cursor (#317)
1161
1343
 
1162
1344
  <!-- generated by git-cliff -->
@@ -1168,6 +1350,7 @@
1168
1350
  - Supports Cursors
1169
1351
 
1170
1352
  #### ๐Ÿš€ Features
1353
+
1171
1354
  - Cursors (#290)
1172
1355
 
1173
1356
  ## 0.14.0
@@ -1177,22 +1360,27 @@
1177
1360
  - Improved API
1178
1361
 
1179
1362
  ### ๐Ÿš€ Features
1363
+
1180
1364
  - Access value/container by path (#308)
1181
1365
  - Decode import blob meta (#307)
1182
1366
 
1183
1367
  ### ๐Ÿ› Bug Fixes
1368
+
1184
1369
  - Decode iter return result by updating columnar to 0.3.4 (#309)
1185
1370
 
1186
1371
  ### ๐Ÿšœ Refactor
1372
+
1187
1373
  - Replace "local" and "fromCheckout" in event with "triggeredBy" (#312)
1188
1374
  - Add concrete type for each different container (#313)
1189
1375
  - _(ts)_ Make types better (#315)
1190
1376
 
1191
1377
  ### ๐Ÿ“š Documentation
1378
+
1192
1379
  - Refine wasm docs (#304)
1193
1380
  - Clarify that peer id should be convertible to a u64 (#306)
1194
1381
 
1195
1382
  ### โš™๏ธ Miscellaneous Tasks
1383
+
1196
1384
  - Add coverage report cli (#311)
1197
1385
 
1198
1386
  ## 0.13.1