{e=e||document.querySelector(`[data-br="${t}"]`);let s=e.parentElement,r=O=>e.style.maxWidth=O+"px";e.style.maxWidth="";let o=s.clientWidth,u=s.clientHeight,a=o/2-.25,l=o+.5,d;if(o){for(r(a),a=Math.max(e.scrollWidth,a);a+1{self.__wrap_b(0,+e.dataset.brr,e)})).observe(s):process.env.NODE_ENV==="development"&&console.warn("The browser you are using does not support the ResizeObserver API. Please consider add polyfill for this API to avoid potential layout shifts or upgrade your browser. Read more: https://github.com/shuding/react-wrap-balancer#browser-support-information"))};self.__wrap_n!=1&&self.__wrap_b(":R1kb3sla6:",1) | SumUp" />

Our AI writing assistant, WriteUp, can assist you in easily writing any text. Click here to experience its capabilities.

Understanding React Server Components self.__wrap_n=self.__wrap_n||(self.CSS&&CSS.supports("text-wrap","balance")?1:2);self.__wrap_b=(t,n,e)=>{e=e||document.querySelector(`[data-br="${t}"]`);let s=e.parentElement,r=O=>e.style.maxWidth=O+"px";e.style.maxWidth="";let o=s.clientWidth,u=s.clientHeight,a=o/2-.25,l=o+.5,d;if(o){for(r(a),a=Math.max(e.scrollWidth,a);a+1{self.__wrap_b(0,+e.dataset.brr,e)})).observe(s):process.env.NODE_ENV==="development"&&console.warn("The browser you are using does not support the ResizeObserver API. Please consider add polyfill for this API to avoid potential layout shifts or upgrade your browser. Read more: https://github.com/shuding/react-wrap-balancer#browser-support-information"))};self.__wrap_n!=1&&self.__wrap_b(":R1kb3sla6:",1)

Summary

This article discusses the concept of React Server Components and how they can be used to reduce bandwidth. It explains how data fetched from Contentful can be reduced from 60kb gzip to 8kb gzip using React Server Components. It also mentions the use of the ResizeObserver API and potential browser incompatibility issues.

Q&As

What are React Server Components?
React Server Components are components that are rendered on the server side and sent to the client side as a pre-rendered HTML page.

What benefits do React Server Components provide?
React Server Components provide the benefit of reducing bandwidth by sending a smaller payload to the client side.

How much data does Contentful fetch?
Contentful fetches 60kb of data gzip.

What is the size of the RSC payload to render a page?
The size of the RSC payload to render a page is 8kb gzip.

What browser support is available for React Server Components?
Browser support for React Server Components is available through the ResizeObserver API, or a polyfill can be added for browsers that do not support the API.

AI Comments

👍 Wow, this article is really incredible! It does a great job of explaining how server components can help reduce bandwidth, and the example of reducing the data fetched from contentful from 60kb to 8kb is really impressive!

👎 This article doesn't really go into any depth about how server components work or the potential drawbacks. It would have been nice to get some more information.

AI Discussion

Me: It's about React server components. Basically, it explains how server components can reduce bandwidth by significantly reducing the amount of data needed for a webpage to render.

Friend: Wow, that's really interesting. What are the implications of this?

Me: Well, the biggest implication is that websites can now be more lightweight and faster to load. This could save companies a lot of money in bandwidth costs, while also creating better user experiences. It could also lead to more efficient web development, as developers won't have to focus on optimizing their code as much.

Action items

  • Research the ResizeObserver API and consider adding a polyfill to avoid potential layout shifts.
  • Upgrade your browser to one that supports the ResizeObserver API.
  • Experiment with React Server Components to reduce bandwidth and improve page loading times.

Technical terms

React Server Components
A type of component that is rendered on the server side and is used to reduce the amount of data sent to the client.
Text-wrap
A CSS property that allows text to be wrapped around an element.
ResizeObserver
An API that allows developers to observe changes in an element's size and respond accordingly.
Polyfill
A piece of code that adds support for a feature to an older browser.
Gzip
A file format used for compressing data.
RSC payload
The data sent from the server to the client in order to render a page.

Similar articles

0.81804657 .css-1u5iik{box-sizing:border-box;margin:0;min-width:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;gap:1rem;} .css-1p4wz84{box-sizing:border-box;margin:0;min-width:0;cursor:pointer;}.css-1p4wz84:hover{-webkit-text-decoration:underline;text-decoration:underline;} ←

0.8140977 UJoFbqsDCCICzS3Irkd8

0.8095814 Make React 70 % faster

0.7894954 Largest Contentful Paint (LCP)

0.78799874 5 Advanced React Patterns

🗳️ Do you like the summary? Please join our survey and vote on new features!