Skip to content

Version Packages#384

Merged
threepointone merged 1 commit into
mainfrom
changeset-release/main
Apr 24, 2026
Merged

Version Packages#384
threepointone merged 1 commit into
mainfrom
changeset-release/main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

partyserver@0.5.2

Patch Changes

  • #383 fe030f6 Thanks @threepointone! - setName() is now the sanctioned bootstrap API for non-idFromName DOs.

    When ctx.id.name is undefined (e.g. Cloudflare Agents facets, which are spawned via ctx.facets.get(...) rather than idFromName()), setName(name) now persists the name to the legacy __ps_name storage key in addition to stashing it in memory. This means cold-wake invocations of the DO recover the name through #ensureInitialized()'s legacy storage fallback without the framework having to reach into PartyServer's private storage layout.

    Frameworks that previously did:

    await this.ctx.storage.put("__ps_name", name);
    await this.__unsafe_ensureInitialized();

    can now do:

    await this.setName(name);

    Backward compatible:

    • 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.
    • The pre-existing direct-storage-write pattern keeps working — the storage write becomes idempotent with what setName() would do.

    setName()'s @deprecated docblock has been clarified: it remains the supported API for framework-level bootstrap of non-idFromName DOs and for delivering initial props to onStart(). The deprecation only applies to redundant calls on DOs that were addressed via idFromName().

@threepointone threepointone merged commit 2684ca8 into main Apr 24, 2026
3 checks passed
@threepointone threepointone deleted the changeset-release/main branch April 24, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant