unstale

npm / partysocket

partysocket

What changed in partysocket 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-15.

2 breaking1 deprecations5 new APIs and options3 behavior and defaults9 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.3.1 on npm

partysocket 120 changes

Breaking changes 2

  • close() dispatches its close event synchronously, and readyState reports CLOSED immediately after close() returns.

    1.2.0release notes

  • Narrows the exported type from ArrayBufferView to ArrayBufferView<ArrayBuffer> to match DOM WebSocket.send() overloads; runtime behavior is unchanged.

    1.1.18release notes

Deprecations 1

  • Calling send() after close() emits a warning once per close cycle; the message remains buffered for backwards compatibility, and the warning resets on reconnect().

    1.2.0release notes

New APIs and options 5

  • Adds an option that lets callers stop automatic reconnects for terminal close events while preserving reconnect-by-default behavior.

    1.3.0release notes

  • Adds a method that removes and returns messages buffered by send() but never transmitted, allowing a discarded socket's unsent buffer to be handed to a replacement.

    1.2.0release notes

  • Overrides buffered-message transfer behavior: true always transfers messages and false never transfers them.

    1.2.0release notes

  • Adds an enabled prop for conditional connection control.

    1.1.11release notes

  • Adds an enabled prop for conditional connection control.

    1.1.11release notes

Behavior and default changes 3

  • send() returns true when transmitted immediately and false when buffered or dropped because maxEnqueuedMessages was reached.

    1.2.0release notes

  • When replacing a socket because connection options changed, hooks migrate buffered messages by default only if the destination is unchanged; messages for changed destinations are discarded with a warning.

    1.2.0release notes

  • PartySocket is released as v1 after being described as pretty stable.

    1.0.0release notes

Fixes and other changes 9

  • Fixes the module-scope random default.

    1.1.19release notes

  • The protocols type now accepts ProtocolsProvider instead of string[], matching the full range of types supported by the underlying ReconnectingWebSocket.

    1.1.17release notes

  • Declared react as an optional peer dependency so strict package managers like pnpm correctly resolve it for the partysocket/react and partysocket/use-ws subpath exports.

    1.1.15release notes

  • On HMR or StrictMode effect re-runs, unchanged connection options now call socket.reconnect() to preserve socket identity; changed options still create a new socket.

    1.1.14release notes

  • Fixes reconnect() after maxRetries has been exhausted by releasing _connectLock when the max retries early return is hit.

    1.1.13release notes

  • Construction without room or basePath now throws a clear error unless startClosed: true, rather than connecting to a malformed URL.

    1.1.12release notes

  • PartySocket.reconnect() now accepts basePath without room as sufficient context to construct a connection URL.

    1.1.12release notes

  • Fixes a React Native/Expo TypeError by detecting those environments and using Node-style event cloning.

    1.1.11release notes

  • Fixes invalid package exports, so developers can use the package's exports correctly.

    1.1.10release notes