@pluv/react 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/CHANGELOG.md DELETED
@@ -1,2505 +0,0 @@
1
- # @pluv/react
2
-
3
- ## 5.0.0
4
-
5
- ### Patch Changes
6
-
7
- - @pluv/client@5.0.0
8
- - @pluv/crdt@5.0.0
9
- - @pluv/types@5.0.0
10
-
11
- ## 4.1.0
12
-
13
- ### Patch Changes
14
-
15
- - @pluv/client@4.1.0
16
- - @pluv/crdt@4.1.0
17
- - @pluv/types@4.1.0
18
-
19
- ## 4.0.2
20
-
21
- ### Patch Changes
22
-
23
- - e1913b3: Upgraded internal dependencies
24
- - Updated dependencies [e1913b3]
25
- - @pluv/client@4.0.2
26
- - @pluv/types@4.0.2
27
- - @pluv/crdt@4.0.2
28
-
29
- ## 4.0.1
30
-
31
- ### Patch Changes
32
-
33
- - @pluv/client@4.0.1
34
- - @pluv/crdt@4.0.1
35
- - @pluv/types@4.0.1
36
-
37
- ## 4.0.0
38
-
39
- ### Major Changes
40
-
41
- - df5c39c: Update all packages to be ESM only.
42
-
43
- ### Minor Changes
44
-
45
- - 037074e: Migrated build process from tsup to tsdown.
46
-
47
- ### Patch Changes
48
-
49
- - 2eb5def: Bumped dependencies.
50
- - Updated dependencies [2eb5def]
51
- - Updated dependencies [df5c39c]
52
- - Updated dependencies [037074e]
53
- - @pluv/client@4.0.0
54
- - @pluv/types@4.0.0
55
- - @pluv/crdt@4.0.0
56
-
57
- ## 3.2.2
58
-
59
- ### Patch Changes
60
-
61
- - Updated dependencies [8665dbe]
62
- - @pluv/client@3.2.2
63
- - @pluv/types@3.2.2
64
- - @pluv/crdt@3.2.2
65
-
66
- ## 3.2.1
67
-
68
- ### Patch Changes
69
-
70
- - Updated dependencies [1e0c886]
71
- - @pluv/client@3.2.1
72
- - @pluv/crdt@3.2.1
73
- - @pluv/types@3.2.1
74
-
75
- ## 3.2.0
76
-
77
- ### Patch Changes
78
-
79
- - @pluv/client@3.2.0
80
- - @pluv/crdt@3.2.0
81
- - @pluv/types@3.2.0
82
-
83
- ## 3.1.7
84
-
85
- ### Patch Changes
86
-
87
- - @pluv/client@3.1.7
88
- - @pluv/crdt@3.1.7
89
- - @pluv/types@3.1.7
90
-
91
- ## 3.1.6
92
-
93
- ### Patch Changes
94
-
95
- - fd8d314: Fix creating excessive storage subscriptions.
96
- - @pluv/client@3.1.6
97
- - @pluv/crdt@3.1.6
98
- - @pluv/types@3.1.6
99
-
100
- ## 3.1.5
101
-
102
- ### Patch Changes
103
-
104
- - @pluv/client@3.1.5
105
- - @pluv/crdt@3.1.5
106
- - @pluv/types@3.1.5
107
-
108
- ## 3.1.4
109
-
110
- ### Patch Changes
111
-
112
- - Updated dependencies [e443b66]
113
- - @pluv/client@3.1.4
114
- - @pluv/crdt@3.1.4
115
- - @pluv/types@3.1.4
116
-
117
- ## 3.1.3
118
-
119
- ### Patch Changes
120
-
121
- - @pluv/client@3.1.3
122
- - @pluv/crdt@3.1.3
123
- - @pluv/types@3.1.3
124
-
125
- ## 3.1.2
126
-
127
- ### Patch Changes
128
-
129
- - @pluv/client@3.1.2
130
- - @pluv/crdt@3.1.2
131
- - @pluv/types@3.1.2
132
-
133
- ## 3.1.1
134
-
135
- ### Patch Changes
136
-
137
- - @pluv/client@3.1.1
138
- - @pluv/crdt@3.1.1
139
- - @pluv/types@3.1.1
140
-
141
- ## 3.1.0
142
-
143
- ### Patch Changes
144
-
145
- - Updated dependencies [022857d]
146
- - @pluv/client@3.1.0
147
- - @pluv/crdt@3.1.0
148
- - @pluv/types@3.1.0
149
-
150
- ## 3.0.0
151
-
152
- ### Patch Changes
153
-
154
- - Updated dependencies [bc1ae91]
155
- - @pluv/client@3.0.0
156
- - @pluv/crdt@3.0.0
157
- - @pluv/types@3.0.0
158
-
159
- ## 2.3.1
160
-
161
- ### Patch Changes
162
-
163
- - @pluv/client@2.3.1
164
- - @pluv/crdt@2.3.1
165
- - @pluv/types@2.3.1
166
-
167
- ## 2.3.0
168
-
169
- ### Patch Changes
170
-
171
- - @pluv/client@2.3.0
172
- - @pluv/crdt@2.3.0
173
- - @pluv/types@2.3.0
174
-
175
- ## 2.2.8
176
-
177
- ### Patch Changes
178
-
179
- - @pluv/client@2.2.8
180
- - @pluv/crdt@2.2.8
181
- - @pluv/types@2.2.8
182
-
183
- ## 2.2.7
184
-
185
- ### Patch Changes
186
-
187
- - @pluv/client@2.2.7
188
- - @pluv/crdt@2.2.7
189
- - @pluv/types@2.2.7
190
-
191
- ## 2.2.6
192
-
193
- ### Patch Changes
194
-
195
- - @pluv/client@2.2.6
196
- - @pluv/crdt@2.2.6
197
- - @pluv/types@2.2.6
198
-
199
- ## 2.2.5
200
-
201
- ### Patch Changes
202
-
203
- - @pluv/client@2.2.5
204
- - @pluv/crdt@2.2.5
205
- - @pluv/types@2.2.5
206
-
207
- ## 2.2.4
208
-
209
- ### Patch Changes
210
-
211
- - @pluv/client@2.2.4
212
- - @pluv/crdt@2.2.4
213
- - @pluv/types@2.2.4
214
-
215
- ## 2.2.3
216
-
217
- ### Patch Changes
218
-
219
- - @pluv/client@2.2.3
220
- - @pluv/crdt@2.2.3
221
- - @pluv/types@2.2.3
222
-
223
- ## 2.2.2
224
-
225
- ### Patch Changes
226
-
227
- - @pluv/client@2.2.2
228
- - @pluv/crdt@2.2.2
229
- - @pluv/types@2.2.2
230
-
231
- ## 2.2.1
232
-
233
- ### Patch Changes
234
-
235
- - @pluv/client@2.2.1
236
- - @pluv/crdt@2.2.1
237
- - @pluv/types@2.2.1
238
-
239
- ## 2.2.0
240
-
241
- ### Minor Changes
242
-
243
- - 3ce1547: Updated typings for `useDoc` to be narrower to get the native doc type.
244
-
245
- ```ts
246
- import { createClient } from "@pluv/client";
247
- import { yjs } from "@pluv/crdt-yjs";
248
- import { createBundle } from "@pluv/react";
249
- import type { Doc as YDoc } from "yjs";
250
-
251
- const client = createClient({
252
- // ...
253
- crdt: yjs,
254
- });
255
- const { useDoc } = createBundle(client);
256
-
257
- const doc = useDoc();
258
-
259
- // This is now typed as the native YDoc
260
- doc.value;
261
- // ^? const value: YDoc
262
- ```
263
-
264
- - b999c1c: Added a new type `InferBundleRoom` to get the type of the `PluvRoom` from the react bundle that is created.
265
-
266
- ```ts
267
- import { createClient } from "@pluv/client";
268
- import type { InferBundleRoom } from "@pluv/react";
269
- import { createBundle } from "@pluv/react";
270
-
271
- const client = createclient({
272
- /* ... */
273
- });
274
-
275
- const bundle = createBundle(client);
276
-
277
- type RoomType = InferBundleRoom<typeof bundle>;
278
-
279
- const { useStorage } = bundle;
280
- ```
281
-
282
- ### Patch Changes
283
-
284
- - cb660cd: Fixed the room not changing if the room name was changed on the `PluvRoomProvider` without first unmounting the component.
285
- - 4916c27: Fixed `useConnection` requiring a selector function (this is now optional).
286
- - 48191fa: Fixed `useDoc` not returning a stable doc reference for a single connection.
287
- - Updated dependencies [3ce1547]
288
- - Updated dependencies [fd3bfe2]
289
- - Updated dependencies [aee40cb]
290
- - Updated dependencies [edd1789]
291
- - Updated dependencies [48191fa]
292
- - @pluv/client@2.2.0
293
- - @pluv/crdt@2.2.0
294
- - @pluv/types@2.2.0
295
-
296
- ## 2.1.0
297
-
298
- ### Minor Changes
299
-
300
- - 8931f7b: Moved `@pluv/client` from `peerDependencies` to `dependencies` due to an unfortunate [changesets design decision](https://github.com/changesets/changesets/issues/1011).
301
-
302
- ### Patch Changes
303
-
304
- - e8d8fbc: Updated the internals of various hooks to use the new `PluvRoom.subscribe` object.
305
- - Updated dependencies [e8d8fbc]
306
- - Updated dependencies [a86ff5e]
307
- - Updated dependencies [d5ac29e]
308
- - Updated dependencies [5ca5cb6]
309
- - Updated dependencies [4acbe1e]
310
- - Updated dependencies [e8d8fbc]
311
- - @pluv/client@2.1.0
312
- - @pluv/crdt@2.1.0
313
- - @pluv/types@2.1.0
314
-
315
- ## 2.0.2
316
-
317
- ### Patch Changes
318
-
319
- - @pluv/client@2.0.2
320
- - @pluv/crdt@2.0.2
321
- - @pluv/types@2.0.2
322
-
323
- ## 2.0.1
324
-
325
- ### Patch Changes
326
-
327
- - Updated dependencies [1b93b18]
328
- - @pluv/client@2.0.1
329
- - @pluv/crdt@2.0.1
330
- - @pluv/types@2.0.1
331
-
332
- ## 2.0.0
333
-
334
- ### Minor Changes
335
-
336
- - 5cec54a: **Deprecated** Declaring top-level types on your CRDT storage via the `yjs` or `loro` utility (e.g. `yjs.array` or `loro.list`) for the `initialStorage` prop on `PluvRoomProvider` is now deprecated, to be removed in the next major release (v2). Continuing to use the `yjs` or `loro` utilities 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 `initialStorage` function. See the example below:
337
-
338
- ```tsx
339
- import { yjs } from "@pluv/crdt-yjs";
340
-
341
- // Before
342
- <PluvRoomProvider
343
- room="example-room"
344
- initialStorage={() => ({
345
- // Using the `yjs` or `loro` utility (in this case `yjs.map`) when
346
- // declaring top-level types is now deprecated
347
- topType: yjs.map([
348
- ["key1", yjs.text("")],
349
- ["key2", yjs.text("")],
350
- ]),
351
- })}
352
- >
353
- <div />
354
- </PluvRoomProvider>
355
-
356
- // After
357
- <PluvRoomProvider
358
- room="example-room"
359
- initialStorage={(t) => ({
360
- // Top-level properties must now use the builder (in this case `t`).
361
- // This effectively calls `yjs.getMap("topType")` to instantiate the type on
362
- // the root document.
363
- // This simply returns the native Yjs shared-types (e.g. Y.Map), which
364
- // allows you operate on your yjs shared-typess in a more native way.
365
- topType: t.map("topType", [
366
- // Declaring nested types should continue to use the `yjs` utilities
367
- // you've used before
368
- ["key1", yjs.text("")],
369
- ["key2", yjs.text("")],
370
- ]),
371
- })}
372
- >
373
- <div />
374
- </PluvRoomProvider>
375
- ```
376
-
377
- The functions on the builder type calls the native yjs shared-type (or loro container type) instantiating methods and returns the native types (e.g. `t.map("topType")` is simply just a `Y.Doc.getMap("topType")`) call under the hood. This allows you to declare your type in a more yjs-native and predictable way, and enables declaring more complex initial storage states if needed.
378
-
379
- ### Patch Changes
380
-
381
- - Updated dependencies [047a1d8]
382
- - Updated dependencies [0806212]
383
- - Updated dependencies [3a34dbb]
384
- - @pluv/client@2.0.0
385
- - @pluv/types@2.0.0
386
- - @pluv/crdt@2.0.0
387
-
388
- ## 1.0.2
389
-
390
- ### Patch Changes
391
-
392
- - Updated dependencies [d87159c]
393
- - @pluv/client@1.0.2
394
- - @pluv/crdt@1.0.2
395
- - @pluv/types@1.0.2
396
-
397
- ## 1.0.1
398
-
399
- ### Patch Changes
400
-
401
- - Updated dependencies [c583be9]
402
- - @pluv/client@1.0.1
403
- - @pluv/crdt@1.0.1
404
- - @pluv/types@1.0.1
405
-
406
- ## 1.0.0
407
-
408
- ### Major Changes
409
-
410
- - 4c8b203: **BREAKING** `@pluv/client` is now a peer dependency of `@pluv/react`.
411
- - af94706: pluv.io is now stable and production ready!
412
-
413
- 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.
414
-
415
- Checkout the [full documentation here](https://pluv.io/docs/introduction) to get started today!
416
-
417
- ### Patch Changes
418
-
419
- - Updated dependencies [af94706]
420
- - @pluv/client@1.0.0
421
- - @pluv/crdt@1.0.0
422
- - @pluv/types@1.0.0
423
-
424
- ## 0.44.2
425
-
426
- ### Patch Changes
427
-
428
- - Updated dependencies [6cfd36f]
429
- - @pluv/client@0.44.2
430
- - @pluv/crdt@0.44.2
431
- - @pluv/types@0.44.2
432
-
433
- ## 0.44.1
434
-
435
- ### Patch Changes
436
-
437
- - Updated dependencies [67c081d]
438
- - @pluv/client@0.44.1
439
- - @pluv/crdt@0.44.1
440
- - @pluv/types@0.44.1
441
-
442
- ## 0.44.0
443
-
444
- ### Patch Changes
445
-
446
- - Updated dependencies [fba9354]
447
- - Updated dependencies [bc2d684]
448
- - Updated dependencies [c9fcea5]
449
- - @pluv/client@0.44.0
450
- - @pluv/crdt@0.44.0
451
- - @pluv/types@0.44.0
452
-
453
- ## 0.43.0
454
-
455
- ### Patch Changes
456
-
457
- - Updated dependencies [65d9172]
458
- - @pluv/client@0.43.0
459
- - @pluv/crdt@0.43.0
460
- - @pluv/types@0.43.0
461
-
462
- ## 0.42.0
463
-
464
- ### Patch Changes
465
-
466
- - Updated dependencies [7ae56bf]
467
- - @pluv/client@0.42.0
468
- - @pluv/crdt@0.42.0
469
- - @pluv/types@0.42.0
470
-
471
- ## 0.41.7
472
-
473
- ### Patch Changes
474
-
475
- - @pluv/client@0.41.7
476
- - @pluv/crdt@0.41.7
477
- - @pluv/types@0.41.7
478
-
479
- ## 0.41.6
480
-
481
- ### Patch Changes
482
-
483
- - Updated dependencies [71642fa]
484
- - @pluv/client@0.41.6
485
- - @pluv/crdt@0.41.6
486
- - @pluv/types@0.41.6
487
-
488
- ## 0.41.5
489
-
490
- ### Patch Changes
491
-
492
- - Updated dependencies [b3b7b30]
493
- - @pluv/client@0.41.5
494
- - @pluv/crdt@0.41.5
495
- - @pluv/types@0.41.5
496
-
497
- ## 0.41.4
498
-
499
- ### Patch Changes
500
-
501
- - @pluv/client@0.41.4
502
- - @pluv/crdt@0.41.4
503
- - @pluv/types@0.41.4
504
-
505
- ## 0.41.3
506
-
507
- ### Patch Changes
508
-
509
- - Updated dependencies [49051c0]
510
- - @pluv/client@0.41.3
511
- - @pluv/crdt@0.41.3
512
- - @pluv/types@0.41.3
513
-
514
- ## 0.41.2
515
-
516
- ### Patch Changes
517
-
518
- - Updated dependencies [37956d3]
519
- - @pluv/client@0.41.2
520
- - @pluv/crdt@0.41.2
521
- - @pluv/types@0.41.2
522
-
523
- ## 0.41.1
524
-
525
- ### Patch Changes
526
-
527
- - @pluv/client@0.41.1
528
- - @pluv/crdt@0.41.1
529
- - @pluv/types@0.41.1
530
-
531
- ## 0.41.0
532
-
533
- ### Patch Changes
534
-
535
- - Updated dependencies [41aa439]
536
- - Updated dependencies [eb2d903]
537
- - Updated dependencies [555b88d]
538
- - Updated dependencies [555b88d]
539
- - @pluv/client@0.41.0
540
- - @pluv/crdt@0.41.0
541
- - @pluv/types@0.41.0
542
-
543
- ## 0.40.2
544
-
545
- ### Patch Changes
546
-
547
- - Updated dependencies [6fbc2fe]
548
- - @pluv/client@0.40.2
549
- - @pluv/crdt@0.40.2
550
- - @pluv/types@0.40.2
551
-
552
- ## 0.40.1
553
-
554
- ### Patch Changes
555
-
556
- - @pluv/client@0.40.1
557
- - @pluv/crdt@0.40.1
558
- - @pluv/types@0.40.1
559
-
560
- ## 0.40.0
561
-
562
- ### Patch Changes
563
-
564
- - @pluv/client@0.40.0
565
- - @pluv/crdt@0.40.0
566
- - @pluv/types@0.40.0
567
-
568
- ## 0.39.1
569
-
570
- ### Patch Changes
571
-
572
- - 36606b4: Fix `PluvRoomProvider` never connecting when `metadata` is a function.
573
- - @pluv/client@0.39.1
574
- - @pluv/crdt@0.39.1
575
- - @pluv/types@0.39.1
576
-
577
- ## 0.39.0
578
-
579
- ### Minor Changes
580
-
581
- - ca160f5: **BREAKING** Update the context value of `MockedRoomContext` to mirror the same shape as `PluvRoomContext`. i.e. the value of `MockedRoomContext` is now the room itself, rather than an object containing the room. This should not be breaking in most cases. If you happen to be using `useContext(MockedRoomContext)`, those will need to be updated as shown below:
582
-
583
- ```tsx
584
- // Before
585
- const { room } = useContext(MockedRoomContext);
586
-
587
- // After
588
- const room = useContext(MockedRoomContext);
589
- ```
590
-
591
- ### Patch Changes
592
-
593
- - e6ddddc: Fixed potential race conditions between connecting and disconnecting between re-renders of `PluvRoomProvider`.
594
- - e6ddddc: (Internal) Update how `PluvRoomProvider` handles the `metadata` prop internally to be updated to how `PluvClient` now handles this (i.e. moved to `PluvClient.enter`, from `PluvClient.createRoom`).
595
- - e6ddddc: Add support for a passing either a function or object for the `metadata` prop on `PluvRoomProvider`. When a function is used, the `metadata` will be gotten at the moment of connection (internally this is a `useEffect`, so browser APIs can be used such as `document`, `window` and `localStorage`).
596
-
597
- ```tsx
598
- // Both of these work
599
- <PluvRoomProvider metadata={{ hello: "world" }}>
600
- {children}
601
- </PluvRoomProvider>
602
-
603
- <PluvRoomProvider
604
- metadata={() => {
605
- const value = localStorage.get(MY_LOCALSTORAGE_KEY);
606
-
607
- return { hello: value };
608
- }}
609
- >
610
- {children}
611
- </PluvRoomProvider>
612
- ```
613
-
614
- - Updated dependencies [e6ddddc]
615
- - Updated dependencies [e6ddddc]
616
- - Updated dependencies [2cfb68d]
617
- - Updated dependencies [e6ddddc]
618
- - @pluv/client@0.39.0
619
- - @pluv/crdt@0.39.0
620
- - @pluv/types@0.39.0
621
-
622
- ## 0.38.14
623
-
624
- ### Patch Changes
625
-
626
- - Updated dependencies [886a1f9]
627
- - @pluv/client@0.38.14
628
- - @pluv/crdt@0.38.14
629
- - @pluv/types@0.38.14
630
-
631
- ## 0.38.13
632
-
633
- ### Patch Changes
634
-
635
- - @pluv/client@0.38.13
636
- - @pluv/crdt@0.38.13
637
- - @pluv/types@0.38.13
638
-
639
- ## 0.38.12
640
-
641
- ### Patch Changes
642
-
643
- - Updated dependencies [b617726]
644
- - @pluv/client@0.38.12
645
- - @pluv/crdt@0.38.12
646
- - @pluv/types@0.38.12
647
-
648
- ## 0.38.11
649
-
650
- ### Patch Changes
651
-
652
- - Updated dependencies [5ac1aba]
653
- - @pluv/client@0.38.11
654
- - @pluv/crdt@0.38.11
655
- - @pluv/types@0.38.11
656
-
657
- ## 0.38.10
658
-
659
- ### Patch Changes
660
-
661
- - Updated dependencies [cadd963]
662
- - @pluv/client@0.38.10
663
- - @pluv/crdt@0.38.10
664
- - @pluv/types@0.38.10
665
-
666
- ## 0.38.9
667
-
668
- ### Patch Changes
669
-
670
- - @pluv/client@0.38.9
671
- - @pluv/crdt@0.38.9
672
- - @pluv/types@0.38.9
673
-
674
- ## 0.38.8
675
-
676
- ### Patch Changes
677
-
678
- - @pluv/client@0.38.8
679
- - @pluv/crdt@0.38.8
680
- - @pluv/types@0.38.8
681
-
682
- ## 0.38.7
683
-
684
- ### Patch Changes
685
-
686
- - @pluv/client@0.38.7
687
- - @pluv/crdt@0.38.7
688
- - @pluv/types@0.38.7
689
-
690
- ## 0.38.6
691
-
692
- ### Patch Changes
693
-
694
- - @pluv/client@0.38.6
695
- - @pluv/crdt@0.38.6
696
- - @pluv/types@0.38.6
697
-
698
- ## 0.38.5
699
-
700
- ### Patch Changes
701
-
702
- - @pluv/client@0.38.5
703
- - @pluv/crdt@0.38.5
704
- - @pluv/types@0.38.5
705
-
706
- ## 0.38.4
707
-
708
- ### Patch Changes
709
-
710
- - @pluv/client@0.38.4
711
- - @pluv/crdt@0.38.4
712
- - @pluv/types@0.38.4
713
-
714
- ## 0.38.3
715
-
716
- ### Patch Changes
717
-
718
- - Updated dependencies [8346273]
719
- - @pluv/client@0.38.3
720
- - @pluv/crdt@0.38.3
721
- - @pluv/types@0.38.3
722
-
723
- ## 0.38.2
724
-
725
- ### Patch Changes
726
-
727
- - Updated dependencies [de35f0b]
728
- - @pluv/client@0.38.2
729
- - @pluv/crdt@0.38.2
730
- - @pluv/types@0.38.2
731
-
732
- ## 0.38.1
733
-
734
- ### Patch Changes
735
-
736
- - @pluv/client@0.38.1
737
- - @pluv/crdt@0.38.1
738
- - @pluv/types@0.38.1
739
-
740
- ## 0.38.0
741
-
742
- ### Patch Changes
743
-
744
- - Updated dependencies [f4ceca3]
745
- - @pluv/client@0.38.0
746
- - @pluv/types@0.38.0
747
- - @pluv/crdt@0.38.0
748
-
749
- ## 0.37.7
750
-
751
- ### Patch Changes
752
-
753
- - @pluv/client@0.37.7
754
- - @pluv/crdt@0.37.7
755
- - @pluv/types@0.37.7
756
-
757
- ## 0.37.6
758
-
759
- ### Patch Changes
760
-
761
- - @pluv/client@0.37.6
762
- - @pluv/crdt@0.37.6
763
- - @pluv/types@0.37.6
764
-
765
- ## 0.37.5
766
-
767
- ### Patch Changes
768
-
769
- - @pluv/client@0.37.5
770
- - @pluv/crdt@0.37.5
771
- - @pluv/types@0.37.5
772
-
773
- ## 0.37.4
774
-
775
- ### Patch Changes
776
-
777
- - Updated dependencies [a9c3d17]
778
- - @pluv/client@0.37.4
779
- - @pluv/crdt@0.37.4
780
- - @pluv/types@0.37.4
781
-
782
- ## 0.37.3
783
-
784
- ### Patch Changes
785
-
786
- - dff89ff: Added an error message for when `createBundle` functions are used outside of `PluvRoomProvider`.
787
- - Updated dependencies [9ae837b]
788
- - @pluv/client@0.37.3
789
- - @pluv/crdt@0.37.3
790
- - @pluv/types@0.37.3
791
-
792
- ## 0.37.2
793
-
794
- ### Patch Changes
795
-
796
- - Updated dependencies [11920af]
797
- - @pluv/client@0.37.2
798
- - @pluv/crdt@0.37.2
799
- - @pluv/types@0.37.2
800
-
801
- ## 0.37.1
802
-
803
- ### Patch Changes
804
-
805
- - Updated dependencies [e923a8d]
806
- - @pluv/client@0.37.1
807
- - @pluv/crdt@0.37.1
808
- - @pluv/types@0.37.1
809
-
810
- ## 0.37.0
811
-
812
- ### Patch Changes
813
-
814
- - @pluv/client@0.37.0
815
- - @pluv/crdt@0.37.0
816
- - @pluv/types@0.37.0
817
-
818
- ## 0.36.0
819
-
820
- ### Minor Changes
821
-
822
- - 2a84951: **BREAKING**
823
-
824
- Removed re-exports of `@pluv/client` and `@pluv/crdt` parts from `@pluv/react`.
825
-
826
- ```ts
827
- // Before
828
-
829
- import { createBundle, createClient } from "@pluv/react";
830
-
831
- // After
832
-
833
- import { createClient } from "@pluv/client";
834
- import { createBundle } from "@pluv/react";
835
- ```
836
-
837
- ### Patch Changes
838
-
839
- - Updated dependencies [4518b6d]
840
- - @pluv/client@0.36.0
841
- - @pluv/crdt@0.36.0
842
- - @pluv/types@0.36.0
843
-
844
- ## 0.35.4
845
-
846
- ### Patch Changes
847
-
848
- - @pluv/client@0.35.4
849
- - @pluv/crdt@0.35.4
850
- - @pluv/types@0.35.4
851
-
852
- ## 0.35.3
853
-
854
- ### Patch Changes
855
-
856
- - @pluv/client@0.35.3
857
- - @pluv/crdt@0.35.3
858
- - @pluv/types@0.35.3
859
-
860
- ## 0.35.2
861
-
862
- ### Patch Changes
863
-
864
- - Updated dependencies [81cb692]
865
- - @pluv/types@0.35.2
866
- - @pluv/client@0.35.2
867
- - @pluv/crdt@0.35.2
868
-
869
- ## 0.35.1
870
-
871
- ### Patch Changes
872
-
873
- - @pluv/client@0.35.1
874
- - @pluv/crdt@0.35.1
875
- - @pluv/types@0.35.1
876
-
877
- ## 0.35.0
878
-
879
- ### Patch Changes
880
-
881
- - @pluv/client@0.35.0
882
- - @pluv/crdt@0.35.0
883
- - @pluv/types@0.35.0
884
-
885
- ## 0.34.1
886
-
887
- ### Patch Changes
888
-
889
- - @pluv/client@0.34.1
890
- - @pluv/crdt@0.34.1
891
- - @pluv/types@0.34.1
892
-
893
- ## 0.34.0
894
-
895
- ### Patch Changes
896
-
897
- - @pluv/client@0.34.0
898
- - @pluv/crdt@0.34.0
899
- - @pluv/types@0.34.0
900
-
901
- ## 0.33.0
902
-
903
- ### Minor Changes
904
-
905
- - c3b07ab: Allow peer react@19.0.0.
906
-
907
- ### Patch Changes
908
-
909
- - @pluv/client@0.33.0
910
- - @pluv/crdt@0.33.0
911
- - @pluv/types@0.33.0
912
-
913
- ## 0.32.9
914
-
915
- ### Patch Changes
916
-
917
- - 89d004d: Fix event proxy types for client-side events.
918
- - @pluv/client@0.32.9
919
- - @pluv/crdt@0.32.9
920
- - @pluv/types@0.32.9
921
-
922
- ## 0.32.8
923
-
924
- ### Patch Changes
925
-
926
- - @pluv/client@0.32.8
927
- - @pluv/crdt@0.32.8
928
- - @pluv/types@0.32.8
929
-
930
- ## 0.32.7
931
-
932
- ### Patch Changes
933
-
934
- - @pluv/client@0.32.7
935
- - @pluv/crdt@0.32.7
936
- - @pluv/types@0.32.7
937
-
938
- ## 0.32.6
939
-
940
- ### Patch Changes
941
-
942
- - @pluv/client@0.32.6
943
- - @pluv/crdt@0.32.6
944
- - @pluv/types@0.32.6
945
-
946
- ## 0.32.5
947
-
948
- ### Patch Changes
949
-
950
- - @pluv/client@0.32.5
951
- - @pluv/crdt@0.32.5
952
- - @pluv/types@0.32.5
953
-
954
- ## 0.32.4
955
-
956
- ### Patch Changes
957
-
958
- - @pluv/client@0.32.4
959
- - @pluv/crdt@0.32.4
960
- - @pluv/types@0.32.4
961
-
962
- ## 0.32.3
963
-
964
- ### Patch Changes
965
-
966
- - 75e992f: Export `register` helper in `@pluv/react`.
967
- - Updated dependencies [b18230f]
968
- - @pluv/client@0.32.3
969
- - @pluv/crdt@0.32.3
970
- - @pluv/types@0.32.3
971
-
972
- ## 0.32.2
973
-
974
- ### Patch Changes
975
-
976
- - @pluv/client@0.32.2
977
- - @pluv/crdt@0.32.2
978
- - @pluv/types@0.32.2
979
-
980
- ## 0.32.1
981
-
982
- ### Patch Changes
983
-
984
- - @pluv/client@0.32.1
985
- - @pluv/crdt@0.32.1
986
- - @pluv/types@0.32.1
987
-
988
- ## 0.32.0
989
-
990
- ### Patch Changes
991
-
992
- - @pluv/client@0.32.0
993
- - @pluv/crdt@0.32.0
994
- - @pluv/types@0.32.0
995
-
996
- ## 0.31.0
997
-
998
- ### Patch Changes
999
-
1000
- - @pluv/client@0.31.0
1001
- - @pluv/crdt@0.31.0
1002
- - @pluv/types@0.31.0
1003
-
1004
- ## 0.30.2
1005
-
1006
- ### Patch Changes
1007
-
1008
- - @pluv/client@0.30.2
1009
- - @pluv/crdt@0.30.2
1010
- - @pluv/types@0.30.2
1011
-
1012
- ## 0.30.1
1013
-
1014
- ### Patch Changes
1015
-
1016
- - @pluv/client@0.30.1
1017
- - @pluv/crdt@0.30.1
1018
- - @pluv/types@0.30.1
1019
-
1020
- ## 0.30.0
1021
-
1022
- ### Patch Changes
1023
-
1024
- - Updated dependencies [cff933a]
1025
- - @pluv/client@0.30.0
1026
- - @pluv/crdt@0.30.0
1027
- - @pluv/types@0.30.0
1028
-
1029
- ## 0.29.0
1030
-
1031
- ### Minor Changes
1032
-
1033
- - 525aeae: **BREAKING**
1034
-
1035
- Merge `createBundle` with `createRoomBundle`.
1036
-
1037
- ```ts
1038
- // Before
1039
- const {
1040
- createRoomBundle,
1041
-
1042
- // components
1043
- PluvProvider,
1044
-
1045
- // hooks
1046
- useClient,
1047
- } = createBundle(client);
1048
-
1049
- export const {
1050
- // components
1051
- MockedRoomProvider,
1052
- PluvRoomProvider,
1053
-
1054
- // utils
1055
- event,
1056
-
1057
- // hooks
1058
- useBroadcast,
1059
- useCanRedo,
1060
- useCanUndo,
1061
- useConnection,
1062
- useDoc,
1063
- useEvent,
1064
- useMyPresence,
1065
- useMyself,
1066
- useOther,
1067
- useOthers,
1068
- useRedo,
1069
- useRoom,
1070
- useStorage,
1071
- useTransact,
1072
- useUndo,
1073
- } = createRoomBundle({});
1074
-
1075
- // After
1076
- const {
1077
- // components
1078
- MockedRoomProvider,
1079
- PluvProvider,
1080
- PluvRoomProvider,
1081
-
1082
- // utils
1083
- event,
1084
-
1085
- // hooks
1086
- useBroadcast,
1087
- useCanRedo,
1088
- useCanUndo,
1089
- useClient,
1090
- useConnection,
1091
- useDoc,
1092
- useEvent,
1093
- useMyPresence,
1094
- useMyself,
1095
- useOther,
1096
- useOthers,
1097
- useRedo,
1098
- useRoom,
1099
- useStorage,
1100
- useTransact,
1101
- useUndo,
1102
- } = createBundle(client);
1103
- ```
1104
-
1105
- ### Patch Changes
1106
-
1107
- - @pluv/client@0.29.0
1108
- - @pluv/crdt@0.29.0
1109
- - @pluv/types@0.29.0
1110
-
1111
- ## 0.28.0
1112
-
1113
- ### Minor Changes
1114
-
1115
- - 778b43e: Remove the `initialStorage` option from `createRoomBundle`. This has been moved to `createClient`.
1116
-
1117
- ### Patch Changes
1118
-
1119
- - @pluv/client@0.28.0
1120
- - @pluv/crdt@0.28.0
1121
- - @pluv/types@0.28.0
1122
-
1123
- ## 0.27.0
1124
-
1125
- ### Minor Changes
1126
-
1127
- - 19ed36c: Updated `createClient` and `createRoomBundle` object params to better support automatic type inference.
1128
-
1129
- ```ts
1130
- // Before
1131
- import { createClient } from "@pluv/react";
1132
- import { yjs } from "@pluv/crdt-yjs";
1133
- import { z } from "zod";
1134
- import type { ioServer } from "./server/ioServer";
1135
-
1136
- const client = createClient<typeof ioServer>({
1137
- authEndpoint: ({ room }) => "MY_AUTH_URL",
1138
- wsEndpoint: ({ room }) => "MY_WEBSOCKET_URL",
1139
- });
1140
-
1141
- client.createRoom("my-example-room", {
1142
- presence: z.object({
1143
- selectionId: z.string().nullish(),
1144
- }),
1145
- initialPresence: {
1146
- selectionId: null,
1147
- },
1148
- initialStorage: yjs.doc(() => ({
1149
- messages: yjs.array<string>([]),
1150
- })),
1151
- });
1152
-
1153
- // After
1154
-
1155
- import { createBundle, createClient } from "@pluv/react";
1156
-
1157
- const client = createClient({
1158
- authEndpoint: ({ room }) => "MY_AUTH_URL",
1159
- wsEndpoint: ({ room }) => "MY_WEBSOCKET_URL",
1160
- /**
1161
- * @description The ioServer type now needs to be inferred on this property
1162
- * instead of within the generic on `createClient`. This is because of
1163
- * limitations with TypeScript not yet supporting partial type-inference
1164
- * for generics. Ensure to no-loonger include any generics on `createClient`
1165
- */
1166
- infer: (i) => ({ io: i<typeof ioServer> }),
1167
- // Now moved to `createClient` from `PluvClient.createRoom`
1168
- presence: z.object({
1169
- selectionId: z.string().nullish(),
1170
- }),
1171
- /**
1172
- * @description Now added to `createClient` to specify defaults for all
1173
- * rooms, and to infer types for storage. This value will be overwritten by
1174
- * `PluvClient.createRoom`.
1175
- */
1176
- initialStorage: yjs.doc(() => ({
1177
- messages: yjs.array<string>([]),
1178
- })),
1179
- });
1180
-
1181
- const { createRoomBundle } = createBundle(client);
1182
- const pluv = createRoomBundle({});
1183
- ```
1184
-
1185
- ### Patch Changes
1186
-
1187
- - 19ed36c: Added client-side event router. This more-or-less mirrors the server-side event router. You can use both the server-side and client-side router simultaneously, but you should generally prefer only using one or the other.
1188
-
1189
- ```ts
1190
- // Backend Server
1191
- import { createIO } from "@pluv/io";
1192
-
1193
- const io = createIO({ /* ... */ });
1194
- const ioServer = io.server({
1195
- router: io.router({
1196
- multiply2: io.procedure
1197
- .input(z.object({ value: z.number() }))
1198
- .broadcast(({ value }) => ({
1199
- multiplied2: { value: value * 2 },
1200
- })),
1201
- }),
1202
- });
1203
-
1204
- // Frontend Client
1205
- import { createBundle createClient } from "@pluv/react";
1206
-
1207
- const io = createClient({ /* ... */ });
1208
-
1209
- const { createRoomBundle } = createBundle(io);
1210
- const pluv = createRoomBundle({
1211
- // ...
1212
- router: io.router({
1213
- add5: io.procedure
1214
- .input(z.object({ value: z.number() }))
1215
- .broadcast(({ value }) => ({
1216
- /**
1217
- * @description Because `ioServer` does not specify `added5`,
1218
- * this will be forwarded to connected peers.
1219
- */
1220
- added5: { value: value + 5 },
1221
- })),
1222
- /**
1223
- * @description This is possible, but not recommended to do. Because
1224
- * `multiply2` is a procedure on `ioServer`, this will trigger the
1225
- * `multiply2` procedure on `ioServer`. Connected peers will not
1226
- * receive `multiply2`, but rather `multipled2`.
1227
- */
1228
- subtract5Multiply2: io.procedure
1229
- .input(z.object({ value: z.number() }))
1230
- .broadcast(({ value }) => ({
1231
- multiply2: { value: value - 5 },
1232
- })),
1233
- }),
1234
- });
1235
- ```
1236
-
1237
- - Updated dependencies [19ed36c]
1238
- - Updated dependencies [19ed36c]
1239
- - @pluv/client@0.27.0
1240
- - @pluv/crdt@0.27.0
1241
- - @pluv/types@0.27.0
1242
-
1243
- ## 0.26.0
1244
-
1245
- ### Minor Changes
1246
-
1247
- - 19e5dda: **BREAKING**
1248
- Update `authEndpoint` and `wsEndpoint` to now use a parameterized object that passes through additional data via a `metadata` property.
1249
-
1250
- ```tsx
1251
- // Before
1252
-
1253
- import { env } from "./env";
1254
- import type { ioServer } from "./server";
1255
-
1256
- const client = createClient<typeof ioServer>({
1257
- authEndpoint: (room: string) => `${env.API_URL}}/room/${room}`,
1258
- wsEndpoint: (room: string) => `${env.WS_URL}/room/${room}`,
1259
- });
1260
-
1261
- // After
1262
-
1263
- const client = createClient<
1264
- typeof ioServer,
1265
- // Optional: You can specify types for metadata here. This is useful for Cloudflare Pages
1266
- { apiUrl: string; wsUrl: string }
1267
- >({
1268
- authEndpoint: ({ metadata, room }) => `${metadata.apiUrl}}/room/${room}`,
1269
- wsEndpoint: ({ metadata, room }) => `${{ metadata.wsUrl }}/room/${room}`,
1270
- });
1271
-
1272
- client.createRoom("my-room", {
1273
- // This property exists when the `metadata` generic type is defined above
1274
- metadata: {
1275
- apiUrl: "https://example.com/api",
1276
- wsUrl: "wss://example.com/api",
1277
- },
1278
- // ...
1279
- });
1280
-
1281
- <PluvRoomProvider
1282
- // This property exists when the `metadata` generic type is defined above
1283
- metadata={{
1284
- apiUrl: "https://example.com/api",
1285
- wsUrl: "wss://example.com/api",
1286
- }}
1287
- >
1288
- {/* ... */}
1289
- </PluvRoomProvider>
1290
- ```
1291
-
1292
- ### Patch Changes
1293
-
1294
- - Updated dependencies [19e5dda]
1295
- - @pluv/client@0.26.0
1296
- - @pluv/crdt@0.26.0
1297
- - @pluv/types@0.26.0
1298
-
1299
- ## 0.25.4
1300
-
1301
- ### Patch Changes
1302
-
1303
- - @pluv/client@0.25.4
1304
- - @pluv/crdt@0.25.4
1305
- - @pluv/types@0.25.4
1306
-
1307
- ## 0.25.3
1308
-
1309
- ### Patch Changes
1310
-
1311
- - @pluv/client@0.25.3
1312
- - @pluv/crdt@0.25.3
1313
- - @pluv/types@0.25.3
1314
-
1315
- ## 0.25.2
1316
-
1317
- ### Patch Changes
1318
-
1319
- - @pluv/client@0.25.2
1320
- - @pluv/crdt@0.25.2
1321
- - @pluv/types@0.25.2
1322
-
1323
- ## 0.25.1
1324
-
1325
- ### Patch Changes
1326
-
1327
- - @pluv/client@0.25.1
1328
- - @pluv/crdt@0.25.1
1329
- - @pluv/types@0.25.1
1330
-
1331
- ## 0.25.0
1332
-
1333
- ### Patch Changes
1334
-
1335
- - @pluv/client@0.25.0
1336
- - @pluv/crdt@0.25.0
1337
- - @pluv/types@0.25.0
1338
-
1339
- ## 0.24.1
1340
-
1341
- ### Patch Changes
1342
-
1343
- - Updated dependencies [ba299e2]
1344
- - @pluv/client@0.24.1
1345
- - @pluv/crdt@0.24.1
1346
- - @pluv/types@0.24.1
1347
-
1348
- ## 0.24.0
1349
-
1350
- ### Patch Changes
1351
-
1352
- - @pluv/client@0.24.0
1353
- - @pluv/crdt@0.24.0
1354
- - @pluv/types@0.24.0
1355
-
1356
- ## 0.23.0
1357
-
1358
- ### Patch Changes
1359
-
1360
- - @pluv/client@0.23.0
1361
- - @pluv/crdt@0.23.0
1362
- - @pluv/types@0.23.0
1363
-
1364
- ## 0.22.0
1365
-
1366
- ### Patch Changes
1367
-
1368
- - @pluv/client@0.22.0
1369
- - @pluv/crdt@0.22.0
1370
- - @pluv/types@0.22.0
1371
-
1372
- ## 0.21.1
1373
-
1374
- ### Patch Changes
1375
-
1376
- - @pluv/client@0.21.1
1377
- - @pluv/crdt@0.21.1
1378
- - @pluv/types@0.21.1
1379
-
1380
- ## 0.21.0
1381
-
1382
- ### Patch Changes
1383
-
1384
- - Updated dependencies [b98ab6b]
1385
- - @pluv/client@0.21.0
1386
- - @pluv/crdt@0.21.0
1387
- - @pluv/types@0.21.0
1388
-
1389
- ## 0.20.0
1390
-
1391
- ### Minor Changes
1392
-
1393
- - 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.
1394
-
1395
- 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.
1396
-
1397
- 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.
1398
-
1399
- ```ts
1400
- // Before
1401
-
1402
- import { yjs } from "@pluv/crdt-yjs";
1403
-
1404
- yjs.array([]); // Returns CrdtYjsArray
1405
- yjs.object([]); // Returns CrdtYjsObject
1406
-
1407
- const room: PluvRoom = /* ... */;
1408
-
1409
- room.getStorage("messages"); // Returns AbstractCrdtType
1410
-
1411
- const [, sharedType] = useStorage("messages"); // sharedType is an AbstractCrdtType
1412
- ```
1413
-
1414
- ```ts
1415
- // Now
1416
-
1417
- import { yjs } from "@pluv/crdt-yjs";
1418
-
1419
- yjs.array([]); // Returns yjs.Array
1420
- yjs.object([]); // Returns yjs.Map
1421
-
1422
- const room: PluvRoom = /* ... */;
1423
-
1424
- room.getStorage("messages"); // Returns yjs.AbstractType
1425
-
1426
- const [, sharedType] = useStorage("messages"); // sharedType is a yjs.AbstractType
1427
- ```
1428
-
1429
- 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:
1430
-
1431
- ```ts
1432
- // Before
1433
-
1434
- const [data, container] = useStorage("messages");
1435
-
1436
- // This automatically called Loro.commit under the hood and rerendered the page with updated data.
1437
- container.push(loro.object({ name: "John Doe", age: 35 }));
1438
- ```
1439
-
1440
- ```ts
1441
- // Now
1442
-
1443
- const [data, container] = useStorage("messages");
1444
-
1445
- const doc = useDoc();
1446
- const transact = useTransact();
1447
-
1448
- // Updates need to be committed back to the doc whenever the changes need to be emitted to other users
1449
- // The returned data also will not update until the changes are commited
1450
-
1451
- // The two operations below are functionally equivalent
1452
- transact(() => {
1453
- container.push(loro.object({ name: "John Doe", age: 35 }));
1454
- });
1455
-
1456
- container.push(loro.object({ name: "John Doe", age: 35 }));
1457
- doc.value.commit();
1458
- ```
1459
-
1460
- ### Patch Changes
1461
-
1462
- - Updated dependencies [9492085]
1463
- - @pluv/client@0.20.0
1464
- - @pluv/crdt@0.20.0
1465
- - @pluv/types@0.20.0
1466
-
1467
- ## 0.19.0
1468
-
1469
- ### Minor Changes
1470
-
1471
- - 798e32d: **Breaking**: useOthers now allows returning any data besides arrays when using a custom selector.
1472
- - 8450306: **Breaking**: Require minimum react version of ^18.0.0.
1473
-
1474
- ### Patch Changes
1475
-
1476
- - 607afe3: Update the `updateMyPresence` function from `useMyPresence` to simply forward the function from the `PluvRoom`. This means all `updateMyPresence` functions should be the same underlying reference across all `useMyPresence` hooks.
1477
- - Updated dependencies [137444b]
1478
- - Updated dependencies [f5e4370]
1479
- - @pluv/client@0.19.0
1480
- - @pluv/crdt@0.19.0
1481
- - @pluv/types@0.19.0
1482
-
1483
- ## 0.18.0
1484
-
1485
- ### Minor Changes
1486
-
1487
- - 99b5ca9: ## Breaking Changes
1488
- - `@pluv/io` has been updated to introduce `PluvProcedure`, `PluvRouter` and `PluvServer`. This change is intended to improve the ergonomics of declaring events and simplifying inferences of event types.
1489
-
1490
- ### Before:
1491
-
1492
- ```ts
1493
- // backend/io.ts
1494
-
1495
- import { createIO } from "@pluv/io";
1496
- import { createPluvHandler, platformNode } from "@pluv/platform-node";
1497
- import { z } from "zod";
1498
-
1499
- export const io = createIO({
1500
- platform: platformNode(),
1501
- })
1502
- .event("SEND_MESSAGE", {
1503
- input: z.object({ message: z.string() }),
1504
- resolver: ({ message }) => ({ RECEIVE_MESSAGE: { message } }),
1505
- })
1506
- .event("DOUBLE_VALUE", {
1507
- input: z.object({ value: z.number() }),
1508
- resolver: ({ value }) => ({ VALUE_DOUBLED: { value: value * 2 } }),
1509
- });
1510
-
1511
- const Pluv = createPluvHandler({
1512
- io,
1513
- /* ... */
1514
- });
1515
- ```
1516
-
1517
- ```ts
1518
- // frontend/pluv.ts
1519
-
1520
- import { createClient } from "@pluv/react";
1521
- import type { io } from "../backend/io";
1522
-
1523
- const client = createClient<typeof io>({
1524
- /* ... */
1525
- });
1526
- ```
1527
-
1528
- ### Now:
1529
-
1530
- ```ts
1531
- import { createIO } from "@pluv/io";
1532
- import { createPluvHandler, platformNode } from "@pluv/platform-node";
1533
- import { z } from "zod";
1534
-
1535
- const io = createIO({
1536
- platform: platformNode(),
1537
- });
1538
-
1539
- const router = io.router({
1540
- SEND_MESSAGE: io.procedure
1541
- .input(z.object({ message: z.string() }))
1542
- .broadcast(({ message }) => ({
1543
- RECEIVE_MESSAGE: { message },
1544
- })),
1545
- DOUBLE_VALUE: io.procedure
1546
- .input(z.object({ value: z.number() }))
1547
- .broadcast(({ value }) => ({
1548
- VALUE_DOUBLED: { value: value * 2 },
1549
- })),
1550
- });
1551
-
1552
- export const ioServer = io.server({ router });
1553
-
1554
- const Pluv = createPluvHandler({
1555
- io: ioServer, // <- This uses the PluvServer now
1556
- /* ... */
1557
- });
1558
- ```
1559
-
1560
- ```ts
1561
- // frontend/pluv.ts
1562
-
1563
- import { createClient } from "@pluv/react";
1564
- import type { ioServer } from "../backend/io";
1565
-
1566
- // This users the PluvServer type now
1567
- const client = createClient<typeof ioServer>({
1568
- /* ... */
1569
- });
1570
- ```
1571
-
1572
- - `PluvRouter` instances can also be merged via the `mergeRouters` method, which effectively performs an `Object.assign` of the events object and returns a new `PluvRouter` with the correct types:
1573
-
1574
- ```ts
1575
- const router = io.mergeRouters(router1, router2);
1576
- ```
1577
-
1578
- - 07a7725: Added broadcast proxy as a new way to broadcast events to other users.
1579
-
1580
- ```tsx
1581
- // backend
1582
-
1583
- const router = io.router({
1584
- SEND_MESSAGE: io.procedure
1585
- .input(z.object({ message: z.string() }))
1586
- .broadcast(({ message }) => ({ RECEIVE_MESSAGE: { message } })),
1587
- });
1588
-
1589
- // frontend
1590
- const pluv = createRoomBundle(/* ... */);
1591
-
1592
- const broadcast = pluv.useBroadcast();
1593
-
1594
- // Both of the examples below are equivalent.
1595
-
1596
- broadcast("SEND_MESSAGE", { message: "Hello world~!" });
1597
-
1598
- broadcast.SEND_MESSAGE({ message: "Hello world~!" });
1599
- ```
1600
-
1601
- ### Patch Changes
1602
-
1603
- - e587c18: Added event proxy as a new way to listen to events.
1604
-
1605
- ```tsx
1606
- // backend
1607
-
1608
- const router = io.router({
1609
- SEND_MESSAGE: io.procedure
1610
- .input(z.object({ message: z.string() }))
1611
- .broadcast(({ message }) => ({ RECEIVE_MESSAGE: { message } })),
1612
- });
1613
-
1614
- // frontend
1615
- const pluv = createRoomBundle(/* ... */);
1616
-
1617
- // Both of the examples below are equivalent.
1618
-
1619
- pluv.useEvent("RECEIVE_MESSAGE", ({ data }) => {
1620
- const { message } = data;
1621
-
1622
- console.log(message);
1623
- });
1624
-
1625
- pluv.event.RECEIVE_MESSAGE.useEvent(({ data }) => {
1626
- const { message } = data;
1627
-
1628
- console.log(message);
1629
- });
1630
- ```
1631
-
1632
- - Updated dependencies [06c67be]
1633
- - Updated dependencies [99b5ca9]
1634
- - Updated dependencies [df1342c]
1635
- - @pluv/client@0.18.0
1636
- - @pluv/types@0.18.0
1637
- - @pluv/crdt@0.18.0
1638
-
1639
- ## 0.17.3
1640
-
1641
- ### Patch Changes
1642
-
1643
- - @pluv/client@0.17.3
1644
- - @pluv/crdt@0.17.3
1645
- - @pluv/types@0.17.3
1646
-
1647
- ## 0.17.2
1648
-
1649
- ### Patch Changes
1650
-
1651
- - @pluv/client@0.17.2
1652
- - @pluv/crdt@0.17.2
1653
- - @pluv/types@0.17.2
1654
-
1655
- ## 0.17.1
1656
-
1657
- ### Patch Changes
1658
-
1659
- - @pluv/client@0.17.1
1660
- - @pluv/crdt@0.17.1
1661
- - @pluv/types@0.17.1
1662
-
1663
- ## 0.17.0
1664
-
1665
- ### Patch Changes
1666
-
1667
- - Updated dependencies [507bc00]
1668
- - @pluv/types@0.17.0
1669
- - @pluv/client@0.17.0
1670
- - @pluv/crdt@0.17.0
1671
-
1672
- ## 0.16.3
1673
-
1674
- ### Patch Changes
1675
-
1676
- - @pluv/client@0.16.3
1677
- - @pluv/crdt@0.16.3
1678
- - @pluv/types@0.16.3
1679
-
1680
- ## 0.16.2
1681
-
1682
- ### Patch Changes
1683
-
1684
- - @pluv/client@0.16.2
1685
- - @pluv/crdt@0.16.2
1686
- - @pluv/types@0.16.2
1687
-
1688
- ## 0.16.1
1689
-
1690
- ### Patch Changes
1691
-
1692
- - @pluv/client@0.16.1
1693
- - @pluv/crdt@0.16.1
1694
- - @pluv/types@0.16.1
1695
-
1696
- ## 0.16.0
1697
-
1698
- ### Minor Changes
1699
-
1700
- - 995aa9c: Renamed all hooks from `@pluv/react` to be simply prefixed with `use` instead of `usePluv` (e.g. `usePluvStorage` is now just `useStorage`).
1701
-
1702
- Hooks can be aliased to retain the same names if preferred:
1703
-
1704
- ```ts
1705
- export const {
1706
- // ...
1707
- useStorage: usePluvStorage,
1708
- useTransact: usePluvTransact,
1709
- // ...
1710
- } = createRoomBundle(/* */);
1711
- ```
1712
-
1713
- - 4280220: ## Breaking Changes
1714
- - Storage types are now kept on the root of the document.
1715
- - Previously, `@pluv/crdt-yjs` kept all shared-types on a hidden Yjs Map called `storage` on the root of the Yjs Doc. Now all shared-types are kept on the root of the Yjs Doc instead. This behavior should be more in-line with how shared-types are documented to be used from Yjs.
1716
- - `@pluv/client` and `@pluv/react` no-longer re-export `@pluv/crdt-yjs`. This package will now need to be installed separately.
1717
-
1718
- ```bash
1719
- # if installing @pluv/client
1720
- npm install @pluv/client @pluv/crdt-yjs
1721
- # if installing @pluv/react
1722
- npm install @pluv/react @pluv/crdt-yjs
1723
- ```
1724
-
1725
- ```ts
1726
- // Before:
1727
- import { createClient, y } from "@pluv/client";
1728
- // After:
1729
- import { createClient } from "@pluv/client";
1730
- import { yjs } from "@pluv/crdt-yjs"; // y renamed to yjs
1731
- ```
1732
-
1733
- - The `y` import has been renamed to `yjs`.
1734
- ```ts
1735
- // Before:
1736
- import { y } from "@pluv/crdt-yjs";
1737
- // After:
1738
- import { yjs } from "@pluv/crdt-yjs";
1739
- ```
1740
- - `@pluv/crdt-yjs` functions no-longer return Yjs shared-types directly, but instead return an `AbstractCrdtType` from `@pluv/crdt` (new package). This also affects methods that return storage shared types in both `@pluv/client` and `@pluv/react` from functions like `PluvRoom.getStorage` and `PluvRoom.useStorage`.
1741
-
1742
- ```ts
1743
- // Before:
1744
- import { y } from "@pluv/crdt-yjs";
1745
- import type { Array as YArray, Map as YMap } from "yjs";
1746
-
1747
- const array: YArray<YMap<{ message: string }>> = y.array([y.object({ message: "Hello" })]);
1748
-
1749
- array.push([y.object({ message: "World!" })]);
1750
-
1751
- // After:
1752
- import type { CrdtYjsArray, CrdtYjsObject } from "@pluv/crdt-yjs";
1753
- import { yjs } from "@pluv/crdt-yjs";
1754
- import type { Array as YArray } from "yjs";
1755
-
1756
- const array: CrdtYjsArray<CrdtYjsObject<{ message: string }>> = yjs.array([
1757
- yjs.object({ message: "Hello" }),
1758
- ]);
1759
-
1760
- array.push(yjs.object({ message: "World!" }));
1761
-
1762
- // use .value to get the underlying yjs type
1763
- const yarray: YArray<YMap<{ message: string }>> = array.value;
1764
- ```
1765
-
1766
- - `initialStorage` must now use the `doc` function from `@pluv/crdt-yjs` to be defined. This also affects `@pluv/react`.
1767
-
1768
- ```ts
1769
- // Before:
1770
- import { createClient, y } from "@pluv/client";
1771
-
1772
- const client = createClient({
1773
- /* ... */
1774
- });
1775
-
1776
- client.createRoom({
1777
- // ...
1778
- initialStorage: () => ({
1779
- messages: y.array([y.object({ message: "Hello world!" })]),
1780
- }),
1781
- });
1782
-
1783
- // After:
1784
- import { createClient } from "@pluv/client";
1785
- // This is now imported separately
1786
- import { yjs } from "@pluv/crdt-yjs";
1787
-
1788
- const client = createClient({
1789
- /* ... */
1790
- });
1791
-
1792
- client.createRoom({
1793
- // ...
1794
- initialStorage: yjs.doc(() => ({
1795
- messages: yjs.array([yjs.object({ message: "Hello world!" })]),
1796
- })),
1797
- });
1798
- ```
1799
-
1800
- - `@pluv/client` can now instead use [loro](https://github.com/loro-dev/loro) instead of [yjs](https://github.com/yjs/yjs).
1801
- ```bash
1802
- npm install @pluv/client @pluv/crdt-loro loro-crdt
1803
- ```
1804
- - If you are using storage features with pluv, `@pluv/io` must now specify which crdt library (i.e. `@pluv/crdt-yjs` or `@pluv/crdt-loro`) it is meant to use.
1805
-
1806
- ```ts
1807
- import { loro } from "@pluv/crdt-loro";
1808
- import { yjs } from "@pluv/crdt-yjs";
1809
- import { createIO } from "@pluv/io";
1810
-
1811
- const io = createIO({
1812
- // ...
1813
- // If using loro
1814
- crdt: loro,
1815
- // If using yjs
1816
- crdt: yjs,
1817
- });
1818
- ```
1819
-
1820
- - `PluvRoom.getDoc()` from `@pluv/client` no-longer returns the Yjs Doc instance, but rather a `AbstractCrdtDoc` instance from `@pluv/crdt`. This also affects the hook from `@pluv/react`.
1821
-
1822
- ```ts
1823
- // Before:
1824
- import { Doc as YDoc } from "yjs";
1825
-
1826
- const room: PluvRoom = client.createRoom({
1827
- /* ... */
1828
- });
1829
-
1830
- const doc: YDoc = room.getDoc();
1831
-
1832
- // After:
1833
- import { CrdtYjsDoc } from "@pluv/crdt-yjs";
1834
- import { Doc as YDoc } from "yjs";
1835
-
1836
- const room: PluvRoom = client.createRoom({
1837
- /* ... */
1838
- });
1839
-
1840
- const doc: CrdtYjsDoc<any> = room.getDoc();
1841
- const ydoc: YDoc = doc.value;
1842
- ```
1843
-
1844
- - `@pluv/client` and `@pluv/react` now may return `null` when retrieving storage while storage is being initialized.
1845
-
1846
- ```ts
1847
- const sharedType = room.getStorage("messages"); // This may be null
1848
-
1849
- const [data, sharedType] = useStorage("messages"); // data and sharedType may both be null
1850
- ```
1851
-
1852
- ### Patch Changes
1853
-
1854
- - Updated dependencies [4280220]
1855
- - @pluv/client@0.16.0
1856
- - @pluv/crdt@0.16.0
1857
- - @pluv/types@0.16.0
1858
-
1859
- ## 0.15.0
1860
-
1861
- ### Patch Changes
1862
-
1863
- - @pluv/client@0.15.0
1864
- - @pluv/types@0.15.0
1865
-
1866
- ## 0.14.1
1867
-
1868
- ### Patch Changes
1869
-
1870
- - @pluv/client@0.14.1
1871
- - @pluv/types@0.14.1
1872
-
1873
- ## 0.14.0
1874
-
1875
- ### Patch Changes
1876
-
1877
- - @pluv/client@0.14.0
1878
- - @pluv/types@0.14.0
1879
-
1880
- ## 0.13.0
1881
-
1882
- ### Minor Changes
1883
-
1884
- - 4c4b47f: Added `useDoc` to access the root Yjs doc.
1885
-
1886
- ```ts
1887
- import type { Doc } from "yjs";
1888
-
1889
- const doc: Doc = useDoc();
1890
- ```
1891
-
1892
- ### Patch Changes
1893
-
1894
- - Updated dependencies [1126215]
1895
- - @pluv/client@0.13.0
1896
- - @pluv/types@0.13.0
1897
-
1898
- ## 0.12.3
1899
-
1900
- ### Patch Changes
1901
-
1902
- - da9f600: Upgraded dependencies
1903
- - Updated dependencies [da9f600]
1904
- - @pluv/client@0.12.3
1905
- - @pluv/types@0.12.3
1906
-
1907
- ## 0.12.2
1908
-
1909
- ### Patch Changes
1910
-
1911
- - 259a7da: Bumped dependencies
1912
-
1913
- ## 0.12.1
1914
-
1915
- ### Patch Changes
1916
-
1917
- - cae08aa: Updated storage from `getStorage` to never return null
1918
- - Updated dependencies [cae08aa]
1919
- - @pluv/client@0.12.1
1920
- - @pluv/types@0.12.1
1921
-
1922
- ## 0.12.0
1923
-
1924
- ### Minor Changes
1925
-
1926
- - 436040b: Added ability to undo and redo changes to storage.
1927
-
1928
- ## @pluv/crdt-yjs
1929
-
1930
- `@pluv/crdt-yjs` now exposes 5 new methods: `canRedo`, `canUndo`, `redo`, `undo` and `trackOrigins`.
1931
-
1932
- Refer to the code-example below to better understand how to undo and redo with your doc.
1933
-
1934
- ```ts
1935
- // Example
1936
- import { array, doc } from "@pluv/crdt-yjs";
1937
-
1938
- // Create your doc with your shared-types
1939
- const myDoc = doc({
1940
- messages: array<string>([]),
1941
- });
1942
-
1943
- /**
1944
- * @description Track origins to enable undos and redos for your document.
1945
- * trackOrigins must be called before any storage mutations, to enable those
1946
- * mutations to be undone/redone.
1947
- */
1948
- myDoc.trackOrigins({
1949
- /**
1950
- * @description This is the same `captureTimeout` option from yjs's UndoManager.
1951
- * This specifies a number in ms, during which edits are merged together to be
1952
- * undone together. Set this to 0, to track each transacted change individually.
1953
- * @see (@link https://docs.yjs.dev/api/undo-manager)
1954
- * @default 500
1955
- */
1956
- captureTimeout: 500,
1957
- /**
1958
- * @desription This is the same `trackedOrigins` option from yjs's UndoManager.
1959
- * This specifies transaction origins (strings only) to filter which transactions
1960
- * can be undone.
1961
- * @see (@link https://docs.yjs.dev/api/undo-manager)
1962
- * @default undefined
1963
- */
1964
- trackedOrigins: ["user-123"],
1965
- });
1966
-
1967
- /**
1968
- * @description Check whether calling undo will mutate storage
1969
- * @returns boolean
1970
- */
1971
- myDoc.canUndo();
1972
- /**
1973
- * @description Check whether calling redo will mutate storage
1974
- * @returns boolean
1975
- */
1976
- myDoc.canRedo();
1977
-
1978
- // Perform a storage mutation within a transaction so that it can be affected
1979
- // by undo/redo operations.
1980
- myDoc.transact(() => {
1981
- myDoc.get("messages").push(["hello world!"]);
1982
- }, "user-123");
1983
-
1984
- /**
1985
- * @description Undoes the last valid mutation to storage
1986
- */
1987
- myDoc.undo();
1988
-
1989
- /**
1990
- * @description Re-applies the last undone mutation to storage
1991
- */
1992
- myDoc.redo();
1993
- ```
1994
-
1995
- ## @pluv/client
1996
-
1997
- `@pluv/client`'s `PluvRoom` and `MockedRoom` now exposes 5 new methods: `canRedo`, `canUndo`, `redo`, `undo` and `transact`.
1998
-
1999
- Refer to the code-example below to better understand how to undo and redo with your `PluvRoom`.
2000
-
2001
- ```ts
2002
- import { createClient, y } from "@pluv/client";
2003
-
2004
- const client = createClient({});
2005
-
2006
- /**
2007
- * @description When a room is created, undo/redo will automatically
2008
- * be configured to filter for changes made by the connected user
2009
- * (so that users only undo/redo their changes).
2010
- */
2011
- const room = client.createRoom("my-room", {
2012
- initialStorage: () => ({
2013
- messages: y.array<string>([]),
2014
- }),
2015
- /**
2016
- * @description This is the same `captureTimeout` option from yjs's UndoManager.
2017
- * This specifies a number in ms, during which edits are merged together to be
2018
- * undone together. Set this to 0, to track each transacted change individually.
2019
- * @see (@link https://docs.yjs.dev/api/undo-manager)
2020
- * @default 500
2021
- */
2022
- captureTimeout: 500,
2023
- /**
2024
- * @desription This is the same `trackedOrigins` option from yjs's UndoManager.
2025
- * This specifies transaction origins (strings only) to filter which transactions
2026
- * can be undone.
2027
- * When omitted, the user's connection id will be tracked. When provided,
2028
- * specifies additional tracked origins besides the user's connection id.
2029
- * @see (@link https://docs.yjs.dev/api/undo-manager)
2030
- * @default undefined
2031
- */
2032
- trackedOrigins: ["user-123"],
2033
- });
2034
-
2035
- /**
2036
- * @description Check whether calling undo will mutate storage
2037
- * @returns boolean
2038
- */
2039
- room.canUndo();
2040
- /**
2041
- * @description Check whether calling redo will mutate storage
2042
- * @returns boolean
2043
- */
2044
- room.canRedo();
2045
-
2046
- /**
2047
- * @description Calling transact will enable a storage mutation to be undone/redone.
2048
- * When called without an origin, the origin will default to the user's connection
2049
- * id.
2050
- *
2051
- * You can specify a 2nd parameter to transact with a different transaction origin.
2052
- */
2053
- room.transact(() => {
2054
- room.get("messages").push(["hello world!"]);
2055
- });
2056
-
2057
- // This will also be undoable because `"user-123"` is a tracked origin.
2058
- room.transact(() => {
2059
- room.get("messages").push(["hello world!"]);
2060
- }, "user-123");
2061
-
2062
- /**
2063
- * @description Undoes the last valid mutation to storage
2064
- */
2065
- room.undo();
2066
-
2067
- /**
2068
- * @description Re-applies the last undone mutation to storage
2069
- */
2070
- room.redo();
2071
- ```
2072
-
2073
- ## @pluv/react
2074
-
2075
- `@pluv/react`'s `createRoomBundle` now exposes 5 new react hooks: `useCanRedo`, `useCanUndo`, `useRedo`, `useUndo` and `useTransact`.
2076
-
2077
- Refer to the code-example below to better understand how to undo and redo with your `createRoomBundle`.
2078
-
2079
- ```tsx
2080
- import { createBundle, createClient, y } from "@pluv/react";
2081
- import { type io } from "./io";
2082
-
2083
- const client = createClient<typeof io>();
2084
-
2085
- const { createRoomBundle } = createBundle(client);
2086
-
2087
- const { useCanRedo, useCanUndo, useRedo, useStorage, useTransact, useUndo } = createRoomBundle({
2088
- initialStorage: () => ({
2089
- messages: y.array<string>([]),
2090
- }),
2091
- /**
2092
- * @description This is the same `captureTimeout` option from yjs's UndoManager.
2093
- * This specifies a number in ms, during which edits are merged together to be
2094
- * undone together. Set this to 0, to track each transacted change individually.
2095
- * @see (@link https://docs.yjs.dev/api/undo-manager)
2096
- * @default 500
2097
- */
2098
- captureTimeout: 500,
2099
- /**
2100
- * @desription This is the same `trackedOrigins` option from yjs's UndoManager.
2101
- * This specifies transaction origins (strings only) to filter which transactions
2102
- * can be undone.
2103
- * When omitted, the user's connection id will be tracked. When provided,
2104
- * specifies additional tracked origins besides the user's connection id.
2105
- * @see (@link https://docs.yjs.dev/api/undo-manager)
2106
- * @default undefined
2107
- */
2108
- trackedOrigins: ["user-123"],
2109
- });
2110
-
2111
- /**
2112
- * @description Check whether calling undo will mutate storage
2113
- */
2114
- const canUndo: boolean = useCanUndo();
2115
- /**
2116
- * @description Check whether calling redo will mutate storage
2117
- */
2118
- const canRedo: boolean = useCanRedo();
2119
-
2120
- const [messages, sharedType] = useStorage("messages");
2121
-
2122
- /**
2123
- * @description Calling transact will enable a storage mutation to be undone/redone.
2124
- * When called without an origin, the origin will default to the user's connection
2125
- * id.
2126
- *
2127
- * You can specify a 2nd parameter to transact with a different transaction origin.
2128
- */
2129
- const transact = useTransact();
2130
-
2131
- transact(() => {
2132
- sharedType.push(["hello world!"]);
2133
- });
2134
-
2135
- // This will also be undoable because `"user-123"` is a tracked origin.
2136
- transact(() => {
2137
- sharedType.push(["hello world!"]);
2138
- }, "user-123");
2139
-
2140
- /**
2141
- * @description Undoes the last valid mutation to storage
2142
- */
2143
- const undo = useUndo();
2144
-
2145
- undo();
2146
-
2147
- /**
2148
- * @description Re-applies the last undone mutation to storage
2149
- */
2150
- const redo = useRedo();
2151
-
2152
- redo();
2153
- ```
2154
-
2155
- ### Patch Changes
2156
-
2157
- - Updated dependencies [436040b]
2158
- - @pluv/client@0.12.0
2159
- - @pluv/types@0.12.0
2160
-
2161
- ## 0.11.1
2162
-
2163
- ### Patch Changes
2164
-
2165
- - 74b3061: Bumped minor and patch dependencies.
2166
- - Updated dependencies [74b3061]
2167
- - @pluv/client@0.11.1
2168
- - @pluv/types@0.11.1
2169
-
2170
- ## 0.11.0
2171
-
2172
- ### Patch Changes
2173
-
2174
- - @pluv/client@0.11.0
2175
- - @pluv/types@0.11.0
2176
-
2177
- ## 0.10.3
2178
-
2179
- ### Patch Changes
2180
-
2181
- - @pluv/client@0.10.3
2182
- - @pluv/types@0.10.3
2183
-
2184
- ## 0.10.2
2185
-
2186
- ### Patch Changes
2187
-
2188
- - @pluv/client@0.10.2
2189
- - @pluv/types@0.10.2
2190
-
2191
- ## 0.10.1
2192
-
2193
- ### Patch Changes
2194
-
2195
- - 885835d: remove unnecessary dependency
2196
- - Updated dependencies [885835d]
2197
- - @pluv/client@0.10.1
2198
- - @pluv/types@0.10.1
2199
-
2200
- ## 0.10.0
2201
-
2202
- ### Minor Changes
2203
-
2204
- - f43f1cc: Change packages to all be versioned together for consistency.
2205
-
2206
- ### Patch Changes
2207
-
2208
- - Updated dependencies [f43f1cc]
2209
- - @pluv/client@0.10.0
2210
- - @pluv/types@0.10.0
2211
-
2212
- ## 0.6.2
2213
-
2214
- ### Patch Changes
2215
-
2216
- - f4317ba: \* Renamed type `unstable_YObjectValue` to `YObjectValue`;
2217
- - Renamed type `unstable_YObject` to `YObject`.
2218
- - Re-exported `xmlElement`, `xmlFragment` and `xmlText` from `@pluv/client`.
2219
-
2220
- ```ts
2221
- import { y } from "@pluv/client";
2222
- // or
2223
- import { y } from "@pluv/react";
2224
-
2225
- y.xmlElement("MyElement", {});
2226
- y.xmlFragment({});
2227
- y.xmlText("hello world");
2228
- ```
2229
-
2230
- - Updated dependencies [f4317ba]
2231
- - @pluv/client@0.9.2
2232
-
2233
- ## 0.6.1
2234
-
2235
- ### Patch Changes
2236
-
2237
- - 8fba48b: fix including incorrect dependency
2238
- - 8997c65: bumped dependencies
2239
- - Updated dependencies [8fba48b]
2240
- - Updated dependencies [8997c65]
2241
- - @pluv/client@0.9.1
2242
- - @pluv/types@0.2.2
2243
-
2244
- ## 0.6.0
2245
-
2246
- ### Minor Changes
2247
-
2248
- - 829d31b: Added support for defining persistant frontend storage for rooms via a new `addons` option on rooms.
2249
-
2250
- This also introduces the first new addon `@pluv/addon-indexeddb`, which is more-or-less the equivalent to `y-indexeddb` which you can install like so:
2251
-
2252
- ```
2253
- npm install @pluv/addon-indexeddb
2254
- ```
2255
-
2256
- To use this new addon, simply pass it to options when creating a room:
2257
-
2258
- ```ts
2259
- import { addonIndexedDB } from "@pluv/addon-indexeddb";
2260
- import { createClient } from "@pluv/client";
2261
-
2262
- const client = createClient({
2263
- // ...
2264
- });
2265
-
2266
- const room = client.createRoom("my-new-room", {
2267
- addons: [
2268
- // Define your addons in an array like so
2269
- addonIndexedDB(),
2270
- ],
2271
- });
2272
- ```
2273
-
2274
- Or when using `@pluv/react`:
2275
-
2276
- ```ts
2277
- const PluvRoom = createRoomBundle({
2278
- // ...
2279
- addons: [
2280
- // Define your addons in an array like so
2281
- addonIndexedDB(),
2282
- ],
2283
- });
2284
- ```
2285
-
2286
- ### Patch Changes
2287
-
2288
- - 8d11672: bumped dependencies to latest
2289
- - Updated dependencies [8d11672]
2290
- - Updated dependencies [829d31b]
2291
- - @pluv/client@0.9.0
2292
- - @pluv/types@0.2.1
2293
-
2294
- ## 0.5.11
2295
-
2296
- ### Patch Changes
2297
-
2298
- - 2c9c5c3: changed my-presence to be non-nullable
2299
- - Updated dependencies [2c9c5c3]
2300
- - @pluv/client@0.8.1
2301
-
2302
- ## 0.5.10
2303
-
2304
- ### Patch Changes
2305
-
2306
- - 5bbfb98: fix not properly handling unauthorized checks
2307
- - b85a232: bumped dependencies
2308
- - Updated dependencies [5bbfb98]
2309
- - Updated dependencies [b85a232]
2310
- - Updated dependencies [fde89cf]
2311
- - @pluv/client@0.8.0
2312
- - @pluv/types@0.2.0
2313
-
2314
- ## 0.5.9
2315
-
2316
- ### Patch Changes
2317
-
2318
- - 3518a83: bumped dependencies
2319
- - Updated dependencies [0dd847e]
2320
- - Updated dependencies [bb2886b]
2321
- - Updated dependencies [ae679a8]
2322
- - Updated dependencies [bb2886b]
2323
- - Updated dependencies [3518a83]
2324
- - @pluv/client@0.7.0
2325
- - @pluv/types@0.2.0
2326
-
2327
- ## 0.5.8
2328
-
2329
- ### Patch Changes
2330
-
2331
- - 7ad4967: fixed user's presence not updating locally while offline
2332
- - Updated dependencies [7ad4967]
2333
- - Updated dependencies [4535687]
2334
- - @pluv/client@0.6.5
2335
- - @pluv/types@0.1.6
2336
-
2337
- ## 0.5.7
2338
-
2339
- ### Patch Changes
2340
-
2341
- - 78fd644: updated readmes with links to the documentation website
2342
- - Updated dependencies [78fd644]
2343
- - @pluv/client@0.6.4
2344
-
2345
- ## 0.5.6
2346
-
2347
- ### Patch Changes
2348
-
2349
- - 850626e: bumped dependencies
2350
- - Updated dependencies [850626e]
2351
- - @pluv/client@0.6.3
2352
- - @pluv/types@0.1.6
2353
-
2354
- ## 0.5.5
2355
-
2356
- ### Patch Changes
2357
-
2358
- - 9ae251d: bumped dependencies
2359
- - Updated dependencies [9ae251d]
2360
- - @pluv/client@0.6.2
2361
-
2362
- ## 0.5.4
2363
-
2364
- ### Patch Changes
2365
-
2366
- - 19433af: updated MockedRoomProvider events to allow partial events
2367
- - b80c555: updated react hooks to not re-render if state is deeply equal by default
2368
- - 74870ee: bumped dependencies
2369
- - Updated dependencies [19433af]
2370
- - Updated dependencies [74870ee]
2371
- - @pluv/client@0.6.1
2372
- - @pluv/types@0.1.5
2373
-
2374
- ## 0.5.3
2375
-
2376
- ### Patch Changes
2377
-
2378
- - 57ae13f: bumped dependencies
2379
- - @pluv/client@0.6.0
2380
- - @pluv/types@0.1.4
2381
-
2382
- ## 0.5.2
2383
-
2384
- ### Patch Changes
2385
-
2386
- - 9516a4e: updated typescript to 5.0
2387
- - 7b6da1c: bumped dependencies
2388
- - e9c1514: bumped dependencies
2389
- - 9d1829c: chore: bumped dependencies
2390
- - Updated dependencies [e1308e3]
2391
- - Updated dependencies [9516a4e]
2392
- - Updated dependencies [e1308e3]
2393
- - Updated dependencies [7b6da1c]
2394
- - Updated dependencies [e9c1514]
2395
- - Updated dependencies [9d1829c]
2396
- - @pluv/client@0.6.0
2397
- - @pluv/types@0.1.4
2398
-
2399
- ## 0.5.1
2400
-
2401
- ### Patch Changes
2402
-
2403
- - 161e00e: fixed links to other pluv packages in readmes
2404
- - f6c0e65: bumped dependencies
2405
- - Updated dependencies [161e00e]
2406
- - Updated dependencies [f6c0e65]
2407
- - @pluv/client@0.5.1
2408
- - @pluv/types@0.1.3
2409
-
2410
- ## 0.5.0
2411
-
2412
- ### Minor Changes
2413
-
2414
- - 327a6ef: renamed y.unstable\_\_object to y.object
2415
-
2416
- ### Patch Changes
2417
-
2418
- - 78a6119: Fixed MockedRoom not sending storage updates
2419
- - 8bf62cb: bumped dependencies
2420
- - 7e52685: Bumped dependencies
2421
- - b1cb325: Updated dependencies
2422
- - b4e34bc: chore(deps): update dependency @types/react to v18.0.28
2423
- - ec50c73: fix: fixed mocked room not working
2424
- - 8e97fb2: Updated dependencies
2425
- - Updated dependencies [78a6119]
2426
- - Updated dependencies [8bf62cb]
2427
- - Updated dependencies [7e52685]
2428
- - Updated dependencies [b1cb325]
2429
- - Updated dependencies [327a6ef]
2430
- - Updated dependencies [8e97fb2]
2431
- - @pluv/client@0.5.0
2432
- - @pluv/types@0.1.3
2433
-
2434
- ## 0.4.0
2435
-
2436
- ### Minor Changes
2437
-
2438
- - 043c915: Added MockedDataProvider from createRoomBundle
2439
-
2440
- ### Patch Changes
2441
-
2442
- - 93f8c54: chore(deps): update dependency @types/react to v18.0.27
2443
- - Updated dependencies [595e66f]
2444
- - @pluv/client@0.4.0
2445
-
2446
- ## 0.3.0
2447
-
2448
- ### Minor Changes
2449
-
2450
- - 043c915: Added MockedDataProvider from createRoomBundle
2451
-
2452
- ### Patch Changes
2453
-
2454
- - 93f8c54: chore(deps): update dependency @types/react to v18.0.27
2455
- - Updated dependencies [595e66f]
2456
- - @pluv/client@0.3.0
2457
-
2458
- ## 0.2.0
2459
-
2460
- ### Minor Changes
2461
-
2462
- - 95b5ef8: breaking: update PluvRoom.broadcast api
2463
-
2464
- ### Patch Changes
2465
-
2466
- - Updated dependencies [95b5ef8]
2467
- - @pluv/client@0.2.0
2468
- - @pluv/types@0.1.2
2469
-
2470
- ## 0.1.3
2471
-
2472
- ### Patch Changes
2473
-
2474
- - fe80d7b: added preview disclaimer about breaking changes in the readme
2475
- - Updated dependencies [fe80d7b]
2476
- - @pluv/client@0.1.3
2477
- - @pluv/types@0.1.2
2478
-
2479
- ## 0.1.2
2480
-
2481
- ### Patch Changes
2482
-
2483
- - @pluv/client@0.1.2
2484
-
2485
- ## 0.1.1
2486
-
2487
- ### Patch Changes
2488
-
2489
- - 24016e6: Updated dependencies
2490
- - Updated dependencies [23a7382]
2491
- - Updated dependencies [24016e6]
2492
- - @pluv/client@0.1.1
2493
- - @pluv/types@0.1.1
2494
-
2495
- ## 0.1.0
2496
-
2497
- ### Minor Changes
2498
-
2499
- - a22f525: Added documentation
2500
-
2501
- ### Patch Changes
2502
-
2503
- - Updated dependencies [a22f525]
2504
- - @pluv/client@0.1.0
2505
- - @pluv/types@0.1.0