Open TommySorensen opened 6 months ago
Hmmm will have to take a closer look to see what is happening there.
But do you want to batch requests on the server when streaming since you want low time to first byte? Meaning you want suspense wrapped components to stream in as soon as the request is done, but with batching you would get some overhead. Im not entirely sure thats a good fit for this library.
It seems like that when using the Tanstack Query hook
useSuspenseQuery
it only fetches on client side and streaming actually never happens. Would it not be possible to make an option in Batshit to use thecache
(https://react.dev/reference/react/cache) in React instead of thewindowMs
so you know on serverside what need to be batched? An example of streaming with Tanstack Query would be https://tanstack.com/query/latest/docs/framework/react/examples/nextjs-suspense-streaming