BREAKING CHANGE(smartsocket): Replace setExternalServer with hooks-based SmartServe integration and refactor SocketServer to support standalone and hooks modes

This commit is contained in:
2025-12-03 09:22:44 +00:00
parent 1d62c9c695
commit 09dbb00179
7 changed files with 161 additions and 175 deletions

View File

@@ -1,5 +1,14 @@
# Changelog
## 2025-12-03 - 3.0.0 - BREAKING CHANGE(smartsocket)
Replace setExternalServer with hooks-based SmartServe integration and refactor SocketServer to support standalone and hooks modes
- Remove setExternalServer API and add getSmartserveWebSocketHooks on Smartsocket to provide SmartServe-compatible websocket hooks.
- SocketServer.start now becomes a no-op when no port is provided (hooks mode). When a port is set, it starts a standalone HTTP + ws server as before.
- Introduce an adapter (createWsLikeFromPeer) to adapt SmartServe peers to a WebSocket-like interface and route onMessage/onClose/onError via the adapter.
- Dispatch smartserve messages through the adapter: text/binary handling for onMessage, and dispatchClose/dispatchError for close/error events.
- Update tests: add smartserve integration test (test.smartserve.ts), adjust tagging test cleanup to stop client and delay before exit, remove outdated expressserver test.
## 2025-03-10 - 2.1.0 - feat(SmartsocketClient)
Improve client reconnection logic with exponential backoff and jitter; update socket.io and @types/node dependencies