You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Using a WebSocket manager, it's getting ignored on SSR and fallback to REST, but my application is WebSocket only.
Describe the solution you'd like
I would like a solution to not provide data from SSR, just disabling REST and provide a Suspense until the client app got the data through the manager.
An other possibility is to allow managers on SSR.
If you use the normal DataProviderimport { DataProvider } from '@data-client/react'; - it will still work with nextjs, and just not do any SSR.
You can then useQuery() in your components with whatever Entity your WebSockets will send. Instead of suspense, you can simply check the return value for being undefined.
constmyData=useQuery(MyEntity,{ id });if(!myData)return'Loading...';// render myData
This does have the downside of not centralizing loading states, and no concurrent transitions. However, usually in cases without REST APIs those things matter less to user experience.
Activity
ntucker commentedon Jul 21, 2025
The easiest way to this now is without suspense.
If you use the normal DataProvider
import { DataProvider } from '@data-client/react';- it will still work with nextjs, and just not do any SSR.You can then useQuery() in your components with whatever Entity your WebSockets will send. Instead of suspense, you can simply check the return value for being undefined.
This does have the downside of not centralizing loading states, and no concurrent transitions. However, usually in cases without REST APIs those things matter less to user experience.
useSuspense() doesn't need REST - Endpoint it works with any promise; but you'd have to wire the promise resolution yourself, as this use case is not known to the library yet. However, if you elaborate on the details a design could be added. If so please add to the discussion around conditional suspense