Replies: 3 comments
-
Hey @pkellner – I don't think if we can get a detailed timeline about this as we (Next/SWR/React) need to join forces here. My guess is that we need the
Re-reading this sentence from the React 18 blog post – I'm not sure if it means that it will never be recommended, or there will be an official way to support that strategy better in the future. |
Beta Was this translation helpful? Give feedback.
-
I'm not sure what the Suspense Future would be. But I guess this includes two topics. The first one is Another is how ad-hoc data libraries, including SWR, encourage the Render As You Fetch pattern. Currently, many developers use the libraries as the Fetch on Render pattern. If they switch to Suspense mode, their applications will cause worse use experiences due to a waterfall problem. Technically, we can avoid this by pre-fetching before rendering. But this is not an intuitive way with the current APIs. I think this is a framework area because it can handle pages and routing and preload asynchronous dependencies before rendering a page. I guess that's the reason the React team recommends using Suspense for Data Fetching with frameworks. I don't think SWR should handle these responsibilities but should provide APIs or guides on how to use Suspense with better user experiences. |
Beta Was this translation helpful? Give feedback.
-
I'm also wondering if this improvement is in the roadmap of SWR. And also wondering if it's possible for SWR to solve the waterfall issue without requiring preload. |
Beta Was this translation helpful? Give feedback.
-
I posted this in the NextJS discussion and it got no responses so I'm referencing from here. I can't find a discussion of how/when Suspense and Next/SWR will be production ready.
vercel/next.js#36459 (comment)
Beta Was this translation helpful? Give feedback.
All reactions