@pluv/crdt 5.0.0 → 5.0.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/dist/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { CrdtDocFactory, CrdtDocLike, CrdtDocLike as CrdtDocLike$1, CrdtLibraryType, CrdtType, CrdtType as CrdtType$1, DocApplyEncodedStateParams, DocApplyEncodedStateParams as DocApplyEncodedStateParams$1, DocBatchApplyEncodedStateParams, DocBatchApplyEncodedStateParams as DocBatchApplyEncodedStateParams$1, DocSubscribeCallbackParams, DocSubscribeCallbackParams as DocSubscribeCallbackParams$1, InferCrdtJson, Maybe } from "@pluv/types";
2
-
3
2
  //#region src/AbstractCrdtDocFactory.d.ts
4
3
  declare abstract class AbstractCrdtDocFactory<TDoc extends any, TStorage extends Record<string, CrdtType$1<any, any>>> implements CrdtDocFactory<TDoc, TStorage> {
5
4
  _initialStorage: (builder: any) => TStorage;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/AbstractCrdtDocFactory.ts","../src/NoopCrdtDoc.ts","../src/NoopCrdtDocFactory.ts","../src/noop.ts","../src/types.ts"],"mappings":";;;uBAEsB,sBAAA,oCAED,MAAA,SAAe,UAAA,wBACvB,cAAA,CAAe,IAAA,EAAM,QAAA;EACvB,eAAA,GAAkB,OAAA,UAAiB,QAAA;cAE9B,cAAA,GAAiB,OAAA,UAAiB,QAAA;EAAA,SAI9B,QAAA,IAAY,aAAA,CAAY,IAAA,EAAM,QAAA;EAAA,SAC9B,UAAA,CACZ,cAAA,IAAkB,OAAA,UAAiB,QAAA,GACpC,sBAAA,CAAuB,IAAA,EAAM,QAAA;EAAA,SAChB,cAAA,CACZ,cAAA,IAAkB,OAAA,UAAiB,QAAA,GACpC,aAAA,CAAY,IAAA,EAAM,QAAA;EAEd,OAAA,CAAQ,YAAA,EAAc,KAAA;EAQtB,mBAAA,CAAoB,OAAA;AAAA;;;cCrBlB,WAAA,YAAuB,aAAA;EACzB,KAAA;EAEA,iBAAA,CAAkB,MAAA,EAAQ,4BAAA;EAI1B,sBAAA,CAAuB,MAAA,EAAQ,iCAAA;EAI/B,OAAA;EAIA,OAAA;EAIA,OAAA;EAIA,GAAA,CAAI,GAAA;EACJ,GAAA,qBAAwB,GAAA,EAAK,IAAA,MAAU,IAAA;EAKvC,eAAA;EAIA,OAAA;EAIA,cAAA;EAIA,IAAA;EAIA,SAAA,CAAU,QAAA,GAAW,MAAA,EAAQ,4BAAA;EAI7B,MAAA;EAIA,KAAA;EAIA,QAAA,CAAS,EAAA,cAAgB,MAAA;EAMzB,IAAA;AAAA;;;cCnEE,kBAAA,SAA2B,sBAAA;cACxB,cAAA;EAIL,QAAA,IAAY,WAAA;EAIZ,UAAA,CAAW,cAAA,KAAmB,OAAA,6BAAoC,kBAAA;EAIlE,cAAA,CAAe,cAAA,KAAmB,OAAA,6BAAoC,WAAA;AAAA;;;cCdpE,IAAA;uBACO,kBAAA;AAAA;;;KCCR,QAAA,kBAA0B,sBAAA,cAClC,YAAA,CAAa,QAAA;AAAA,KAEL,YAAA,kBAA8B,sBAAA,cAAoC,UAAA,CAC1E,QAAA;AAAA,KAGQ,qBAAA,kBAAuC,sBAAA,cAC/C,QAAQ;AAAA,KAEA,YAAA,kBAA8B,sBAAA,cAAoC,UAAA,CAC1E,qBAAA,CAAsB,QAAA;AAAA,KAGd,YAAA,kBAA8B,sBAAA,cAAoC,UAAA,CAC1E,qBAAA,CAAsB,QAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/AbstractCrdtDocFactory.ts","../src/NoopCrdtDoc.ts","../src/NoopCrdtDocFactory.ts","../src/noop.ts","../src/types.ts"],"mappings":";;uBAEsB,uBAClB,kBACA,iBAAiB,eAAe,kCACvB,eAAe,MAAM;EACvB,kBAAkB,iBAAiB;EAE9B,YAAA,iBAAiB,iBAAiB;WAI9B,YAAY,cAAY,MAAM;WAC9B,WACZ,kBAAkB,iBAAiB,WACpC,uBAAuB,MAAM;WAChB,eACZ,kBAAkB,iBAAiB,WACpC,cAAY,MAAM;EAEd,QAAQ,cAAc;EAQtB,oBAAoB;;;;cCrBlB,uBAAuB;EACzB;EAEA,kBAAkB,QAAQ;EAI1B,uBAAuB,QAAQ;EAI/B;EAIA;EAIA;EAIA,IAAI;EACJ,IAAI,oBAAoB,KAAK,UAAU;EAKvC;EAIA;EAIA;EAIA;EAIA,UAAU,WAAW,QAAQ;EAI7B;EAIA;EAIA,SAAS,gBAAgB;EAMzB;;;;cCnEE,2BAA2B;EACxB,YAAA;EAIL,YAAY;EAIZ,WAAW,mBAAmB,oCAAoC;EAIlE,eAAe,mBAAmB,oCAAoC;;;;cCdpE;EACI,MAAA,eAAG;;;;KCCR,SAAS,iBAAiB,oCAClC,aAAa;KAEL,aAAa,iBAAiB,oCAAoC,WAC1E;KAGQ,sBAAsB,iBAAiB,oCAC/C;KAEQ,aAAa,iBAAiB,oCAAoC,WAC1E,sBAAsB;KAGd,aAAa,iBAAiB,oCAAoC,WAC1E,sBAAsB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/crdt",
3
- "version": "5.0.0",
3
+ "version": "5.0.2",
4
4
  "description": "crdt base for @pluv/io",
5
5
  "author": {
6
6
  "email": "david@pluv.io",
@@ -16,18 +16,21 @@
16
16
  },
17
17
  "type": "module",
18
18
  "types": "./dist/index.d.mts",
19
+ "files": [
20
+ "dist"
21
+ ],
19
22
  "publishConfig": {
20
23
  "access": "public"
21
24
  },
22
25
  "dependencies": {
23
- "@pluv/types": "^5.0.0"
26
+ "@pluv/types": "^5.0.2"
24
27
  },
25
28
  "devDependencies": {
26
- "eslint": "^10.5.0",
27
- "tsdown": "0.22.3",
28
- "typescript": "^5.9.3",
29
- "@pluv/tsconfig": "^5.0.0",
30
- "eslint-config-pluv": "^5.0.0"
29
+ "@pluv/tsconfig": "^5.0.2",
30
+ "eslint": "^10.9.0",
31
+ "eslint-config-pluv": "^5.0.2",
32
+ "tsdown": "0.22.14",
33
+ "typescript": "^5.9.3"
31
34
  },
32
35
  "exports": {
33
36
  ".": "./dist/index.mjs",
@@ -1,13 +0,0 @@
1
- $ tsdown
2
- ℹ tsdown v0.22.3 powered by rolldown v1.1.2
3
- ℹ config file: /home/runner/work/pluv/pluv/packages/crdt/tsdown.config.ts
4
- ℹ entry: src/index.ts
5
- ℹ target: esnext
6
- ℹ tsconfig: tsconfig.json
7
- ℹ Build start
8
- ℹ dist/index.mjs 1.93 kB │ gzip: 0.65 kB
9
- ℹ dist/index.mjs.map 5.39 kB │ gzip: 1.60 kB
10
- ℹ dist/index.d.mts.map 1.38 kB │ gzip: 0.54 kB
11
- ℹ dist/index.d.mts 3.33 kB │ gzip: 0.92 kB
12
- ℹ 4 files, total: 12.03 kB
13
- ✔ Build complete in 508ms
package/CHANGELOG.md DELETED
@@ -1,850 +0,0 @@
1
- # @pluv/crdt
2
-
3
- ## 5.0.0
4
-
5
- ### Patch Changes
6
-
7
- - @pluv/types@5.0.0
8
-
9
- ## 4.1.0
10
-
11
- ### Patch Changes
12
-
13
- - @pluv/types@4.1.0
14
-
15
- ## 4.0.2
16
-
17
- ### Patch Changes
18
-
19
- - e1913b3: Upgraded internal dependencies
20
- - Updated dependencies [e1913b3]
21
- - @pluv/types@4.0.2
22
-
23
- ## 4.0.1
24
-
25
- ### Patch Changes
26
-
27
- - @pluv/types@4.0.1
28
-
29
- ## 4.0.0
30
-
31
- ### Major Changes
32
-
33
- - df5c39c: Update all packages to be ESM only.
34
-
35
- ### Minor Changes
36
-
37
- - 037074e: Migrated build process from tsup to tsdown.
38
-
39
- ### Patch Changes
40
-
41
- - 2eb5def: Bumped dependencies.
42
- - Updated dependencies [2eb5def]
43
- - Updated dependencies [df5c39c]
44
- - Updated dependencies [037074e]
45
- - @pluv/types@4.0.0
46
-
47
- ## 3.2.2
48
-
49
- ### Patch Changes
50
-
51
- - Updated dependencies [8665dbe]
52
- - @pluv/types@3.2.2
53
-
54
- ## 3.2.1
55
-
56
- ### Patch Changes
57
-
58
- - @pluv/types@3.2.1
59
-
60
- ## 3.2.0
61
-
62
- ### Patch Changes
63
-
64
- - @pluv/types@3.2.0
65
-
66
- ## 3.1.7
67
-
68
- ### Patch Changes
69
-
70
- - @pluv/types@3.1.7
71
-
72
- ## 3.1.6
73
-
74
- ### Patch Changes
75
-
76
- - @pluv/types@3.1.6
77
-
78
- ## 3.1.5
79
-
80
- ### Patch Changes
81
-
82
- - @pluv/types@3.1.5
83
-
84
- ## 3.1.4
85
-
86
- ### Patch Changes
87
-
88
- - @pluv/types@3.1.4
89
-
90
- ## 3.1.3
91
-
92
- ### Patch Changes
93
-
94
- - @pluv/types@3.1.3
95
-
96
- ## 3.1.2
97
-
98
- ### Patch Changes
99
-
100
- - @pluv/types@3.1.2
101
-
102
- ## 3.1.1
103
-
104
- ### Patch Changes
105
-
106
- - @pluv/types@3.1.1
107
-
108
- ## 3.1.0
109
-
110
- ### Patch Changes
111
-
112
- - @pluv/types@3.1.0
113
-
114
- ## 3.0.0
115
-
116
- ### Patch Changes
117
-
118
- - @pluv/types@3.0.0
119
-
120
- ## 2.3.1
121
-
122
- ### Patch Changes
123
-
124
- - @pluv/types@2.3.1
125
-
126
- ## 2.3.0
127
-
128
- ### Patch Changes
129
-
130
- - @pluv/types@2.3.0
131
-
132
- ## 2.2.8
133
-
134
- ### Patch Changes
135
-
136
- - @pluv/types@2.2.8
137
-
138
- ## 2.2.7
139
-
140
- ### Patch Changes
141
-
142
- - @pluv/types@2.2.7
143
-
144
- ## 2.2.6
145
-
146
- ### Patch Changes
147
-
148
- - @pluv/types@2.2.6
149
-
150
- ## 2.2.5
151
-
152
- ### Patch Changes
153
-
154
- - @pluv/types@2.2.5
155
-
156
- ## 2.2.4
157
-
158
- ### Patch Changes
159
-
160
- - @pluv/types@2.2.4
161
-
162
- ## 2.2.3
163
-
164
- ### Patch Changes
165
-
166
- - @pluv/types@2.2.3
167
-
168
- ## 2.2.2
169
-
170
- ### Patch Changes
171
-
172
- - @pluv/types@2.2.2
173
-
174
- ## 2.2.1
175
-
176
- ### Patch Changes
177
-
178
- - @pluv/types@2.2.1
179
-
180
- ## 2.2.0
181
-
182
- ### Patch Changes
183
-
184
- - @pluv/types@2.2.0
185
-
186
- ## 2.1.0
187
-
188
- ### Patch Changes
189
-
190
- - @pluv/types@2.1.0
191
-
192
- ## 2.0.2
193
-
194
- ### Patch Changes
195
-
196
- - @pluv/types@2.0.2
197
-
198
- ## 2.0.1
199
-
200
- ### Patch Changes
201
-
202
- - @pluv/types@2.0.1
203
-
204
- ## 2.0.0
205
-
206
- ### Patch Changes
207
-
208
- - 047a1d8: Moved several internal types to `@pluv/types`.
209
- - Updated dependencies [047a1d8]
210
- - @pluv/types@2.0.0
211
-
212
- ## 1.0.2
213
-
214
- ### Patch Changes
215
-
216
- - @pluv/types@1.0.2
217
-
218
- ## 1.0.1
219
-
220
- ### Patch Changes
221
-
222
- - @pluv/types@1.0.1
223
-
224
- ## 1.0.0
225
-
226
- ### Major Changes
227
-
228
- - af94706: pluv.io is now stable and production ready!
229
-
230
- 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.
231
-
232
- Checkout the [full documentation here](https://pluv.io/docs/introduction) to get started today!
233
-
234
- ### Patch Changes
235
-
236
- - Updated dependencies [af94706]
237
- - @pluv/types@1.0.0
238
-
239
- ## 0.44.2
240
-
241
- ### Patch Changes
242
-
243
- - @pluv/types@0.44.2
244
-
245
- ## 0.44.1
246
-
247
- ### Patch Changes
248
-
249
- - @pluv/types@0.44.1
250
-
251
- ## 0.44.0
252
-
253
- ### Patch Changes
254
-
255
- - @pluv/types@0.44.0
256
-
257
- ## 0.43.0
258
-
259
- ### Patch Changes
260
-
261
- - @pluv/types@0.43.0
262
-
263
- ## 0.42.0
264
-
265
- ### Patch Changes
266
-
267
- - @pluv/types@0.42.0
268
-
269
- ## 0.41.7
270
-
271
- ### Patch Changes
272
-
273
- - @pluv/types@0.41.7
274
-
275
- ## 0.41.6
276
-
277
- ### Patch Changes
278
-
279
- - @pluv/types@0.41.6
280
-
281
- ## 0.41.5
282
-
283
- ### Patch Changes
284
-
285
- - @pluv/types@0.41.5
286
-
287
- ## 0.41.4
288
-
289
- ### Patch Changes
290
-
291
- - @pluv/types@0.41.4
292
-
293
- ## 0.41.3
294
-
295
- ### Patch Changes
296
-
297
- - @pluv/types@0.41.3
298
-
299
- ## 0.41.2
300
-
301
- ### Patch Changes
302
-
303
- - @pluv/types@0.41.2
304
-
305
- ## 0.41.1
306
-
307
- ### Patch Changes
308
-
309
- - @pluv/types@0.41.1
310
-
311
- ## 0.41.0
312
-
313
- ### Patch Changes
314
-
315
- - @pluv/types@0.41.0
316
-
317
- ## 0.40.2
318
-
319
- ### Patch Changes
320
-
321
- - @pluv/types@0.40.2
322
-
323
- ## 0.40.1
324
-
325
- ### Patch Changes
326
-
327
- - @pluv/types@0.40.1
328
-
329
- ## 0.40.0
330
-
331
- ### Patch Changes
332
-
333
- - @pluv/types@0.40.0
334
-
335
- ## 0.39.1
336
-
337
- ### Patch Changes
338
-
339
- - @pluv/types@0.39.1
340
-
341
- ## 0.39.0
342
-
343
- ### Patch Changes
344
-
345
- - @pluv/types@0.39.0
346
-
347
- ## 0.38.14
348
-
349
- ### Patch Changes
350
-
351
- - @pluv/types@0.38.14
352
-
353
- ## 0.38.13
354
-
355
- ### Patch Changes
356
-
357
- - @pluv/types@0.38.13
358
-
359
- ## 0.38.12
360
-
361
- ### Patch Changes
362
-
363
- - @pluv/types@0.38.12
364
-
365
- ## 0.38.11
366
-
367
- ### Patch Changes
368
-
369
- - @pluv/types@0.38.11
370
-
371
- ## 0.38.10
372
-
373
- ### Patch Changes
374
-
375
- - @pluv/types@0.38.10
376
-
377
- ## 0.38.9
378
-
379
- ### Patch Changes
380
-
381
- - @pluv/types@0.38.9
382
-
383
- ## 0.38.8
384
-
385
- ### Patch Changes
386
-
387
- - @pluv/types@0.38.8
388
-
389
- ## 0.38.7
390
-
391
- ### Patch Changes
392
-
393
- - @pluv/types@0.38.7
394
-
395
- ## 0.38.6
396
-
397
- ### Patch Changes
398
-
399
- - @pluv/types@0.38.6
400
-
401
- ## 0.38.5
402
-
403
- ### Patch Changes
404
-
405
- - @pluv/types@0.38.5
406
-
407
- ## 0.38.4
408
-
409
- ### Patch Changes
410
-
411
- - @pluv/types@0.38.4
412
-
413
- ## 0.38.3
414
-
415
- ### Patch Changes
416
-
417
- - @pluv/types@0.38.3
418
-
419
- ## 0.38.2
420
-
421
- ### Patch Changes
422
-
423
- - @pluv/types@0.38.2
424
-
425
- ## 0.38.1
426
-
427
- ### Patch Changes
428
-
429
- - @pluv/types@0.38.1
430
-
431
- ## 0.38.0
432
-
433
- ### Patch Changes
434
-
435
- - Updated dependencies [f4ceca3]
436
- - @pluv/types@0.38.0
437
-
438
- ## 0.37.7
439
-
440
- ### Patch Changes
441
-
442
- - @pluv/types@0.37.7
443
-
444
- ## 0.37.6
445
-
446
- ### Patch Changes
447
-
448
- - @pluv/types@0.37.6
449
-
450
- ## 0.37.5
451
-
452
- ### Patch Changes
453
-
454
- - @pluv/types@0.37.5
455
-
456
- ## 0.37.4
457
-
458
- ### Patch Changes
459
-
460
- - @pluv/types@0.37.4
461
-
462
- ## 0.37.3
463
-
464
- ### Patch Changes
465
-
466
- - @pluv/types@0.37.3
467
-
468
- ## 0.37.2
469
-
470
- ### Patch Changes
471
-
472
- - @pluv/types@0.37.2
473
-
474
- ## 0.37.1
475
-
476
- ### Patch Changes
477
-
478
- - @pluv/types@0.37.1
479
-
480
- ## 0.37.0
481
-
482
- ### Patch Changes
483
-
484
- - @pluv/types@0.37.0
485
-
486
- ## 0.36.0
487
-
488
- ### Patch Changes
489
-
490
- - @pluv/types@0.36.0
491
-
492
- ## 0.35.4
493
-
494
- ### Patch Changes
495
-
496
- - @pluv/types@0.35.4
497
-
498
- ## 0.35.3
499
-
500
- ### Patch Changes
501
-
502
- - @pluv/types@0.35.3
503
-
504
- ## 0.35.2
505
-
506
- ### Patch Changes
507
-
508
- - Updated dependencies [81cb692]
509
- - @pluv/types@0.35.2
510
-
511
- ## 0.35.1
512
-
513
- ### Patch Changes
514
-
515
- - @pluv/types@0.35.1
516
-
517
- ## 0.35.0
518
-
519
- ### Patch Changes
520
-
521
- - @pluv/types@0.35.0
522
-
523
- ## 0.34.1
524
-
525
- ### Patch Changes
526
-
527
- - @pluv/types@0.34.1
528
-
529
- ## 0.34.0
530
-
531
- ### Patch Changes
532
-
533
- - @pluv/types@0.34.0
534
-
535
- ## 0.33.0
536
-
537
- ### Patch Changes
538
-
539
- - @pluv/types@0.33.0
540
-
541
- ## 0.32.9
542
-
543
- ### Patch Changes
544
-
545
- - @pluv/types@0.32.9
546
-
547
- ## 0.32.8
548
-
549
- ### Patch Changes
550
-
551
- - @pluv/types@0.32.8
552
-
553
- ## 0.32.7
554
-
555
- ### Patch Changes
556
-
557
- - @pluv/types@0.32.7
558
-
559
- ## 0.32.6
560
-
561
- ### Patch Changes
562
-
563
- - @pluv/types@0.32.6
564
-
565
- ## 0.32.5
566
-
567
- ### Patch Changes
568
-
569
- - @pluv/types@0.32.5
570
-
571
- ## 0.32.4
572
-
573
- ### Patch Changes
574
-
575
- - @pluv/types@0.32.4
576
-
577
- ## 0.32.3
578
-
579
- ### Patch Changes
580
-
581
- - @pluv/types@0.32.3
582
-
583
- ## 0.32.2
584
-
585
- ### Patch Changes
586
-
587
- - @pluv/types@0.32.2
588
-
589
- ## 0.32.1
590
-
591
- ### Patch Changes
592
-
593
- - @pluv/types@0.32.1
594
-
595
- ## 0.32.0
596
-
597
- ### Patch Changes
598
-
599
- - @pluv/types@0.32.0
600
-
601
- ## 0.31.0
602
-
603
- ### Patch Changes
604
-
605
- - @pluv/types@0.31.0
606
-
607
- ## 0.30.2
608
-
609
- ### Patch Changes
610
-
611
- - @pluv/types@0.30.2
612
-
613
- ## 0.30.1
614
-
615
- ### Patch Changes
616
-
617
- - @pluv/types@0.30.1
618
-
619
- ## 0.30.0
620
-
621
- ### Patch Changes
622
-
623
- - @pluv/types@0.30.0
624
-
625
- ## 0.29.0
626
-
627
- ### Patch Changes
628
-
629
- - @pluv/types@0.29.0
630
-
631
- ## 0.28.0
632
-
633
- ### Patch Changes
634
-
635
- - @pluv/types@0.28.0
636
-
637
- ## 0.27.0
638
-
639
- ### Patch Changes
640
-
641
- - @pluv/types@0.27.0
642
-
643
- ## 0.26.0
644
-
645
- ### Patch Changes
646
-
647
- - @pluv/types@0.26.0
648
-
649
- ## 0.25.4
650
-
651
- ### Patch Changes
652
-
653
- - @pluv/types@0.25.4
654
-
655
- ## 0.25.3
656
-
657
- ### Patch Changes
658
-
659
- - @pluv/types@0.25.3
660
-
661
- ## 0.25.2
662
-
663
- ### Patch Changes
664
-
665
- - @pluv/types@0.25.2
666
-
667
- ## 0.25.1
668
-
669
- ### Patch Changes
670
-
671
- - @pluv/types@0.25.1
672
-
673
- ## 0.25.0
674
-
675
- ### Patch Changes
676
-
677
- - @pluv/types@0.25.0
678
-
679
- ## 0.24.1
680
-
681
- ### Patch Changes
682
-
683
- - @pluv/types@0.24.1
684
-
685
- ## 0.24.0
686
-
687
- ### Patch Changes
688
-
689
- - @pluv/types@0.24.0
690
-
691
- ## 0.23.0
692
-
693
- ### Patch Changes
694
-
695
- - @pluv/types@0.23.0
696
-
697
- ## 0.22.0
698
-
699
- ### Patch Changes
700
-
701
- - @pluv/types@0.22.0
702
-
703
- ## 0.21.1
704
-
705
- ### Patch Changes
706
-
707
- - @pluv/types@0.21.1
708
-
709
- ## 0.21.0
710
-
711
- ### Patch Changes
712
-
713
- - @pluv/types@0.21.0
714
-
715
- ## 0.20.0
716
-
717
- ### Minor Changes
718
-
719
- - 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.
720
-
721
- 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.
722
-
723
- 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.
724
-
725
- ```ts
726
- // Before
727
-
728
- import { yjs } from "@pluv/crdt-yjs";
729
-
730
- yjs.array([]); // Returns CrdtYjsArray
731
- yjs.object([]); // Returns CrdtYjsObject
732
-
733
- const room: PluvRoom = /* ... */;
734
-
735
- room.getStorage("messages"); // Returns AbstractCrdtType
736
-
737
- const [, sharedType] = useStorage("messages"); // sharedType is an AbstractCrdtType
738
- ```
739
-
740
- ```ts
741
- // Now
742
-
743
- import { yjs } from "@pluv/crdt-yjs";
744
-
745
- yjs.array([]); // Returns yjs.Array
746
- yjs.object([]); // Returns yjs.Map
747
-
748
- const room: PluvRoom = /* ... */;
749
-
750
- room.getStorage("messages"); // Returns yjs.AbstractType
751
-
752
- const [, sharedType] = useStorage("messages"); // sharedType is a yjs.AbstractType
753
- ```
754
-
755
- 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:
756
-
757
- ```ts
758
- // Before
759
-
760
- const [data, container] = useStorage("messages");
761
-
762
- // This automatically called Loro.commit under the hood and rerendered the page with updated data.
763
- container.push(loro.object({ name: "John Doe", age: 35 }));
764
- ```
765
-
766
- ```ts
767
- // Now
768
-
769
- const [data, container] = useStorage("messages");
770
-
771
- const doc = useDoc();
772
- const transact = useTransact();
773
-
774
- // Updates need to be committed back to the doc whenever the changes need to be emitted to other users
775
- // The returned data also will not update until the changes are commited
776
-
777
- // The two operations below are functionally equivalent
778
- transact(() => {
779
- container.push(loro.object({ name: "John Doe", age: 35 }));
780
- });
781
-
782
- container.push(loro.object({ name: "John Doe", age: 35 }));
783
- doc.value.commit();
784
- ```
785
-
786
- ### Patch Changes
787
-
788
- - @pluv/types@0.20.0
789
-
790
- ## 0.19.0
791
-
792
- ### Patch Changes
793
-
794
- - @pluv/types@0.19.0
795
-
796
- ## 0.18.0
797
-
798
- ### Patch Changes
799
-
800
- - Updated dependencies [99b5ca9]
801
- - @pluv/types@0.18.0
802
-
803
- ## 0.17.3
804
-
805
- ### Patch Changes
806
-
807
- - @pluv/types@0.17.3
808
-
809
- ## 0.17.2
810
-
811
- ### Patch Changes
812
-
813
- - @pluv/types@0.17.2
814
-
815
- ## 0.17.1
816
-
817
- ### Patch Changes
818
-
819
- - @pluv/types@0.17.1
820
-
821
- ## 0.17.0
822
-
823
- ### Patch Changes
824
-
825
- - Updated dependencies [507bc00]
826
- - @pluv/types@0.17.0
827
-
828
- ## 0.16.3
829
-
830
- ### Patch Changes
831
-
832
- - @pluv/types@0.16.3
833
-
834
- ## 0.16.2
835
-
836
- ### Patch Changes
837
-
838
- - @pluv/types@0.16.2
839
-
840
- ## 0.16.1
841
-
842
- ### Patch Changes
843
-
844
- - @pluv/types@0.16.1
845
-
846
- ## 0.16.0
847
-
848
- ### Patch Changes
849
-
850
- - @pluv/types@0.16.0
package/eslint.config.mjs DELETED
@@ -1,4 +0,0 @@
1
- import { config } from "eslint-config-pluv/base";
2
-
3
- /** @type {import("eslint").Linter.Config} */
4
- export default config;
@@ -1,45 +0,0 @@
1
- import type { CrdtDocFactory, CrdtDocLike, CrdtType, Maybe } from "@pluv/types";
2
-
3
- export abstract class AbstractCrdtDocFactory<
4
- TDoc extends any,
5
- TStorage extends Record<string, CrdtType<any, any>>,
6
- > implements CrdtDocFactory<TDoc, TStorage> {
7
- public _initialStorage: (builder: any) => TStorage;
8
-
9
- constructor(initialStorage: (builder: any) => TStorage) {
10
- this._initialStorage = initialStorage;
11
- }
12
-
13
- public abstract getEmpty(): CrdtDocLike<TDoc, TStorage>;
14
- public abstract getFactory(
15
- initialStorage?: (builder: any) => TStorage,
16
- ): AbstractCrdtDocFactory<TDoc, TStorage>;
17
- public abstract getInitialized(
18
- initialStorage?: (builder: any) => TStorage,
19
- ): CrdtDocLike<TDoc, TStorage>;
20
-
21
- public isEmpty(initialState: Maybe<string>): boolean {
22
- const doc = this.getEmpty().applyEncodedState({ update: initialState });
23
- const isEmpty = doc.isEmpty();
24
- doc.destroy();
25
-
26
- return isEmpty;
27
- }
28
-
29
- public resolveEncodedState(updates: string | string[] | readonly string[]): string | null {
30
- if (typeof updates === "string") return updates;
31
- if (Array.isArray(updates) && !updates.length) return null;
32
-
33
- const applied = this.getEmpty().batchApplyEncodedState({ updates });
34
-
35
- if (applied.isEmpty()) {
36
- applied.destroy();
37
- return null;
38
- }
39
-
40
- const encodedState = applied.getEncodedState();
41
- applied.destroy();
42
-
43
- return encodedState;
44
- }
45
- }
@@ -1,74 +0,0 @@
1
- import {
2
- CrdtDocLike,
3
- DocApplyEncodedStateParams,
4
- DocBatchApplyEncodedStateParams,
5
- DocSubscribeCallbackParams,
6
- } from "@pluv/types";
7
-
8
- export class NoopCrdtDoc implements CrdtDocLike<any, any> {
9
- public value: any = null;
10
-
11
- public applyEncodedState(params: DocApplyEncodedStateParams): this {
12
- return this;
13
- }
14
-
15
- public batchApplyEncodedState(params: DocBatchApplyEncodedStateParams): this {
16
- return this;
17
- }
18
-
19
- public canRedo(): boolean {
20
- return false;
21
- }
22
-
23
- public canUndo(): boolean {
24
- return false;
25
- }
26
-
27
- public destroy(): void {
28
- return;
29
- }
30
-
31
- public get(key?: undefined): {};
32
- public get<TKey extends never>(key: TKey): {}[TKey];
33
- public get(key?: string): {} | undefined {
34
- return typeof key === "string" ? undefined : {};
35
- }
36
-
37
- public getEncodedState(): string {
38
- return "";
39
- }
40
-
41
- public isEmpty(): boolean {
42
- return true;
43
- }
44
-
45
- public rebuildStorage(): this {
46
- return this;
47
- }
48
-
49
- public redo(): this {
50
- return this;
51
- }
52
-
53
- public subscribe(listener: (params: DocSubscribeCallbackParams<any, any>) => void): () => void {
54
- return () => undefined;
55
- }
56
-
57
- public toJson(): any {
58
- return {};
59
- }
60
-
61
- public track(): this {
62
- return this;
63
- }
64
-
65
- public transact(fn: () => void, origin?: string | undefined): this {
66
- fn();
67
-
68
- return this;
69
- }
70
-
71
- public undo(): this {
72
- return this;
73
- }
74
- }
@@ -1,20 +0,0 @@
1
- import { AbstractCrdtDocFactory } from "./AbstractCrdtDocFactory";
2
- import { NoopCrdtDoc } from "./NoopCrdtDoc";
3
-
4
- export class NoopCrdtDocFactory extends AbstractCrdtDocFactory<any, any> {
5
- constructor(initialStorage: () => {} = () => ({})) {
6
- super(initialStorage);
7
- }
8
-
9
- public getEmpty(): NoopCrdtDoc {
10
- return new NoopCrdtDoc();
11
- }
12
-
13
- public getFactory(initialStorage?: ((builder: any) => any) | undefined): NoopCrdtDocFactory {
14
- return this;
15
- }
16
-
17
- public getInitialized(initialStorage?: ((builder: any) => any) | undefined): NoopCrdtDoc {
18
- return new NoopCrdtDoc();
19
- }
20
- }
package/src/index.ts DELETED
@@ -1,20 +0,0 @@
1
- export type {
2
- CrdtDocLike,
3
- CrdtType,
4
- DocApplyEncodedStateParams,
5
- DocBatchApplyEncodedStateParams,
6
- DocSubscribeCallbackParams,
7
- InferCrdtJson,
8
- } from "@pluv/types";
9
- export { AbstractCrdtDocFactory } from "./AbstractCrdtDocFactory";
10
- export { noop } from "./noop";
11
- export { NoopCrdtDoc } from "./NoopCrdtDoc";
12
- export { NoopCrdtDocFactory } from "./NoopCrdtDocFactory";
13
- export type {
14
- CrdtLibraryType,
15
- InferBuilder,
16
- InferDoc,
17
- InferDocLike,
18
- InferInitialStorageFn,
19
- InferStorage,
20
- } from "./types";
package/src/noop.ts DELETED
@@ -1,5 +0,0 @@
1
- import { NoopCrdtDocFactory } from "./NoopCrdtDocFactory";
2
-
3
- export const noop = {
4
- doc: (args?: any) => new NoopCrdtDocFactory(),
5
- };
package/src/types.ts DELETED
@@ -1,21 +0,0 @@
1
- import type { AbstractCrdtDocFactory } from "./AbstractCrdtDocFactory";
2
-
3
- export type { CrdtLibraryType } from "@pluv/types";
4
-
5
- export type InferDoc<TFactory extends AbstractCrdtDocFactory<any, any>> =
6
- InferDocLike<TFactory>["value"];
7
-
8
- export type InferDocLike<TFactory extends AbstractCrdtDocFactory<any, any>> = ReturnType<
9
- TFactory["getInitialized"]
10
- >;
11
-
12
- export type InferInitialStorageFn<TFactory extends AbstractCrdtDocFactory<any, any>> =
13
- TFactory["_initialStorage"];
14
-
15
- export type InferStorage<TFactory extends AbstractCrdtDocFactory<any, any>> = ReturnType<
16
- InferInitialStorageFn<TFactory>
17
- >;
18
-
19
- export type InferBuilder<TFactory extends AbstractCrdtDocFactory<any, any>> = Parameters<
20
- InferInitialStorageFn<TFactory>
21
- >[0];
package/tsconfig.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "@pluv/tsconfig/library.json",
3
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
4
- "exclude": ["node_modules"],
5
- "compilerOptions": {
6
- "lib": ["esnext"]
7
- }
8
- }
package/tsdown.config.ts DELETED
@@ -1,14 +0,0 @@
1
- import { defineConfig } from "tsdown";
2
-
3
- export default defineConfig({
4
- format: ["esm"],
5
- dts: true,
6
- outDir: "dist",
7
- entry: "src/index.ts",
8
- target: "esnext",
9
- sourcemap: true,
10
- clean: true,
11
- exports: {
12
- all: true,
13
- },
14
- });