@pluv/platform-cloudflare 5.0.0 → 5.0.2

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