@pluv/client 0.0.0-experimental-20250527040415

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