Skip to content

Commit ec0c93d

Browse files
committed
Bump partyserver to v0.5.4
Update partyserver dependency from ^0.5.3 to ^0.5.4 across the monorepo and refresh package-lock.json. Affected package.json files: packages/hono-party, packages/partysub, packages/partysync, packages/partywhen, packages/y-partyserver. No other functional changes.
1 parent 9a927a3 commit ec0c93d

7 files changed

Lines changed: 10 additions & 17 deletions

File tree

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/hono-party/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
"devDependencies": {
3838
"@cloudflare/workers-types": "^4.20260424.1",
3939
"hono": "^4.12.15",
40-
"partyserver": "^0.5.3"
40+
"partyserver": "^0.5.4"
4141
}
4242
}

packages/partyserver/CHANGELOG.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
The fix is at the call site, not in PartyServer: pass `id: someBoundDONamespace.idFromName(facetName)` to `ctx.facets.get(...)`. The facet then gets its own native `ctx.id.name === facetName` and PartyServer's `name` getter does the right thing automatically. No `setName()` is required, no `__ps_name` storage record is written, and cold-wake recovery happens for free because the factory re-runs and `idFromName` is deterministic.
2020

2121
This release adds:
22-
2322
- **A "Using PartyServer with Durable Object Facets" section in the README** that walks through the recommended pattern with a code example, calls out the implicit-id footgun explicitly, and documents that plain-string `id` values are not a substitute for `idFromName(facetName)` (workerd treats string ids as `idFromString`-like, so the resulting facet has no `ctx.id.name`).
2423
- **`setName()` docstring updated** to clarify that facets are NOT a `setName()` use case — point to the explicit-`id` pattern instead. The original `setName()` `ctx.id.name` mismatch throw is preserved as a typo guard for the `idFromName` happy path.
2524
- **End-to-end facet test coverage** against the real workerd `ctx.facets.get(...)` API. A `FacetParent` / `FacetChild` fixture exercises both the implicit-id path (pinning the runtime contract that `this.name` returns the parent's name in that flow — i.e., behavior-as-documentation so framework authors are unsurprised) and the explicit-id path (recommended; verifies that all reasonable id-construction strategies work and that cold wake recovers without any storage record). Plain-string `id` is also tested; the test asserts it does NOT carry a name, pinning the contract so callers don't get tempted by the type signature.
@@ -48,7 +47,6 @@
4847
```
4948

5049
Backward compatible:
51-
5250
- For DOs addressed via `idFromName()` / `getByName()` (the happy path), `setName()` continues to NOT write storage — `ctx.id.name` is the source of truth and `setName()` is just a no-op-plus-onStart.
5351
- The pre-existing direct-storage-write pattern keeps working — the storage write becomes idempotent with what `setName()` would do.
5452

@@ -63,7 +61,6 @@
6361
0.5.0 moved the legacy storage hydrate into `alarm()` only, breaking Cloudflare Agents facets and any other framework that writes `__ps_name` directly before calling `__unsafe_ensureInitialized()`. Facet DOs are spawned via `ctx.facets.get(...)` rather than `idFromName()` and therefore have `ctx.id.name === undefined`; they relied on PartyServer reading the storage record back to populate `this.name` before `onStart()`.
6462

6563
Changes:
66-
6764
- Move the legacy `__ps_name` hydrate from `alarm()` into `#ensureInitialized()`, still gated on `!ctx.id.name && !#_name` so it costs nothing on the happy path (normal `idFromName()`/`getByName()` DOs skip the storage read entirely).
6865
- `Server.fetch()` now delegates to `#ensureInitialized()` for the hydrate instead of doing its own. The `x-partykit-room` header fallback remains as a last resort when neither `ctx.id.name` nor a legacy storage record is available.
6966
- `Server.alarm()` is simplified — it no longer needs its own hydrate call since `#ensureInitialized()` handles it.
@@ -78,7 +75,6 @@
7875
Durable Objects now expose `ctx.id.name` on every entry point (constructor, fetch, alarm, hibernating websocket handlers) when the DO is addressed via `idFromName()`/`getByName()`. PartyServer now uses this as the primary source of `this.name`, which simplifies routing, eliminates storage writes, and makes `this.name` available inside the constructor.
7976

8077
Changes in `partyserver`:
81-
8278
- `this.name` resolves from `this.ctx.id.name`. The apologetic `workerd#2240` error message is gone.
8379
- `this.name` is now available **inside the constructor** and from class field initializers, not just after `setName()`/`fetch()` has run.
8480
- `routePartykitRequest` no longer issues a `setName()`/`_initAndFetch()` RPC before `fetch()`. The WebSocket path goes from 2 RPCs to 1; the HTTP path remains 1 RPC. Props, when supplied, are delivered to the DO via the `x-partykit-props` request header, set after `onBeforeConnect`/`onBeforeRequest` hooks run.
@@ -90,7 +86,6 @@
9086
- When reading `this.name` throws, it is because `ctx.id.name` is undefined and no legacy fallback has populated the name: the DO was addressed via `idFromString()` or `newUniqueId()` (both unsupported), the runtime is too old to expose `ctx.id.name`, or a pre-2026-03-15 alarm fired before the legacy storage fallback ran.
9187

9288
Changes in all affected packages (`partyserver`, `partysub`, `partysync`, `y-partyserver`, `hono-party`):
93-
9489
- `@cloudflare/workers-types` peer dependency bumped from `^4.20240729.0` to `^4.20260424.1`. The old range predates `ctx.id.name` in the type surface.
9590

9691
Not supported: addressing PartyServer DOs via `idFromString()` or `newUniqueId()`. These paths return `ctx.id.name === undefined` inside the DO and will surface as a clear error from `this.name`. PartyServer has always assumed name-based addressing via `getServerByName` / `routePartykitRequest`; this release makes that assumption explicit.
@@ -411,14 +406,12 @@
411406
### Patch Changes
412407

413408
- [`528adea`](https://github.com/threepointone/partyserver/commit/528adeaced6dce6e888d2f54cc75c3569bf2c277) Thanks [@threepointone](https://github.com/threepointone)! - some fixes and tweaks
414-
415409
- getServerByName was throwing on all requests
416410
- `Env` is now an optional arg when defining `Server`
417411
- `y-partyserver/provider` can now take an optional `prefix` arg to use a custom url to connect
418412
- `routePartyKitRequest`/`getServerByName` now accepts `jurisdiction`
419413

420414
bonus:
421-
422415
- added a bunch of fixtures
423416
- added stubs for docs
424417

packages/partysub/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
},
4747
"devDependencies": {
4848
"@cloudflare/workers-types": "^4.20260424.1",
49-
"partyserver": "^0.5.3",
49+
"partyserver": "^0.5.4",
5050
"partysocket": "^1.1.18"
5151
}
5252
}

packages/partysync/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"devDependencies": {
5252
"@cloudflare/workers-types": "^4.20260424.1",
5353
"partyfn": "^0.1.0",
54-
"partyserver": "^0.5.3",
54+
"partyserver": "^0.5.4",
5555
"partysocket": "^1.1.18"
5656
},
5757
"peerDependencies": {

packages/partywhen/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
"description": "A library for scheduling and running tasks in Cloudflare Workers",
3030
"dependencies": {
3131
"cron-parser": "^5.5.0",
32-
"partyserver": "^0.5.3"
32+
"partyserver": "^0.5.4"
3333
}
3434
}

packages/y-partyserver/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"@cloudflare/workers-types": "^4.20260424.1",
6666
"@types/lodash.debounce": "^4.0.9",
6767
"@types/node": "25.6.0",
68-
"partyserver": "^0.5.3",
68+
"partyserver": "^0.5.4",
6969
"ws": "^8.20.0",
7070
"yjs": "^13.6.30"
7171
},

0 commit comments

Comments
 (0)