@pluv/platform-cloudflare 5.0.1 → 5.0.3

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,2044 +0,0 @@
1
- # @pluv/platform-cloudflare
2
-
3
- ## 5.0.1
4
-
5
- ### Patch Changes
6
-
7
- - @pluv/crdt@5.0.1
8
- - @pluv/io@5.0.1
9
- - @pluv/persistence-cloudflare-transactional-storage@5.0.1
10
- - @pluv/types@5.0.1
11
-
12
- ## 5.0.0
13
-
14
- ### Patch Changes
15
-
16
- - @pluv/crdt@5.0.0
17
- - @pluv/io@5.0.0
18
- - @pluv/persistence-cloudflare-transactional-storage@5.0.0
19
- - @pluv/types@5.0.0
20
-
21
- ## 4.1.0
22
-
23
- ### Patch Changes
24
-
25
- - @pluv/crdt@4.1.0
26
- - @pluv/io@4.1.0
27
- - @pluv/persistence-cloudflare-transactional-storage@4.1.0
28
- - @pluv/types@4.1.0
29
-
30
- ## 4.0.2
31
-
32
- ### Patch Changes
33
-
34
- - e1913b3: Upgraded internal dependencies
35
- - Updated dependencies [e1913b3]
36
- - @pluv/persistence-cloudflare-transactional-storage@4.0.2
37
- - @pluv/types@4.0.2
38
- - @pluv/crdt@4.0.2
39
- - @pluv/io@4.0.2
40
-
41
- ## 4.0.1
42
-
43
- ### Patch Changes
44
-
45
- - @pluv/crdt@4.0.1
46
- - @pluv/io@4.0.1
47
- - @pluv/persistence-cloudflare-transactional-storage@4.0.1
48
- - @pluv/types@4.0.1
49
-
50
- ## 4.0.0
51
-
52
- ### Major Changes
53
-
54
- - df5c39c: Update all packages to be ESM only.
55
- - 07e2a1e: ### Breaking Changes
56
-
57
- This release includes the following breaking changes:
58
- 1. **Removed `onDestroy` handler** (room-level only) - replaced with `onRoomDestroyed` and `onStorageDestroyed`
59
- 2. **Removed `onRoomDeleted` handler** (server-level) - replaced with `onRoomDestroyed` and `onStorageDestroyed`
60
- 3. **Listeners can no longer be configured at room-level** - all listeners must be configured at server-level via `io.server()`
61
- 4. **Event type changes** - `IORoomDestroyedEvent` no longer includes `encodedState`
62
-
63
- #### Remove `onDestroy` and `onRoomDeleted` in favor of `onRoomDestroyed` and `onStorageDestroyed`
64
-
65
- **BREAKING**: Two event handlers have been **removed** in favor of two separate handlers that provide better control over when storage is saved. This is a breaking change that requires code updates.
66
-
67
- **New Handlers:**
68
- - **`onRoomDestroyed`**: Fires whenever a room is destroyed. This event does NOT include `encodedState` to prevent accidentally saving empty or uninitialized storage data. **Available only at server-level** via `io.server()`.
69
- - **`onStorageDestroyed`**: Only fires when the storage document is about to be destroyed after it has been initialized via `initializeSession`. This event includes `encodedState` and should be used for saving storage to your database. **Available only at server-level** via `io.server()`.
70
-
71
- **Removed Handlers:**
72
- - **`onDestroy`** (room-level only, via `createRoom`): **REMOVED**. Use `onRoomDestroyed` and `onStorageDestroyed` instead.
73
- - **`onRoomDeleted`** (server-level): **REMOVED**. Use `onRoomDestroyed` and `onStorageDestroyed` instead.
74
-
75
- **Migration Guide:**
76
-
77
- **Old (no longer works):**
78
-
79
- ```typescript
80
- // Room-level onDestroy (removed)
81
- const room = io.createRoom("room-id", {
82
- onDestroy: async ({ encodedState, room }) => {
83
- // This no longer works
84
- await saveToDatabase(room, encodedState);
85
- },
86
- });
87
-
88
- // Server-level onRoomDeleted (removed)
89
- io.server({
90
- onRoomDeleted: async ({ encodedState, room }) => {
91
- // This no longer works
92
- await saveToDatabase(room, encodedState);
93
- },
94
- });
95
- ```
96
-
97
- **New (recommended approach):**
98
-
99
- ```typescript
100
- // Server-level handlers (recommended - all listeners are now server-level)
101
- io.server({
102
- onRoomDestroyed: async ({ room }) => {
103
- // Room destroyed - use for cleanup if needed
104
- await cleanupRoom(room);
105
- },
106
- onStorageDestroyed: async ({ encodedState, room }) => {
107
- // Only fires when storage was initialized via initializeSession
108
- // Safe to save to database
109
- await saveToDatabase(room, encodedState);
110
- },
111
- });
112
-
113
- // Rooms are created without listener options
114
- const room = io.createRoom("room-id");
115
- ```
116
-
117
- #### Type Changes
118
-
119
- **BREAKING**: The following type changes may require TypeScript code updates:
120
- - **`IORoomDestroyedEvent`** no longer includes `encodedState` (breaking change if you were accessing `encodedState` from this event)
121
- - **`IORoomListenerEvent`** includes `encodedState: string | null` (used by `onStorageDestroyed`)
122
- - **All listeners must be configured at the server level** via `io.server()`, not at the room level via `createRoom()` (breaking change - room-level listener configuration is no longer supported)
123
- - **`CreateRoomOptions`** now correctly requires platform-specific room context properties (e.g., `env` and `state` for Cloudflare) when they are required by the platform, while properly handling optional properties like `meta` (breaking change - TypeScript will now correctly enforce required properties)
124
-
125
- ### Minor Changes
126
-
127
- - 037074e: Migrated build process from tsup to tsdown.
128
-
129
- ### Patch Changes
130
-
131
- - 2eb5def: Bumped dependencies.
132
- - Updated dependencies [2eb5def]
133
- - Updated dependencies [df5c39c]
134
- - Updated dependencies [c142910]
135
- - Updated dependencies [037074e]
136
- - Updated dependencies [07e2a1e]
137
- - @pluv/persistence-cloudflare-transactional-storage@4.0.0
138
- - @pluv/types@4.0.0
139
- - @pluv/crdt@4.0.0
140
- - @pluv/io@4.0.0
141
-
142
- ## 3.2.2
143
-
144
- ### Patch Changes
145
-
146
- - Updated dependencies [8665dbe]
147
- - @pluv/types@3.2.2
148
- - @pluv/crdt@3.2.2
149
- - @pluv/io@3.2.2
150
- - @pluv/persistence-cloudflare-transactional-storage@3.2.2
151
-
152
- ## 3.2.1
153
-
154
- ### Patch Changes
155
-
156
- - @pluv/crdt@3.2.1
157
- - @pluv/io@3.2.1
158
- - @pluv/persistence-cloudflare-transactional-storage@3.2.1
159
- - @pluv/types@3.2.1
160
-
161
- ## 3.2.0
162
-
163
- ### Patch Changes
164
-
165
- - Updated dependencies [6d2b257]
166
- - @pluv/io@3.2.0
167
- - @pluv/persistence-cloudflare-transactional-storage@3.2.0
168
- - @pluv/crdt@3.2.0
169
- - @pluv/types@3.2.0
170
-
171
- ## 3.1.7
172
-
173
- ### Patch Changes
174
-
175
- - Updated dependencies [f1d56d9]
176
- - @pluv/io@3.1.7
177
- - @pluv/persistence-cloudflare-transactional-storage@3.1.7
178
- - @pluv/crdt@3.1.7
179
- - @pluv/types@3.1.7
180
-
181
- ## 3.1.6
182
-
183
- ### Patch Changes
184
-
185
- - @pluv/crdt@3.1.6
186
- - @pluv/io@3.1.6
187
- - @pluv/persistence-cloudflare-transactional-storage@3.1.6
188
- - @pluv/types@3.1.6
189
-
190
- ## 3.1.5
191
-
192
- ### Patch Changes
193
-
194
- - @pluv/crdt@3.1.5
195
- - @pluv/io@3.1.5
196
- - @pluv/persistence-cloudflare-transactional-storage@3.1.5
197
- - @pluv/types@3.1.5
198
-
199
- ## 3.1.4
200
-
201
- ### Patch Changes
202
-
203
- - @pluv/crdt@3.1.4
204
- - @pluv/io@3.1.4
205
- - @pluv/persistence-cloudflare-transactional-storage@3.1.4
206
- - @pluv/types@3.1.4
207
-
208
- ## 3.1.3
209
-
210
- ### Patch Changes
211
-
212
- - Updated dependencies [651a9f8]
213
- - @pluv/io@3.1.3
214
- - @pluv/persistence-cloudflare-transactional-storage@3.1.3
215
- - @pluv/crdt@3.1.3
216
- - @pluv/types@3.1.3
217
-
218
- ## 3.1.2
219
-
220
- ### Patch Changes
221
-
222
- - Updated dependencies [8f138aa]
223
- - @pluv/io@3.1.2
224
- - @pluv/persistence-cloudflare-transactional-storage@3.1.2
225
- - @pluv/crdt@3.1.2
226
- - @pluv/types@3.1.2
227
-
228
- ## 3.1.1
229
-
230
- ### Patch Changes
231
-
232
- - Updated dependencies [7b719bf]
233
- - @pluv/io@3.1.1
234
- - @pluv/persistence-cloudflare-transactional-storage@3.1.1
235
- - @pluv/crdt@3.1.1
236
- - @pluv/types@3.1.1
237
-
238
- ## 3.1.0
239
-
240
- ### Patch Changes
241
-
242
- - Updated dependencies [a40f4dc]
243
- - @pluv/io@3.1.0
244
- - @pluv/persistence-cloudflare-transactional-storage@3.1.0
245
- - @pluv/crdt@3.1.0
246
- - @pluv/types@3.1.0
247
-
248
- ## 3.0.0
249
-
250
- ### Major Changes
251
-
252
- - bc1ae91: **BREAKING** Removed deprecated `createPluvHandler`.
253
-
254
- ### Patch Changes
255
-
256
- - @pluv/io@3.0.0
257
- - @pluv/persistence-cloudflare-transactional-storage@3.0.0
258
- - @pluv/types@3.0.0
259
-
260
- ## 2.3.1
261
-
262
- ### Patch Changes
263
-
264
- - @pluv/io@2.3.1
265
- - @pluv/persistence-cloudflare-transactional-storage@2.3.1
266
- - @pluv/types@2.3.1
267
-
268
- ## 2.3.0
269
-
270
- ### Patch Changes
271
-
272
- - @pluv/io@2.3.0
273
- - @pluv/persistence-cloudflare-transactional-storage@2.3.0
274
- - @pluv/types@2.3.0
275
-
276
- ## 2.2.8
277
-
278
- ### Patch Changes
279
-
280
- - Updated dependencies [b60ccd8]
281
- - @pluv/io@2.2.8
282
- - @pluv/persistence-cloudflare-transactional-storage@2.2.8
283
- - @pluv/types@2.2.8
284
-
285
- ## 2.2.7
286
-
287
- ### Patch Changes
288
-
289
- - Updated dependencies [ec2717b]
290
- - @pluv/io@2.2.7
291
- - @pluv/persistence-cloudflare-transactional-storage@2.2.7
292
- - @pluv/types@2.2.7
293
-
294
- ## 2.2.6
295
-
296
- ### Patch Changes
297
-
298
- - @pluv/io@2.2.6
299
- - @pluv/persistence-cloudflare-transactional-storage@2.2.6
300
- - @pluv/types@2.2.6
301
-
302
- ## 2.2.5
303
-
304
- ### Patch Changes
305
-
306
- - 02b401c: Fixed storage state not being written into transactional storage.
307
- - @pluv/io@2.2.5
308
- - @pluv/persistence-cloudflare-transactional-storage@2.2.5
309
- - @pluv/types@2.2.5
310
-
311
- ## 2.2.4
312
-
313
- ### Patch Changes
314
-
315
- - @pluv/io@2.2.4
316
- - @pluv/persistence-cloudflare-transactional-storage@2.2.4
317
- - @pluv/types@2.2.4
318
-
319
- ## 2.2.3
320
-
321
- ### Patch Changes
322
-
323
- - @pluv/io@2.2.3
324
- - @pluv/persistence-cloudflare-transactional-storage@2.2.3
325
- - @pluv/types@2.2.3
326
-
327
- ## 2.2.2
328
-
329
- ### Patch Changes
330
-
331
- - @pluv/io@2.2.2
332
- - @pluv/persistence-cloudflare-transactional-storage@2.2.2
333
- - @pluv/types@2.2.2
334
-
335
- ## 2.2.1
336
-
337
- ### Patch Changes
338
-
339
- - @pluv/io@2.2.1
340
- - @pluv/persistence-cloudflare-transactional-storage@2.2.1
341
- - @pluv/types@2.2.1
342
-
343
- ## 2.2.0
344
-
345
- ### Patch Changes
346
-
347
- - cb660cd: Fixed multiple Cloudflare Worker Durable Objects sharing references to the same I/O methods.
348
- - Updated dependencies [cb660cd]
349
- - @pluv/io@2.2.0
350
- - @pluv/persistence-cloudflare-transactional-storage@2.2.0
351
- - @pluv/types@2.2.0
352
-
353
- ## 2.1.0
354
-
355
- ### Patch Changes
356
-
357
- - @pluv/io@2.1.0
358
- - @pluv/persistence-cloudflare-transactional-storage@2.1.0
359
- - @pluv/types@2.1.0
360
-
361
- ## 2.0.2
362
-
363
- ### Patch Changes
364
-
365
- - @pluv/io@2.0.2
366
- - @pluv/persistence-cloudflare-transactional-storage@2.0.2
367
- - @pluv/types@2.0.2
368
-
369
- ## 2.0.1
370
-
371
- ### Patch Changes
372
-
373
- - @pluv/io@2.0.1
374
- - @pluv/persistence-cloudflare-transactional-storage@2.0.1
375
- - @pluv/types@2.0.1
376
-
377
- ## 2.0.0
378
-
379
- ### Patch Changes
380
-
381
- - Updated dependencies [047a1d8]
382
- - @pluv/types@2.0.0
383
- - @pluv/io@2.0.0
384
- - @pluv/persistence-cloudflare-transactional-storage@2.0.0
385
-
386
- ## 1.0.2
387
-
388
- ### Patch Changes
389
-
390
- - @pluv/io@1.0.2
391
- - @pluv/persistence-cloudflare-transactional-storage@1.0.2
392
- - @pluv/types@1.0.2
393
-
394
- ## 1.0.1
395
-
396
- ### Patch Changes
397
-
398
- - Updated dependencies [c583be9]
399
- - @pluv/io@1.0.1
400
- - @pluv/persistence-cloudflare-transactional-storage@1.0.1
401
- - @pluv/types@1.0.1
402
-
403
- ## 1.0.0
404
-
405
- ### Major Changes
406
-
407
- - af94706: pluv.io is now stable and production ready!
408
-
409
- 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.
410
-
411
- Checkout the [full documentation here](https://pluv.io/docs/introduction) to get started today!
412
-
413
- ### Patch Changes
414
-
415
- - Updated dependencies [af94706]
416
- - @pluv/io@1.0.0
417
- - @pluv/persistence-cloudflare-transactional-storage@1.0.0
418
- - @pluv/types@1.0.0
419
-
420
- ## 0.44.2
421
-
422
- ### Patch Changes
423
-
424
- - @pluv/io@0.44.2
425
- - @pluv/persistence-cloudflare-transactional-storage@0.44.2
426
- - @pluv/types@0.44.2
427
-
428
- ## 0.44.1
429
-
430
- ### Patch Changes
431
-
432
- - @pluv/io@0.44.1
433
- - @pluv/persistence-cloudflare-transactional-storage@0.44.1
434
- - @pluv/types@0.44.1
435
-
436
- ## 0.44.0
437
-
438
- ### Patch Changes
439
-
440
- - @pluv/io@0.44.0
441
- - @pluv/persistence-cloudflare-transactional-storage@0.44.0
442
- - @pluv/types@0.44.0
443
-
444
- ## 0.43.0
445
-
446
- ### Patch Changes
447
-
448
- - 29fe3fc: Update `platformNode` and `platformCloudflare` to be able to configure limits for `PluvIO` (when self-hosted).
449
- - Updated dependencies [e60a677]
450
- - Updated dependencies [0063e80]
451
- - Updated dependencies [244a973]
452
- - Updated dependencies [4b0fbb3]
453
- - @pluv/io@0.43.0
454
- - @pluv/persistence-cloudflare-transactional-storage@0.43.0
455
- - @pluv/types@0.43.0
456
-
457
- ## 0.42.0
458
-
459
- ### Minor Changes
460
-
461
- - 5c2c71d: **BREAKING** Updated the `PersistenceCloudflareTransactionalStorage` constructor so require a new property `mode` (either `kv` or `sqlite`). `sqlite` makes use of `DurableObject` SQLite storage, and `kv` makes use of their key-value storage. `platformCloudflare` now sets the underlying `PersistenceCloudflareTransactionalStorage` to use the `sqlite` mode by default (was previously using `kv`). For more information on the differences, please refer to [Cloudflare's documentation](https://developers.cloudflare.com/durable-objects/api/storage-api/#sql-api).
462
-
463
- To continue using the `kv` mode, you will need to install `@pluv/persistence-cloudflare-transactional-storage` and provide it manually to `platformCloudflare` with your desired mode.
464
-
465
- ```ts
466
- platformCloudflare({
467
- // ...
468
- persistence: new PersistenceCloudflareTransactionalStorage({ mode: "kv" }),
469
- // ...
470
- });
471
- ```
472
-
473
- ### Patch Changes
474
-
475
- - a47e171: Deprecated `createPluvHandler`. Instead, documentation will be provided on how to host pluv.io yourself on Node.js and Cloudflare Workers.
476
- - Updated dependencies [5c2c71d]
477
- - Updated dependencies [4ce32ee]
478
- - Updated dependencies [cf1529a]
479
- - @pluv/persistence-cloudflare-transactional-storage@0.42.0
480
- - @pluv/io@0.42.0
481
- - @pluv/types@0.42.0
482
-
483
- ## 0.41.7
484
-
485
- ### Patch Changes
486
-
487
- - @pluv/io@0.41.7
488
- - @pluv/persistence-cloudflare-transactional-storage@0.41.7
489
- - @pluv/types@0.41.7
490
-
491
- ## 0.41.6
492
-
493
- ### Patch Changes
494
-
495
- - @pluv/io@0.41.6
496
- - @pluv/persistence-cloudflare-transactional-storage@0.41.6
497
- - @pluv/types@0.41.6
498
-
499
- ## 0.41.5
500
-
501
- ### Patch Changes
502
-
503
- - @pluv/io@0.41.5
504
- - @pluv/persistence-cloudflare-transactional-storage@0.41.5
505
- - @pluv/types@0.41.5
506
-
507
- ## 0.41.4
508
-
509
- ### Patch Changes
510
-
511
- - @pluv/io@0.41.4
512
- - @pluv/persistence-cloudflare-transactional-storage@0.41.4
513
- - @pluv/types@0.41.4
514
-
515
- ## 0.41.3
516
-
517
- ### Patch Changes
518
-
519
- - Updated dependencies [49051c0]
520
- - @pluv/io@0.41.3
521
- - @pluv/persistence-cloudflare-transactional-storage@0.41.3
522
- - @pluv/types@0.41.3
523
-
524
- ## 0.41.2
525
-
526
- ### Patch Changes
527
-
528
- - @pluv/io@0.41.2
529
- - @pluv/persistence-cloudflare-transactional-storage@0.41.2
530
- - @pluv/types@0.41.2
531
-
532
- ## 0.41.1
533
-
534
- ### Patch Changes
535
-
536
- - 9e61e10: Fix inferred context type.
537
- - @pluv/io@0.41.1
538
- - @pluv/persistence-cloudflare-transactional-storage@0.41.1
539
- - @pluv/types@0.41.1
540
-
541
- ## 0.41.0
542
-
543
- ### Patch Changes
544
-
545
- - d07cf2b: Update `createPluvHandler` to automatically garbage collect the dead websockets in the `IORoom` every 60 seconds.
546
- - Updated dependencies [73adf21]
547
- - Updated dependencies [f02a430]
548
- - Updated dependencies [0b908b3]
549
- - Updated dependencies [6422f3b]
550
- - Updated dependencies [555b88d]
551
- - Updated dependencies [a663c65]
552
- - Updated dependencies [555b88d]
553
- - @pluv/io@0.41.0
554
- - @pluv/persistence-cloudflare-transactional-storage@0.41.0
555
- - @pluv/types@0.41.0
556
-
557
- ## 0.40.2
558
-
559
- ### Patch Changes
560
-
561
- - @pluv/io@0.40.2
562
- - @pluv/persistence-cloudflare-transactional-storage@0.40.2
563
- - @pluv/types@0.40.2
564
-
565
- ## 0.40.1
566
-
567
- ### Patch Changes
568
-
569
- - 99019a3: Fix return type to return the correct DurableObject type from `createPluvHandler`.
570
- - @pluv/io@0.40.1
571
- - @pluv/persistence-cloudflare-transactional-storage@0.40.1
572
- - @pluv/types@0.40.1
573
-
574
- ## 0.40.0
575
-
576
- ### Minor Changes
577
-
578
- - f53c6cb: **BREAKING** The `DurableObject` from `createPluvHandler` now properly extends `DuableObject` from `cloudflare:workers`. `@pluv/platform-pluv` is also now only ESM. This may break some Cloudflare Workers if on an older compatibility date.
579
-
580
- ### Patch Changes
581
-
582
- - @pluv/io@0.40.0
583
- - @pluv/persistence-cloudflare-transactional-storage@0.40.0
584
- - @pluv/types@0.40.0
585
-
586
- ## 0.39.1
587
-
588
- ### Patch Changes
589
-
590
- - @pluv/io@0.39.1
591
- - @pluv/persistence-cloudflare-transactional-storage@0.39.1
592
- - @pluv/types@0.39.1
593
-
594
- ## 0.39.0
595
-
596
- ### Patch Changes
597
-
598
- - 78a9c85: Update error codes for invalid websocket connection data to return a 1003 status code instead of 1011.
599
- - Updated dependencies [fe6e239]
600
- - Updated dependencies [737d508]
601
- - @pluv/io@0.39.0
602
- - @pluv/persistence-cloudflare-transactional-storage@0.39.0
603
- - @pluv/types@0.39.0
604
-
605
- ## 0.38.14
606
-
607
- ### Patch Changes
608
-
609
- - @pluv/io@0.38.14
610
- - @pluv/persistence-cloudflare-transactional-storage@0.38.14
611
- - @pluv/types@0.38.14
612
-
613
- ## 0.38.13
614
-
615
- ### Patch Changes
616
-
617
- - Updated dependencies [809afd3]
618
- - @pluv/io@0.38.13
619
- - @pluv/persistence-cloudflare-transactional-storage@0.38.13
620
- - @pluv/types@0.38.13
621
-
622
- ## 0.38.12
623
-
624
- ### Patch Changes
625
-
626
- - @pluv/io@0.38.12
627
- - @pluv/persistence-cloudflare-transactional-storage@0.38.12
628
- - @pluv/types@0.38.12
629
-
630
- ## 0.38.11
631
-
632
- ### Patch Changes
633
-
634
- - @pluv/io@0.38.11
635
- - @pluv/persistence-cloudflare-transactional-storage@0.38.11
636
- - @pluv/types@0.38.11
637
-
638
- ## 0.38.10
639
-
640
- ### Patch Changes
641
-
642
- - @pluv/io@0.38.10
643
- - @pluv/persistence-cloudflare-transactional-storage@0.38.10
644
- - @pluv/types@0.38.10
645
-
646
- ## 0.38.9
647
-
648
- ### Patch Changes
649
-
650
- - @pluv/io@0.38.9
651
- - @pluv/persistence-cloudflare-transactional-storage@0.38.9
652
- - @pluv/types@0.38.9
653
-
654
- ## 0.38.8
655
-
656
- ### Patch Changes
657
-
658
- - @pluv/io@0.38.8
659
- - @pluv/persistence-cloudflare-transactional-storage@0.38.8
660
- - @pluv/types@0.38.8
661
-
662
- ## 0.38.7
663
-
664
- ### Patch Changes
665
-
666
- - @pluv/io@0.38.7
667
- - @pluv/persistence-cloudflare-transactional-storage@0.38.7
668
- - @pluv/types@0.38.7
669
-
670
- ## 0.38.6
671
-
672
- ### Patch Changes
673
-
674
- - @pluv/io@0.38.6
675
- - @pluv/persistence-cloudflare-transactional-storage@0.38.6
676
- - @pluv/types@0.38.6
677
-
678
- ## 0.38.5
679
-
680
- ### Patch Changes
681
-
682
- - @pluv/io@0.38.5
683
- - @pluv/persistence-cloudflare-transactional-storage@0.38.5
684
- - @pluv/types@0.38.5
685
-
686
- ## 0.38.4
687
-
688
- ### Patch Changes
689
-
690
- - @pluv/io@0.38.4
691
- - @pluv/persistence-cloudflare-transactional-storage@0.38.4
692
- - @pluv/types@0.38.4
693
-
694
- ## 0.38.3
695
-
696
- ### Patch Changes
697
-
698
- - Updated dependencies [8346273]
699
- - @pluv/io@0.38.3
700
- - @pluv/persistence-cloudflare-transactional-storage@0.38.3
701
- - @pluv/types@0.38.3
702
-
703
- ## 0.38.2
704
-
705
- ### Patch Changes
706
-
707
- - Updated dependencies [039cd64]
708
- - @pluv/io@0.38.2
709
- - @pluv/persistence-cloudflare-transactional-storage@0.38.2
710
- - @pluv/types@0.38.2
711
-
712
- ## 0.38.1
713
-
714
- ### Patch Changes
715
-
716
- - 702fbd2: Fix sending and receiving the wrong heartbeat websocket events for Cloudflare websocket hibernation.
717
- - @pluv/io@0.38.1
718
- - @pluv/persistence-cloudflare-transactional-storage@0.38.1
719
- - @pluv/types@0.38.1
720
-
721
- ## 0.38.0
722
-
723
- ### Patch Changes
724
-
725
- - Updated dependencies [f4ceca3]
726
- - @pluv/types@0.38.0
727
- - @pluv/io@0.38.0
728
- - @pluv/persistence-cloudflare-transactional-storage@0.38.0
729
-
730
- ## 0.37.7
731
-
732
- ### Patch Changes
733
-
734
- - @pluv/io@0.37.7
735
- - @pluv/persistence-cloudflare-transactional-storage@0.37.7
736
- - @pluv/types@0.37.7
737
-
738
- ## 0.37.6
739
-
740
- ### Patch Changes
741
-
742
- - Updated dependencies [3a874f1]
743
- - @pluv/io@0.37.6
744
- - @pluv/persistence-cloudflare-transactional-storage@0.37.6
745
- - @pluv/types@0.37.6
746
-
747
- ## 0.37.5
748
-
749
- ### Patch Changes
750
-
751
- - 9a9ecee: Fixed an issue where hibernated Cloudflare Worker websockets were not updating their last ping timer and causing them to be disconnected after some time.
752
- - Updated dependencies [9a9ecee]
753
- - @pluv/io@0.37.5
754
- - @pluv/persistence-cloudflare-transactional-storage@0.37.5
755
- - @pluv/types@0.37.5
756
-
757
- ## 0.37.4
758
-
759
- ### Patch Changes
760
-
761
- - @pluv/io@0.37.4
762
- - @pluv/persistence-cloudflare-transactional-storage@0.37.4
763
- - @pluv/types@0.37.4
764
-
765
- ## 0.37.3
766
-
767
- ### Patch Changes
768
-
769
- - @pluv/io@0.37.3
770
- - @pluv/persistence-cloudflare-transactional-storage@0.37.3
771
- - @pluv/types@0.37.3
772
-
773
- ## 0.37.2
774
-
775
- ### Patch Changes
776
-
777
- - @pluv/io@0.37.2
778
- - @pluv/persistence-cloudflare-transactional-storage@0.37.2
779
- - @pluv/types@0.37.2
780
-
781
- ## 0.37.1
782
-
783
- ### Patch Changes
784
-
785
- - @pluv/io@0.37.1
786
- - @pluv/persistence-cloudflare-transactional-storage@0.37.1
787
- - @pluv/types@0.37.1
788
-
789
- ## 0.37.0
790
-
791
- ### Minor Changes
792
-
793
- - 5165be0: **BREAKING**
794
-
795
- Updated the `platformCloudflare` function to return an entire `createIO` input object. Now `createIO` must be called with `platformCloudflare`'s return value as an input.
796
-
797
- ```ts
798
- // Before
799
-
800
- import { createIO } from "@pluv/io";
801
- import { platformCloudflare } from "@pluv/platform-cloudflare";
802
-
803
- export const io = createIO({
804
- authorize: {
805
- // ...
806
- },
807
- context: {
808
- // ...
809
- },
810
- platform: platformCloudflare<Env, Meta>({
811
- // ...
812
- }),
813
- // ...
814
- });
815
-
816
- // After
817
-
818
- import { createIO } from "@pluv/io";
819
- import { infer, platformCloudflare } from "@pluv/platform-cloudflare";
820
-
821
- // Types must now be inferred like so, due to TypeScript limitations around partial inferences
822
- // Note that this types variable is defined outside of the `createIO` function
823
- const types = infer((i) => ({
824
- env: i<Env>,
825
- meta: i<Meta>,
826
- }));
827
- export const io = createIO(
828
- platformCloudflare({
829
- authorize: {
830
- // ...
831
- },
832
- context: {
833
- // ...
834
- },
835
- // Optional: Pass inferred types here
836
- types,
837
- // ...
838
- }),
839
- );
840
- ```
841
-
842
- ### Patch Changes
843
-
844
- - 9b74abb: Improved type inference when calling `PluvIO.server` to not include options that are always undefined (i.e. are not allowed by the specified platform).
845
- - Updated dependencies [9b74abb]
846
- - @pluv/io@0.37.0
847
- - @pluv/persistence-cloudflare-transactional-storage@0.37.0
848
- - @pluv/types@0.37.0
849
-
850
- ## 0.36.0
851
-
852
- ### Patch Changes
853
-
854
- - @pluv/io@0.36.0
855
- - @pluv/persistence-cloudflare-transactional-storage@0.36.0
856
- - @pluv/types@0.36.0
857
-
858
- ## 0.35.4
859
-
860
- ### Patch Changes
861
-
862
- - 5d3a56f: Fix error emitted about `platformCloudflare` not supporting `fetch` when deployed to Cloudflare Workers.
863
- - Updated dependencies [5d3a56f]
864
- - @pluv/io@0.35.4
865
- - @pluv/persistence-cloudflare-transactional-storage@0.35.4
866
- - @pluv/types@0.35.4
867
-
868
- ## 0.35.3
869
-
870
- ### Patch Changes
871
-
872
- - @pluv/io@0.35.3
873
- - @pluv/persistence-cloudflare-transactional-storage@0.35.3
874
- - @pluv/types@0.35.3
875
-
876
- ## 0.35.2
877
-
878
- ### Patch Changes
879
-
880
- - Updated dependencies [81cb692]
881
- - @pluv/types@0.35.2
882
- - @pluv/io@0.35.2
883
- - @pluv/persistence-cloudflare-transactional-storage@0.35.2
884
-
885
- ## 0.35.1
886
-
887
- ### Patch Changes
888
-
889
- - @pluv/io@0.35.1
890
- - @pluv/persistence-cloudflare-transactional-storage@0.35.1
891
- - @pluv/types@0.35.1
892
-
893
- ## 0.35.0
894
-
895
- ### Patch Changes
896
-
897
- - Updated dependencies [c9073ad]
898
- - @pluv/io@0.35.0
899
- - @pluv/persistence-cloudflare-transactional-storage@0.35.0
900
- - @pluv/types@0.35.0
901
-
902
- ## 0.34.1
903
-
904
- ### Patch Changes
905
-
906
- - Updated dependencies [d639427]
907
- - @pluv/io@0.34.1
908
- - @pluv/persistence-cloudflare-transactional-storage@0.34.1
909
- - @pluv/types@0.34.1
910
-
911
- ## 0.34.0
912
-
913
- ### Minor Changes
914
-
915
- - 70af3b2: Updated `@pluv/io` to have a `handleMode` internally that determines if connections are handled by the `PluvServer` or by the platform itself (i.e. outside of the `PluvServer`). The internals of `@pluv/platform-node` and `@pluv/platform-cloudflare` have been updated with the required changes for this.
916
-
917
- ### Patch Changes
918
-
919
- - Updated dependencies [0c920ea]
920
- - Updated dependencies [70af3b2]
921
- - @pluv/io@0.34.0
922
- - @pluv/persistence-cloudflare-transactional-storage@0.34.0
923
- - @pluv/types@0.34.0
924
-
925
- ## 0.33.0
926
-
927
- ### Patch Changes
928
-
929
- - @pluv/io@0.33.0
930
- - @pluv/persistence-cloudflare-transactional-storage@0.33.0
931
- - @pluv/types@0.33.0
932
-
933
- ## 0.32.9
934
-
935
- ### Patch Changes
936
-
937
- - @pluv/io@0.32.9
938
- - @pluv/persistence-cloudflare-transactional-storage@0.32.9
939
- - @pluv/types@0.32.9
940
-
941
- ## 0.32.8
942
-
943
- ### Patch Changes
944
-
945
- - Updated dependencies [e659f8a]
946
- - @pluv/io@0.32.8
947
- - @pluv/persistence-cloudflare-transactional-storage@0.32.8
948
- - @pluv/types@0.32.8
949
-
950
- ## 0.32.7
951
-
952
- ### Patch Changes
953
-
954
- - @pluv/io@0.32.7
955
- - @pluv/persistence-cloudflare-transactional-storage@0.32.7
956
- - @pluv/types@0.32.7
957
-
958
- ## 0.32.6
959
-
960
- ### Patch Changes
961
-
962
- - Updated dependencies [c0956e7]
963
- - @pluv/io@0.32.6
964
- - @pluv/persistence-cloudflare-transactional-storage@0.32.6
965
- - @pluv/types@0.32.6
966
-
967
- ## 0.32.5
968
-
969
- ### Patch Changes
970
-
971
- - 98d7585: Update `meta` type on platform contexts to allow for nested json types.
972
- - @pluv/io@0.32.5
973
- - @pluv/persistence-cloudflare-transactional-storage@0.32.5
974
- - @pluv/types@0.32.5
975
-
976
- ## 0.32.4
977
-
978
- ### Patch Changes
979
-
980
- - fd054db: Add support for adding metadata to context when creating a room.
981
-
982
- ```ts
983
- import { createIO } from "@pluv/io";
984
-
985
- // If using Cloudflare
986
- import { platformCloudflare } from "@pluv/platform-cloudflare";
987
-
988
- const io = createIO({
989
- // ...
990
- platform: platformCloudflare<CloudflareEnv, { myCustomData: string }>(),
991
- context: ({
992
- env,
993
- state,
994
- // This is now available on the context function
995
- meta,
996
- }) => ({ env, state, meta }),
997
- });
998
-
999
- const ioServer = io.server();
1000
-
1001
- ioServer.createRoom("my-room", {
1002
- // ...
1003
- // This will now be a required property when creating a room
1004
- meta: { myCustomData: "hello world" },
1005
- });
1006
-
1007
- // If using Node.js
1008
- import { platformNode } from "@pluv/platform-node";
1009
-
1010
- const io = createIO({
1011
- // ...
1012
- platform: platformNode<{ myCustomData: string }>(),
1013
- context: ({
1014
- // This is now available on the context function
1015
- meta,
1016
- }) => ({ env, state, meta }),
1017
- });
1018
-
1019
- const ioServer = io.server();
1020
-
1021
- ioServer.createRoom("my-room", {
1022
- // ...
1023
- // This will now be a required property when creating a room
1024
- meta: { myCustomData: "hello world" },
1025
- });
1026
- ```
1027
-
1028
- - @pluv/io@0.32.4
1029
- - @pluv/persistence-cloudflare-transactional-storage@0.32.4
1030
- - @pluv/types@0.32.4
1031
-
1032
- ## 0.32.3
1033
-
1034
- ### Patch Changes
1035
-
1036
- - Updated dependencies [bb21274]
1037
- - @pluv/io@0.32.3
1038
- - @pluv/persistence-cloudflare-transactional-storage@0.32.3
1039
- - @pluv/types@0.32.3
1040
-
1041
- ## 0.32.2
1042
-
1043
- ### Patch Changes
1044
-
1045
- - Updated dependencies [890d45b]
1046
- - @pluv/io@0.32.2
1047
- - @pluv/persistence-cloudflare-transactional-storage@0.32.2
1048
- - @pluv/types@0.32.2
1049
-
1050
- ## 0.32.1
1051
-
1052
- ### Patch Changes
1053
-
1054
- - @pluv/io@0.32.1
1055
- - @pluv/persistence-cloudflare-transactional-storage@0.32.1
1056
- - @pluv/types@0.32.1
1057
-
1058
- ## 0.32.0
1059
-
1060
- ### Patch Changes
1061
-
1062
- - Updated dependencies [cde5305]
1063
- - @pluv/io@0.32.0
1064
- - @pluv/persistence-cloudflare-transactional-storage@0.32.0
1065
- - @pluv/types@0.32.0
1066
-
1067
- ## 0.31.0
1068
-
1069
- ### Minor Changes
1070
-
1071
- - b3c31d7: **BREAKING**
1072
-
1073
- Fixed platform context types. This will require additional properties when registering a websocket and creating authorization tokens. See example below:
1074
-
1075
- ```ts
1076
- // @pluv/platform-node example
1077
-
1078
- import { platformNode } from "@pluv/platform-node";
1079
- import { createIO } from "@pluv/io";
1080
- import type { IncomingMessage } from "node:http";
1081
- import { z } from "zod";
1082
-
1083
- const io = createIO({
1084
- // If using a function authorize parameter, `req` is now available as a param
1085
- authorize: ({ req }) => ({
1086
- required: true,
1087
- secret: "MY-CUSTOM-SECRET",
1088
- user: z.object({
1089
- id: z.string(),
1090
- }),
1091
- }),
1092
- platformNode(),
1093
- });
1094
-
1095
- // Before
1096
- io.createToken({
1097
- room: "my-custom-room",
1098
- user: { id: "abc123" },
1099
- });
1100
-
1101
- // After
1102
- io.createToken({
1103
- room: "my-custom-room",
1104
- user: { id: "abc123" },
1105
-
1106
- // Previously not required, but now required
1107
- req: req as IncomingMessage,
1108
- });
1109
- ```
1110
-
1111
- ```ts
1112
- // @pluv/platform-cloudflare example
1113
-
1114
- import { platformCloudflare } from "@pluv/platform-cloudflare";
1115
- import { createIO } from "@pluv/io";
1116
- import { z } from "zod";
1117
-
1118
- const io = createIO({
1119
- // If using a function authorize parameter, `env` and `request` are now available as params
1120
- authorize: ({ env, request }) => ({
1121
- required: true,
1122
- secret: "MY-CUSTOM-SECRET",
1123
- user: z.object({
1124
- id: z.string(),
1125
- }),
1126
- }),
1127
- platformCloudflare(),
1128
- });
1129
-
1130
- // Before
1131
- io.createToken({
1132
- room: "my-custom-room",
1133
- user: { id: "abc123" },
1134
- });
1135
-
1136
- // After
1137
- io.createToken({
1138
- room: "my-custom-room",
1139
- user: { id: "abc123" },
1140
-
1141
- // Previously not required, but now required
1142
- env: env as Env,
1143
- request: request as Request,
1144
- });
1145
- ```
1146
-
1147
- - 0f98064: **BREAKING**
1148
-
1149
- Update `authorize` params so that `roomId` is renamed to `room` and more platform-specific parameters are exposed. See example below:
1150
-
1151
- ```ts
1152
- // @pluv/platform-cloudflare example
1153
- import { createPluvHandler } from "@pluv/platform-cloudflare";
1154
-
1155
- // Before
1156
- createPluvHandler({
1157
- // ...
1158
- authorize: ({ roomId }) => {
1159
- // ...
1160
- },
1161
- });
1162
-
1163
- // After
1164
- createPluvHandler({
1165
- // ...
1166
- authorize: ({ env, request, room }) => {
1167
- // ...
1168
- },
1169
- });
1170
- ```
1171
-
1172
- ```ts
1173
- // @pluv/platform-node example
1174
- import { createPluvHandler } from "@pluv/platform-node";
1175
-
1176
- // Before
1177
- createPluvHandler({
1178
- // ...
1179
- authorize: ({ roomId }) => {
1180
- // ...
1181
- },
1182
- });
1183
-
1184
- // After
1185
- createPluvHandler({
1186
- // ...
1187
- authorize: ({ req, room }) => {
1188
- // ...
1189
- },
1190
- });
1191
- ```
1192
-
1193
- ### Patch Changes
1194
-
1195
- - Updated dependencies [b3c31d7]
1196
- - @pluv/io@0.31.0
1197
- - @pluv/persistence-cloudflare-transactional-storage@0.31.0
1198
- - @pluv/types@0.31.0
1199
-
1200
- ## 0.30.2
1201
-
1202
- ### Patch Changes
1203
-
1204
- - 6521b05: Export the types of `NodePlatform` and `CloudflarePlatform`.
1205
- - @pluv/io@0.30.2
1206
- - @pluv/persistence-cloudflare-transactional-storage@0.30.2
1207
- - @pluv/types@0.30.2
1208
-
1209
- ## 0.30.1
1210
-
1211
- ### Patch Changes
1212
-
1213
- - Updated dependencies [b9c3633]
1214
- - @pluv/io@0.30.1
1215
- - @pluv/persistence-cloudflare-transactional-storage@0.30.1
1216
- - @pluv/types@0.30.1
1217
-
1218
- ## 0.30.0
1219
-
1220
- ### Patch Changes
1221
-
1222
- - Updated dependencies [7246a9e]
1223
- - @pluv/io@0.30.0
1224
- - @pluv/persistence-cloudflare-transactional-storage@0.30.0
1225
- - @pluv/types@0.30.0
1226
-
1227
- ## 0.29.0
1228
-
1229
- ### Patch Changes
1230
-
1231
- - @pluv/io@0.29.0
1232
- - @pluv/persistence-cloudflare-transactional-storage@0.29.0
1233
- - @pluv/types@0.29.0
1234
-
1235
- ## 0.28.0
1236
-
1237
- ### Patch Changes
1238
-
1239
- - @pluv/io@0.28.0
1240
- - @pluv/persistence-cloudflare-transactional-storage@0.28.0
1241
- - @pluv/types@0.28.0
1242
-
1243
- ## 0.27.0
1244
-
1245
- ### Patch Changes
1246
-
1247
- - Updated dependencies [19ed36c]
1248
- - Updated dependencies [e309b0b]
1249
- - @pluv/io@0.27.0
1250
- - @pluv/persistence-cloudflare-transactional-storage@0.27.0
1251
- - @pluv/types@0.27.0
1252
-
1253
- ## 0.26.0
1254
-
1255
- ### Patch Changes
1256
-
1257
- - 2a6e078: Updated `@pluv/platform-cloudflare` and `@pluv/platform-node` so that exact properties are used in its initialization.
1258
- - @pluv/io@0.26.0
1259
- - @pluv/persistence-cloudflare-transactional-storage@0.26.0
1260
- - @pluv/types@0.26.0
1261
-
1262
- ## 0.25.4
1263
-
1264
- ### Patch Changes
1265
-
1266
- - Updated dependencies [7a9080c]
1267
- - @pluv/io@0.25.4
1268
- - @pluv/persistence-cloudflare-transactional-storage@0.25.4
1269
- - @pluv/types@0.25.4
1270
-
1271
- ## 0.25.3
1272
-
1273
- ### Patch Changes
1274
-
1275
- - Updated dependencies [50d9b96]
1276
- - @pluv/io@0.25.3
1277
- - @pluv/persistence-cloudflare-transactional-storage@0.25.3
1278
- - @pluv/types@0.25.3
1279
-
1280
- ## 0.25.2
1281
-
1282
- ### Patch Changes
1283
-
1284
- - Updated dependencies [60a0bf1]
1285
- - @pluv/io@0.25.2
1286
- - @pluv/persistence-cloudflare-transactional-storage@0.25.2
1287
- - @pluv/types@0.25.2
1288
-
1289
- ## 0.25.1
1290
-
1291
- ### Patch Changes
1292
-
1293
- - Updated dependencies [3925f7c]
1294
- - @pluv/io@0.25.1
1295
- - @pluv/persistence-cloudflare-transactional-storage@0.25.1
1296
- - @pluv/types@0.25.1
1297
-
1298
- ## 0.25.0
1299
-
1300
- ### Minor Changes
1301
-
1302
- - 9db06ba: **BREAKING **
1303
-
1304
- Fixed typos `persistance` to `persistence`.
1305
-
1306
- This does mean that all properties referencing `persistance` will need to be fixed. Examples below:
1307
-
1308
- ```bash
1309
- # Re-install @pluv/persistence-redis
1310
- pnpm uninstall @pluv/persistance-redis
1311
- pnpm install @pluv/persistence-redis
1312
- ```
1313
-
1314
- ```ts
1315
- // Before
1316
- createIO({
1317
- platform: platformNode({
1318
- persistance: new PersistanceRedis(/* ... */),
1319
- }),
1320
- });
1321
-
1322
- // After
1323
- createIO({
1324
- platform: platformNode({
1325
- persistence: new PersistenceRedis(/* ... */),
1326
- }),
1327
- });
1328
- ```
1329
-
1330
- `@pluv/persistance-redis` has been deprecated for `@pluv/persistence-redis`.
1331
-
1332
- ### Patch Changes
1333
-
1334
- - Updated dependencies [9db06ba]
1335
- - Updated dependencies [4e078ca]
1336
- - Updated dependencies [f556d30]
1337
- - Updated dependencies [9db06ba]
1338
- - @pluv/persistence-cloudflare-transactional-storage@0.25.0
1339
- - @pluv/io@0.25.0
1340
- - @pluv/types@0.25.0
1341
-
1342
- ## 0.24.1
1343
-
1344
- ### Patch Changes
1345
-
1346
- - @pluv/io@0.24.1
1347
- - @pluv/types@0.24.1
1348
-
1349
- ## 0.24.0
1350
-
1351
- ### Patch Changes
1352
-
1353
- - Updated dependencies [6ac8a46]
1354
- - Updated dependencies [c26986d]
1355
- - @pluv/io@0.24.0
1356
- - @pluv/types@0.24.0
1357
-
1358
- ## 0.23.0
1359
-
1360
- ### Patch Changes
1361
-
1362
- - Updated dependencies [c01b16f]
1363
- - @pluv/io@0.23.0
1364
- - @pluv/types@0.23.0
1365
-
1366
- ## 0.22.0
1367
-
1368
- ### Minor Changes
1369
-
1370
- - 650e577: \* Fix `@pluv/platform-cloudflare` causing frequent disconnects due to incorrect heartbeat handling.
1371
- - Updated default `mode` of `@pluv/platform-cloudflare` back to `"detached"` (i.e. use Cloudflare Worker Hibernation API by default).
1372
-
1373
- ### Patch Changes
1374
-
1375
- - Updated dependencies [650e577]
1376
- - @pluv/io@0.22.0
1377
- - @pluv/types@0.22.0
1378
-
1379
- ## 0.21.1
1380
-
1381
- ### Patch Changes
1382
-
1383
- - ba53e7a: Revert `@platform/cloudflare` mode to `attached` from `detached` temporarily.
1384
- - @pluv/io@0.21.1
1385
- - @pluv/types@0.21.1
1386
-
1387
- ## 0.21.0
1388
-
1389
- ### Minor Changes
1390
-
1391
- - 307bd44: `@pluv/platform-cloudflare` now supports Cloudflare Worker's WebSocket Hibernation API, and usees it by default.
1392
-
1393
- To switch back to not using the WebSocket Hibernation API, specify a `mode` of `attached`.
1394
-
1395
- ```ts
1396
- // With event-listeners directly attached to the websocket on registration (i.e. non-hibernation)
1397
- createIO({
1398
- platform: platformCloudflare({
1399
- mode: "attached",
1400
- }),
1401
- });
1402
-
1403
- // With event listeners unattached to the websocket during registration (i.e. hibernation)
1404
- createIO({
1405
- platform: platformCloudflare({
1406
- mode: "detached",
1407
- }),
1408
- });
1409
- ```
1410
-
1411
- - 41b15e4: **BREAKING** - Updated `sessions` type in the procedure context from `Map<string, WebSocketSession>` to `readonly WebSocketSession[]`.
1412
- - f570c8a: **BREAKING**: The original request object is no longer available in the context of any event resolvers.
1413
-
1414
- Previously, the request object that was passed into `PluvServer.getRoom` would be made available on the context object of each of the resolvers. This is no-longer a part of the event context, and therefore needs to be omitted from calls to `PluvServer.getRoom`.
1415
-
1416
- ```ts
1417
- // Before
1418
-
1419
- // With platform-node
1420
- ioServer.getRoom(websocket, { req, token });
1421
-
1422
- // With platform-cloudflare
1423
- ioServer.getRoom(websocket, { env, req, token });
1424
- ```
1425
-
1426
- ```ts
1427
- // Now
1428
-
1429
- // With platform-node
1430
- ioServer.getRoom(websocket, { req });
1431
-
1432
- // With platform-cloudflare
1433
- ioServer.getRoom(websocket, { env, req });
1434
- ```
1435
-
1436
- - b98ab6b: Internal updates to platforms (i.e. `@pluv/platform-cloudflare` and `@pluv/platform-node`) to be able to support Cloudflare Worker Websocket Hibernation APIs.
1437
- - 4c2228d: **BREAKING**: Require `DurableObjectState` in `ioServer.getRoom`.
1438
-
1439
- ```ts
1440
- // Before
1441
-
1442
- // With platform-cloudflare
1443
- ioServer.getRoom(websocket, { env, req });
1444
- ```
1445
-
1446
- ```ts
1447
- // Now
1448
-
1449
- // With platform-cloudflare
1450
- ioServer.getRoom(websocket, { env, req, state });
1451
- ```
1452
-
1453
- ### Patch Changes
1454
-
1455
- - cc2613e: Moved `sessionId` from being derived in `IORoom` to being derived as a getter in `AbstractWebsocket`.
1456
- - Updated dependencies [307bd44]
1457
- - Updated dependencies [41b15e4]
1458
- - Updated dependencies [f570c8a]
1459
- - Updated dependencies [b98ab6b]
1460
- - Updated dependencies [4c2228d]
1461
- - Updated dependencies [cc2613e]
1462
- - @pluv/io@0.21.0
1463
- - @pluv/types@0.21.0
1464
-
1465
- ## 0.20.0
1466
-
1467
- ### Patch Changes
1468
-
1469
- - @pluv/io@0.20.0
1470
- - @pluv/types@0.20.0
1471
-
1472
- ## 0.19.0
1473
-
1474
- ### Patch Changes
1475
-
1476
- - @pluv/io@0.19.0
1477
- - @pluv/types@0.19.0
1478
-
1479
- ## 0.18.0
1480
-
1481
- ### Minor Changes
1482
-
1483
- - 99b5ca9: ## Breaking Changes
1484
- - `@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.
1485
-
1486
- ### Before:
1487
-
1488
- ```ts
1489
- // backend/io.ts
1490
-
1491
- import { createIO } from "@pluv/io";
1492
- import { createPluvHandler, platformNode } from "@pluv/platform-node";
1493
- import { z } from "zod";
1494
-
1495
- export const io = createIO({
1496
- platform: platformNode(),
1497
- })
1498
- .event("SEND_MESSAGE", {
1499
- input: z.object({ message: z.string() }),
1500
- resolver: ({ message }) => ({ RECEIVE_MESSAGE: { message } }),
1501
- })
1502
- .event("DOUBLE_VALUE", {
1503
- input: z.object({ value: z.number() }),
1504
- resolver: ({ value }) => ({ VALUE_DOUBLED: { value: value * 2 } }),
1505
- });
1506
-
1507
- const Pluv = createPluvHandler({
1508
- io,
1509
- /* ... */
1510
- });
1511
- ```
1512
-
1513
- ```ts
1514
- // frontend/pluv.ts
1515
-
1516
- import { createClient } from "@pluv/react";
1517
- import type { io } from "../backend/io";
1518
-
1519
- const client = createClient<typeof io>({/* ... */});
1520
- ```
1521
-
1522
- ### Now:
1523
-
1524
- ```ts
1525
- import { createIO } from "@pluv/io";
1526
- import { createPluvHandler, platformNode } from "@pluv/platform-node";
1527
- import { z } from "zod";
1528
-
1529
- const io = createIO({
1530
- platform: platformNode(),
1531
- });
1532
-
1533
- const router = io.router({
1534
- SEND_MESSAGE: io.procedure
1535
- .input(z.object({ message: z.string() }))
1536
- .broadcast(({ message }) => ({
1537
- RECEIVE_MESSAGE: { message },
1538
- })),
1539
- DOUBLE_VALUE: io.procedure
1540
- .input(z.object({ value: z.number() }))
1541
- .broadcast(({ value }) => ({
1542
- VALUE_DOUBLED: { value: value * 2 },
1543
- })),
1544
- });
1545
-
1546
- export const ioServer = io.server({ router });
1547
-
1548
- const Pluv = createPluvHandler({
1549
- io: ioServer, // <- This uses the PluvServer now
1550
- /* ... */
1551
- });
1552
- ```
1553
-
1554
- ```ts
1555
- // frontend/pluv.ts
1556
-
1557
- import { createClient } from "@pluv/react";
1558
- import type { ioServer } from "../backend/io";
1559
-
1560
- // This users the PluvServer type now
1561
- const client = createClient<typeof ioServer>({/* ... */});
1562
- ```
1563
-
1564
- - `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:
1565
-
1566
- ```ts
1567
- const router = io.mergeRouters(router1, router2);
1568
- ```
1569
-
1570
- ### Patch Changes
1571
-
1572
- - Updated dependencies [428c21c]
1573
- - Updated dependencies [329dbcd]
1574
- - Updated dependencies [99b5ca9]
1575
- - @pluv/io@0.18.0
1576
- - @pluv/types@0.18.0
1577
-
1578
- ## 0.17.3
1579
-
1580
- ### Patch Changes
1581
-
1582
- - @pluv/io@0.17.3
1583
- - @pluv/types@0.17.3
1584
-
1585
- ## 0.17.2
1586
-
1587
- ### Patch Changes
1588
-
1589
- - @pluv/io@0.17.2
1590
- - @pluv/types@0.17.2
1591
-
1592
- ## 0.17.1
1593
-
1594
- ### Patch Changes
1595
-
1596
- - @pluv/io@0.17.1
1597
- - @pluv/types@0.17.1
1598
-
1599
- ## 0.17.0
1600
-
1601
- ### Minor Changes
1602
-
1603
- - 507bc00: _BREAKING_: The `authorize` config when calling `createIO` can now also be a function that exposes the platform context.
1604
- This allows accessing the `env` in Cloudflare workers.
1605
-
1606
- ```ts
1607
- import { createIO } from "@pluv/io";
1608
- import { platformCloudflare } from "@pluv/platform-cloudflare";
1609
- import { z } from "zod";
1610
-
1611
- const io = createIO({
1612
- authorize: ({ env }) => ({
1613
- required: true,
1614
- secret: env.PLUV_AUTHORIZE_SECRET,
1615
- user: z.object({
1616
- id: z.string(),
1617
- name: z.string(),
1618
- }),
1619
- }),
1620
- platform: platformCloudflare<{ PLUV_AUTHORIZE_SECRET: string }>(),
1621
- // ...
1622
- });
1623
- ```
1624
-
1625
- This also requires that the platform contexts are passed to `io.createToken`.
1626
-
1627
- ```ts
1628
- // If using `platformNode`
1629
- await io.createToken({
1630
- req, // This `IncomingMessage` is now required
1631
- room,
1632
- user: {
1633
- id: "user_123",
1634
- name: "john doe",
1635
- },
1636
- });
1637
-
1638
- // If using `platformCloudflare`
1639
- await io.createToken({
1640
- env, // This env is now required from the handler's fetch function
1641
- room,
1642
- user: {
1643
- id: "user_123",
1644
- name: "john doe",
1645
- },
1646
- });
1647
- ```
1648
-
1649
- ### Patch Changes
1650
-
1651
- - Updated dependencies [507bc00]
1652
- - @pluv/types@0.17.0
1653
- - @pluv/io@0.17.0
1654
-
1655
- ## 0.16.3
1656
-
1657
- ### Patch Changes
1658
-
1659
- - Updated dependencies [0bf0934]
1660
- - @pluv/io@0.16.3
1661
- - @pluv/types@0.16.3
1662
-
1663
- ## 0.16.2
1664
-
1665
- ### Patch Changes
1666
-
1667
- - Updated dependencies [06f572d]
1668
- - @pluv/io@0.16.2
1669
- - @pluv/types@0.16.2
1670
-
1671
- ## 0.16.1
1672
-
1673
- ### Patch Changes
1674
-
1675
- - Updated dependencies [cd05d96]
1676
- - @pluv/io@0.16.1
1677
- - @pluv/types@0.16.1
1678
-
1679
- ## 0.16.0
1680
-
1681
- ### Patch Changes
1682
-
1683
- - Updated dependencies [4280220]
1684
- - @pluv/io@0.16.0
1685
- - @pluv/types@0.16.0
1686
-
1687
- ## 0.15.0
1688
-
1689
- ### Patch Changes
1690
-
1691
- - @pluv/io@0.15.0
1692
- - @pluv/types@0.15.0
1693
-
1694
- ## 0.14.1
1695
-
1696
- ### Patch Changes
1697
-
1698
- - @pluv/io@0.14.1
1699
- - @pluv/types@0.14.1
1700
-
1701
- ## 0.14.0
1702
-
1703
- ### Patch Changes
1704
-
1705
- - @pluv/io@0.14.0
1706
- - @pluv/types@0.14.0
1707
-
1708
- ## 0.13.0
1709
-
1710
- ### Patch Changes
1711
-
1712
- - @pluv/io@0.13.0
1713
- - @pluv/types@0.13.0
1714
-
1715
- ## 0.12.3
1716
-
1717
- ### Patch Changes
1718
-
1719
- - da9f600: Upgraded dependencies
1720
- - Updated dependencies [da9f600]
1721
- - @pluv/io@0.12.3
1722
- - @pluv/types@0.12.3
1723
-
1724
- ## 0.12.2
1725
-
1726
- ### Patch Changes
1727
-
1728
- - 259a7da: Bumped dependencies
1729
-
1730
- ## 0.12.1
1731
-
1732
- ### Patch Changes
1733
-
1734
- - @pluv/io@0.12.1
1735
- - @pluv/types@0.12.1
1736
-
1737
- ## 0.12.0
1738
-
1739
- ### Patch Changes
1740
-
1741
- - @pluv/io@0.12.0
1742
- - @pluv/types@0.12.0
1743
-
1744
- ## 0.11.1
1745
-
1746
- ### Patch Changes
1747
-
1748
- - 74b3061: Bumped minor and patch dependencies.
1749
- - Updated dependencies [74b3061]
1750
- - @pluv/io@0.11.1
1751
- - @pluv/types@0.11.1
1752
-
1753
- ## 0.11.0
1754
-
1755
- ### Patch Changes
1756
-
1757
- - Updated dependencies [b538f5c]
1758
- - @pluv/io@0.11.0
1759
- - @pluv/types@0.11.0
1760
-
1761
- ## 0.10.3
1762
-
1763
- ### Patch Changes
1764
-
1765
- - Updated dependencies [a7d3ad1]
1766
- - @pluv/io@0.10.3
1767
- - @pluv/types@0.10.3
1768
-
1769
- ## 0.10.2
1770
-
1771
- ### Patch Changes
1772
-
1773
- - Updated dependencies [3deee13]
1774
- - @pluv/io@0.10.2
1775
- - @pluv/types@0.10.2
1776
-
1777
- ## 0.10.1
1778
-
1779
- ### Patch Changes
1780
-
1781
- - 0eeb67c: Passed through sessionId and userId into platform websockets.
1782
- - 885835d: remove unnecessary dependency
1783
- - Updated dependencies [0eeb67c]
1784
- - Updated dependencies [885835d]
1785
- - @pluv/io@0.10.1
1786
- - @pluv/types@0.10.1
1787
-
1788
- ## 0.10.0
1789
-
1790
- ### Minor Changes
1791
-
1792
- - f43f1cc: Change packages to all be versioned together for consistency.
1793
-
1794
- ### Patch Changes
1795
-
1796
- - Updated dependencies [f43f1cc]
1797
- - @pluv/io@0.10.0
1798
- - @pluv/types@0.10.0
1799
-
1800
- ## 0.3.4
1801
-
1802
- ### Patch Changes
1803
-
1804
- - @pluv/io@0.7.2
1805
-
1806
- ## 0.3.3
1807
-
1808
- ### Patch Changes
1809
-
1810
- - 8fba48b: fix including incorrect dependency
1811
- - 8997c65: bumped dependencies
1812
- - Updated dependencies [8fba48b]
1813
- - Updated dependencies [8997c65]
1814
- - @pluv/types@0.2.2
1815
- - @pluv/io@0.7.1
1816
-
1817
- ## 0.3.2
1818
-
1819
- ### Patch Changes
1820
-
1821
- - 8d11672: bumped dependencies to latest
1822
- - Updated dependencies [8d11672]
1823
- - Updated dependencies [829d31b]
1824
- - @pluv/types@0.2.1
1825
- - @pluv/io@0.7.0
1826
-
1827
- ## 0.3.1
1828
-
1829
- ### Patch Changes
1830
-
1831
- - Updated dependencies [2e7cbfa]
1832
- - @pluv/io@0.6.0
1833
-
1834
- ## 0.3.0
1835
-
1836
- ### Minor Changes
1837
-
1838
- - ae4e1f1: added platform-specific contexts to expose env in cloudflare and req in node.js
1839
-
1840
- ### Patch Changes
1841
-
1842
- - Updated dependencies [ae4e1f1]
1843
- - @pluv/io@0.5.0
1844
-
1845
- ## 0.2.1
1846
-
1847
- ### Patch Changes
1848
-
1849
- - Updated dependencies [8917309]
1850
- - @pluv/io@0.4.2
1851
-
1852
- ## 0.2.0
1853
-
1854
- ### Minor Changes
1855
-
1856
- - 643d5b5: added createPluvHandler to automatically set-up a pluv server with reasonable defaults
1857
-
1858
- ### Patch Changes
1859
-
1860
- - b85a232: bumped dependencies
1861
- - fde89cf: added defaults to the client to align it with createPluvClient by default
1862
- - Updated dependencies [b85a232]
1863
- - @pluv/io@0.4.1
1864
- - @pluv/types@0.2.0
1865
-
1866
- ## 0.1.18
1867
-
1868
- ### Patch Changes
1869
-
1870
- - Updated dependencies [41943cf]
1871
- - Updated dependencies [0dd847e]
1872
- - Updated dependencies [bb2886b]
1873
- - Updated dependencies [ae679a8]
1874
- - Updated dependencies [3518a83]
1875
- - @pluv/io@0.4.0
1876
- - @pluv/types@0.2.0
1877
-
1878
- ## 0.1.17
1879
-
1880
- ### Patch Changes
1881
-
1882
- - Updated dependencies [abb3622]
1883
- - @pluv/io@0.3.9
1884
-
1885
- ## 0.1.16
1886
-
1887
- ### Patch Changes
1888
-
1889
- - Updated dependencies [bcf1c3e]
1890
- - @pluv/io@0.3.8
1891
-
1892
- ## 0.1.15
1893
-
1894
- ### Patch Changes
1895
-
1896
- - Updated dependencies [ecc4040]
1897
- - @pluv/io@0.3.7
1898
-
1899
- ## 0.1.14
1900
-
1901
- ### Patch Changes
1902
-
1903
- - Updated dependencies [a7e2980]
1904
- - @pluv/io@0.3.6
1905
-
1906
- ## 0.1.13
1907
-
1908
- ### Patch Changes
1909
-
1910
- - 78fd644: updated readmes with links to the documentation website
1911
- - Updated dependencies [78fd644]
1912
- - @pluv/io@0.3.5
1913
-
1914
- ## 0.1.12
1915
-
1916
- ### Patch Changes
1917
-
1918
- - 850626e: bumped dependencies
1919
- - Updated dependencies [850626e]
1920
- - @pluv/types@0.1.6
1921
- - @pluv/io@0.3.4
1922
-
1923
- ## 0.1.11
1924
-
1925
- ### Patch Changes
1926
-
1927
- - Updated dependencies [77069a1]
1928
- - @pluv/io@0.3.3
1929
- - @pluv/types@0.1.5
1930
-
1931
- ## 0.1.10
1932
-
1933
- ### Patch Changes
1934
-
1935
- - Updated dependencies [9ae251d]
1936
- - @pluv/io@0.3.2
1937
-
1938
- ## 0.1.9
1939
-
1940
- ### Patch Changes
1941
-
1942
- - 74870ee: bumped dependencies
1943
- - Updated dependencies [74870ee]
1944
- - @pluv/types@0.1.5
1945
- - @pluv/io@0.3.1
1946
-
1947
- ## 0.1.8
1948
-
1949
- ### Patch Changes
1950
-
1951
- - Updated dependencies [c5567f1]
1952
- - Updated dependencies [c5567f1]
1953
- - @pluv/io@0.3.0
1954
- - @pluv/types@0.1.4
1955
-
1956
- ## 0.1.7
1957
-
1958
- ### Patch Changes
1959
-
1960
- - 9516a4e: updated typescript to 5.0
1961
- - 7b6da1c: bumped dependencies
1962
- - e9c1514: bumped dependencies
1963
- - 9d1829c: chore: bumped dependencies
1964
- - Updated dependencies [9516a4e]
1965
- - Updated dependencies [7b6da1c]
1966
- - Updated dependencies [e9c1514]
1967
- - Updated dependencies [9d1829c]
1968
- - @pluv/types@0.1.4
1969
- - @pluv/io@0.2.6
1970
-
1971
- ## 0.1.6
1972
-
1973
- ### Patch Changes
1974
-
1975
- - 161e00e: fixed links to other pluv packages in readmes
1976
- - Updated dependencies [161e00e]
1977
- - Updated dependencies [f6c0e65]
1978
- - @pluv/io@0.2.5
1979
- - @pluv/types@0.1.3
1980
-
1981
- ## 0.1.5
1982
-
1983
- ### Patch Changes
1984
-
1985
- - 8bf62cb: bumped dependencies
1986
- - 7e52685: Bumped dependencies
1987
- - d6dd1c3: updated dependencies
1988
- - 8e97fb2: Updated dependencies
1989
- - Updated dependencies [8bf62cb]
1990
- - Updated dependencies [7e52685]
1991
- - Updated dependencies [3b7b17a]
1992
- - Updated dependencies [b1cb325]
1993
- - Updated dependencies [8e97fb2]
1994
- - @pluv/io@0.2.4
1995
- - @pluv/types@0.1.3
1996
-
1997
- ## 0.1.4
1998
-
1999
- ### Patch Changes
2000
-
2001
- - Updated dependencies [95b5ef8]
2002
- - Updated dependencies [e23fbbe]
2003
- - @pluv/io@0.2.3
2004
- - @pluv/types@0.1.2
2005
-
2006
- ## 0.1.3
2007
-
2008
- ### Patch Changes
2009
-
2010
- - fe80d7b: added preview disclaimer about breaking changes in the readme
2011
- - Updated dependencies [fe80d7b]
2012
- - @pluv/io@0.2.2
2013
- - @pluv/types@0.1.2
2014
-
2015
- ## 0.1.2
2016
-
2017
- ### Patch Changes
2018
-
2019
- - Updated dependencies [b45d642]
2020
- - Updated dependencies [203dfee]
2021
- - @pluv/io@0.2.1
2022
-
2023
- ## 0.1.1
2024
-
2025
- ### Patch Changes
2026
-
2027
- - 24016e6: Updated dependencies
2028
- - Updated dependencies [23a7382]
2029
- - Updated dependencies [39271d4]
2030
- - Updated dependencies [24016e6]
2031
- - @pluv/io@0.2.0
2032
- - @pluv/types@0.1.1
2033
-
2034
- ## 0.1.0
2035
-
2036
- ### Minor Changes
2037
-
2038
- - a22f525: Added documentation
2039
-
2040
- ### Patch Changes
2041
-
2042
- - Updated dependencies [a22f525]
2043
- - @pluv/io@0.1.0
2044
- - @pluv/types@0.1.0