Skip to content

Comments

Declare React as an optional peer dependency of partysocket#340

Merged
threepointone merged 1 commit intomainfrom
fix-292
Feb 22, 2026
Merged

Declare React as an optional peer dependency of partysocket#340
threepointone merged 1 commit intomainfrom
fix-292

Conversation

@threepointone
Copy link
Collaborator

Summary

Fixes #292

  • Declares react as an optional peer dependency (>=17) in partysocket, so strict package managers like pnpm correctly resolve it for the partysocket/react and partysocket/use-ws subpath exports. Marked optional so users who only use the core WebSocket client aren't required to install React.
  • Fixes pre-existing lint errors: replaces any with proper WsWebSocket type in tests, prefixes unused param with _, and adds a biome-ignore for the intentional useMemo dependency pattern in use-socket.ts.

Test plan

  • npm run check passes (sherif, prettier, biome, typecheck, all test suites)
  • Verify in a pnpm monorepo that partysocket/react resolves React correctly

Made with Cursor

Add an explicit, optional React peerDependency for partysocket so strict package managers (e.g. pnpm) correctly resolve react for the partysocket/react and partysocket/use-ws subpath exports. This includes a new changeset and package.json updates. Also: tighten test typings (import and use WsWebSocket instead of any), rename an unused handler param to _lobby to avoid linter noise, and add explanatory comments plus a biome-ignore on the memoized socket options to avoid unnecessary reconnects when callers pass inline option objects.
@changeset-bot
Copy link

changeset-bot bot commented Feb 22, 2026

🦋 Changeset detected

Latest commit: 86b5022

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
partysocket Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 22, 2026

Open in StackBlitz

hono-party

npm i https://pkg.pr.new/cloudflare/partykit/hono-party@340

partyfn

npm i https://pkg.pr.new/cloudflare/partykit/partyfn@340

partyserver

npm i https://pkg.pr.new/cloudflare/partykit/partyserver@340

partysocket

npm i https://pkg.pr.new/cloudflare/partykit/partysocket@340

partysub

npm i https://pkg.pr.new/cloudflare/partykit/partysub@340

partysync

npm i https://pkg.pr.new/cloudflare/partykit/partysync@340

partytracks

npm i https://pkg.pr.new/cloudflare/partykit/partytracks@340

partywhen

npm i https://pkg.pr.new/cloudflare/partykit/partywhen@340

y-partyserver

npm i https://pkg.pr.new/cloudflare/partykit/y-partyserver@340

commit: 86b5022

@threepointone threepointone merged commit 122376f into main Feb 22, 2026
6 checks passed
@threepointone threepointone deleted the fix-292 branch February 22, 2026 19:00
@github-actions github-actions bot mentioned this pull request Feb 22, 2026
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.

Consider declaring React as a peer dep of partysocket

1 participant