Appearance
Migration
No breaking migration is required for the current documented pairing.
If you are upgrading to the latest public docs baseline, use:
react-socket-store@0.0.5socket-store@^0.0.3
Existing consumers on react-socket-store@0.0.4 can stay on socket-store@^0.0.2 until they are ready to move both packages together.
Use public package entrypoints when moving code onto the stabilized adapter:
- Import React helpers from
react-socket-store. - Import core store helpers from
socket-store. - Do not import from generated
socket-store/dist/*paths. - Replace legacy or draft
createSocketStore(...)examples with directnew SocketStore(...)construction. - Pass an existing store directly to
useSocket,useListen, oruseSendwhen only one focused React subtree needs realtime state. - Use
SocketProvideras a scoped context convenience for SPA subtrees that share one store; do not widen server-rendered or data-loader boundaries only to provide socket state.
Keep React adapter docs focused on provider setup, hook behavior, render timing, subscription cleanup, and schema-safe hook usage. Link to socket-store for core WebSocket topic-store behavior.
Current Notes
The current docs clarify existing package boundaries rather than changing the runtime contract:
socket-storeremains responsible for WebSocket topic-store behavior, message handler validation, state snapshots, sending, subscriptions, and connection lifecycle callbacks.react-socket-storeremains responsible for React context wiring, store-direct hooks, schema-safe hook types, and subscription cleanup throughuseSyncExternalStore.- The latest adapter pairing uses
socket-store@^0.0.3. - Local adapter contract types remain in
react-socket-storeuntil a futuresocket-storenpm release exposes the stronger adapter-facing type surface.
See Compatibility for the package responsibility split, current version pairing, and supported package combinations.