cloudflare / cloudflare/partykit
partysub client not implemented (stub with console.error)
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 79
- PR merge metrics
- No merged PRs in 30d
Description
**Package:** `partysub@2.0.2`
The server side (`partysub/server`) works great — `createPubSubServer()` creates a working pub/sub DO with topic filtering. We have passing tests.
The client side (`partysub/client`) is a stub:
```javascript
// node_modules/partysub/dist/client/index.js
console.error("To be implemented");
export { };
```
**Expected:** A client-side API for subscribing to topics and receiving messages, matching the server's `createPubSubServer`. Something like:
```typescript
import { PubSubClient } from 'partysub/client';
const client = new PubSubClient({ host: 'localhost:1999', room: 'my-room' });
client.subscribe('updates', (data) => console.log(data));
client.publish('updates', { text: 'hello' });
```
**Workaround:** We use raw WebSocket with `?topics=` URL params and JSON message parsing. Works but not DX-friendly.
**Context:** Testing all PartyKit packages. Server tests pass, but can't test the official client API because it doesn't exist. See [our pubsub tests](https://github.com/joeblew999/plat-trunk/blob/main/systems/sync/test/partykit/pubsub.test.ts).
Contributor guide
Assessment
This issue has not been assessed yet.