Concepts
Development
Hotpipe is designed to be safe in development environments with hot module replacement (HMR). You don't need to configure anything — it's automatic.
Frameworks like Next.js re-evaluate modules and remount components on every file save, which can cause real-time libraries to leak connections — burning through connection limits over the course of a long dev session.
Hotpipe prevents connection leaks with multiple layers of protection:
- Connection reuse — the underlying WebSocket connection is created once and reused across component remounts. Hot reloads don't create new connections.
- Ref-counted providers —
PipeProvidertracks mount/unmount cycles and uses a delayed disconnect so that rapid HMR teardown/rebuild cycles are absorbed without touching the connection at all. - Duplicate provider warnings — if you accidentally mount multiple
PipeProviderinstances in your component tree, Hotpipe logs a warning in development so you can fix it before it becomes a problem in production.

