Summary
In this chapter, you learned that Remix supports different data-fetching strategies. Deferring loader data can be utilized to resolve performance bottlenecks in your Remix apps when fetching from slow endpoints. Remix’s defer
function detects unresolved promises in the loader data and streams them to the client once resolved. React Suspense
and Remix’s Await
component are used to manage the deferred loader data in React.
You also learned that using defer
requires fallback UIs to communicate loading states. You now understand that using defer
comes with trade-offs that impact the user experience. On one hand, deferring loader data can speed up the initial document request. On the other hand, using defer
creates loading UIs, which results in a different user experience.
After reading this chapter, you know that Remix uses React streaming to speed up document requests. However, React and HTTP streaming are not supported on all server runtimes and environments...