Repository navigation
Description
We need maintainers for wsLink
Help us in revamping tRPC's WebSocket support!
Since we introduced subscriptions using httpSubscriptionLink, the core team no longer relies on wsLink as we handle subscriptions over HTTP. Consequently, we've decided to deprecate wsLink and invite the community to take over its maintenance. 🙏
The current implementation is located here. As you might notice, it's not well-written; each modification has added complexity, and it urgently needs a rewrite.
We recognize the value of having tRPC support for WebSockets and would love to see it actively maintained by passionate developers like you. 🌟 We'll happily guide you around the codebase to get you started!
What we'd like to see
We want a revamped version of wsLink and createWSClient that supports the existing features:
- ⏳ Lazily closing/opening connections when needed.
- 🔄 Resumes subscriptions if the server stops.
- 🔁 Gracefully switches connections to a new one if the server notifies it's about to close.
- 🚀 Restarts with backoff when it fails.
- ⚡ Supports queries, subscriptions, and mutations.
- 🔍 Supports introspection of the current connection status of the active socket.
- 🏓 Ping/Pong support to detect and close inactive connections.
Additionally, we'd want it to:
- ✍️ Be well-written.
- ✅ Be thoroughly tested. Existing tests should pass any implementation.
- 📚 Include comprehensive documentation.
- 🪝 Have a React-hook for introspecting the connection state - e.g.
useConnectionState(wsClient)
Alternatives we've considered
- We're also considering financial funding as an option. We estimate that investing a few thousand dollars would enable us to dedicate the necessary time to rewrite it. 💰
- If we don't find maintainers, we'll likely delete the
wsLinkin v12 of tRPC. 🗑️
If you're interested in contributing or taking over the maintenance of wsLink, please reach out! Your contributions can make a significant impact on the tRPC community. 🙌
Activity
github-actions commentedon Feb 19, 2025
This issue has been locked because we are very unlikely to see comments on closed issues. If you are running into a similar issue, please create a new issue. Thank you.