→תכונה RSC (React Server Components) SSR (Server-Side Rendering) CSR (Client-Side Rendering) Render location Server Server Client JavaScript נשלח לדפדפן ❌ אין ✅ כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן תכונה RSC (React Server Components) SSR (Server-Side Rendering) CSR (Client-Side Rendering) Render location Server Server Client JavaScript נשלח לדפדפן ❌ אין ✅ כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן כן Feature → →CSR (Customer-Side Rendering) – שיווק לצד הלקוח→ → → מציג מיקום →מציג מיקום →אף אחד → לא→ → → →לא המלאה→המלאה → המלאה המלאה →גישה למשאבי השרת→ישירות→✅ דרך getServerSideProps→→ גישה למשאבי השרת ישירות → כאשר הוא פועל On-demand או זורם על-ידי בקשה On load ב-browser→ → על פי בקשה → → →→ → → →→ → → →תכונה Server Component Client Component useState ❌ ✅ useהשפעה ❌ ✅ שימושקשר ✅ (אם סטטי) ✅ async/await ✅ ❌ (היא צריכה להיות מכוסה באפקטים) מנהלי אירועים ❌ ✅ משתמשים→ →→ → async/await ✅ (הצריך לסובב אפקטים) → → → → →משתמשים→ משתמשים → →→ → → →→ → → → →מנהלי האירועים→ →→→ מרכיב סיבה→ פרטים על מוצר→ →נלקח מ- DB, אין אינטראקטיביות, אין צורך לחות PriceWithPersonalization SSR תלוי בפגישה של המשתמש, דינמי לפי בקשה CSR→→ →מוצרים קשורים → → StockStatusBanner RSC + streaming משתנה לעתים קרובות, זורם עם Suspense כדי לא לחסום TTFB →מרכיב סיבה→מרכיב → פרטים על מוצר→ →נלקח מ- DB, אין אינטראקטיביות, אין צורך לחות פרטים על מוצר נלקח מ- DB, אין אינטראקטיביות, אין צורך לחות →→ SSR → SSR CSR→→ → →מוצרים קשורים → מאובטח לעיכוב בזמן בניית, ניתן לאמת מחדש כל 24 שעות או על ידי תגית מוצרים קשורים → → StockStatusBanner RSC + streaming משתנה לעתים קרובות, זורם עם Suspense כדי לא לחסום TTFB→ → (*אם ברצונך לקפוץ קדימה ולרדת ישירות לתוך ההפרעה הטכנית, קפוץ ל- Why React Server Components Was Introduced.) בתחילת שנות ה- 2010, React מהפכה את פיתוח החזית עם מודל הרכיבים הצהיר שלה ויעיל וירטואלי DOM diffing. מה שהתחיל כמו ספריית תצוגה פשוטה הפך במהרה את הגזע של יישומי דף אחד בקנה מידה גדול (SPAs). SPAs אלה השתמשו בעיקר Client-Side Rendering (CSR), כלומר הדפדפן יהיה להוריד חבילת JavaScript, להפעיל אותו, ולבנות את UI לחלוטין על הלקוח. מודל ממוקד לקוח זה היה גמיש ואינטראקטיבי מאוד, והוא הגדיר יישומים אינטרנט "מודרניים" במשך שנים. → → → Hefty JavaScript bundles and client-side work meant users waited longer before they could actually interact with the page. Longer Time-to-Interactive (TTI): הפחתת הבקבוקים של הידראציה: ההמרה של HTML המופעל על-ידי השרת לאפליקציה אינטראקטיבית (הידראציה) הפכה לנקודה מפחידה ביצועים, במיוחד כאשר כמות התוכן הדינמי גדלה. Applications often shipped far more JavaScript than necessary, burdening browsers with code for features or content that could have been delivered more efficiently. Bloated bundles: The larger and more complex the app, the harder it became to maintain snappy performance across all devices and network conditions. Performance that doesn’t scale: Next.js emerged to tackle some of these pain points by introducing Server-Side Rendering (SSR), Static Site Generation (SSG), and other optimizations. These techniques improved initial load times and offloaded some of the UI rendering work to the server. But even with SSR and SSG, the fundamental issue remained: we were still over-delivering JavaScript to the browser. עם Next.js 15 פועל על React 19, פרדיגמה חדשה של rendering לקח את הבמה המרכזית: RSCs מאפשרים למפתחים לשלב בקלות את הרכיבים שפורסמו על-ידי השרת והלקוח בעץ React יחיד.ההשלכות הן משמעותיות. במילים אחרות, אין צורך בהידראזציה בצד הלקוח עבור חלקים אלה.לוגיקה של איסוף נתונים פשוטה גם על ידי הפעלת רכיבים בתוך השרת, הסרת שיחות API רבות מיותרות מהדפדפן.התוצאה: חבילות בצד הלקוח רזה יותר, אינטראקציות מהירות יותר, ויישום שהוא הרבה יותר ביצועי וגדול. React Server Components (RSC) zero JavaScript overhead מאמר זה אינו סקירה ברמת פני השטח של RSC. כשהתחלתי לכתוב על שימוש אפקטיבי ב- Next.js בשנת 2025, היה ברור במהירות כי React Server Components ראוי לטיול עמוק מיוחד. בסופו של דבר, אני מקווה שאתם מגיעים עם אותה בהירות והערכה עבור RSC כפי שעשיתי בתהליך של מחקר וכתבה של עבודה זו. Intro: From CSR to RSC — How Rendering Evolved in React Intro: From CSR to RSC – How Rendering Evolved in React – מ- CSR ל- RSC – כיצד התפתחה ההפקה בתגובה במהלך העשור האחרון, האופן שבו אנו בונים יישומים של React התפתח באופן יסודי, ועם זה, האופן שבו אנו חושבים על rendering. היסטוריה קצרה של Client-Side Rendering (CSR) ב React הפופולריות זכתה להצלחה באמצעות מודל שבו הדפדפן מוריד את JavaScript, מבצע אותו ומבנה את כל ה- UI על הלקוח.הגישה הזו נתנה למפתחים שליטה מלאה על האינטראקטיביות והמצב, והפכה את הבנייה של יישומים דינמיים בדף אחד (SPAs) לקלה. Client-Side Rendering (CSR) עם זאת, ה- CSR הגיע עם פשרות מעניינות: → → → → → טעינה ראשונית איטית יותר, במיוחד ברשתות ניידות או חלשות for content-driven pages Poor SEO חבילות כבדות ב-JavaScript – גם עבור דפים עם אינטראקטיביות מינימלית צעד הידראציה נדרש לאחר טעינת HTML, מעכב את הזמן לאינטראקטיביות For a while, these limitations were just “how things were.” Then Next.js changed the game. כיצד Next.js הביא SSR ו-SSG לפיתוח React מתי לאחר שהצטרף לסצינה, הוא הציג rendering server-side (SSR) ו static site generation (SSG) כאזרחים ברמה הראשונה עבור React. Next.js enabled pages to be generated per request, improving SEO and load speed for dynamic content. SSR SSG מאפשרת לתוכן להיווצר מראש בזמן הפצה, מושלם עבור בלוגים, מסמכים, ואתרי שיווק. bridged the gap by allowing static pages to be updated post-deploy. Incremental Static Regeneration (ISR) גמישות זו סייעה למפתחים להשיג איזון טוב יותר בין ביצועים, SEO וניסיון של מפתחים. But even with SSR and SSG, there was still a lingering issue: - גם עבור רכיבים שלא היו צריכים להיות אינטראקטיביים. we were still sending too much JavaScript to the browser הגדלת רכיבי ה- React Server (RSC) עד 2025 With the release of ו אנחנו נכנסים לתקופה חדשה: הם חלק מרכזי של איך אנו יוצרים אפליקציות. Next.js 15 React 19 React Server Components (RSC) בניגוד ל-SSR, אשר עדיין דורש הידראזציה ומשלח JavaScript ללקוח, . RSC allows you to render components on the server — without sending any JavaScript to the browser at all זהו שינוי גדול: → → → Components can now access server-side data directly תוכן סטטי אינו דורש הידראציה אתה יכול לערבב את מרכיבי השרת והלקוח בעץ React אחד, להכין את אסטרטגיית ההפקה שלך לכל מרכיב RSC אינו מחליף SSR או SSG. פתיחת שליטה מעולה על הביצועים, גודל החבילה והתנהגות ההפקה. complements them In 2025, RSC is a foundational concept that every senior React engineer needs to master. 1. Why React Server Components Were Introduced 1. Why React Server Components Were Introduced As React applications became more complex, the industry began to feel the weight of its success. While Client-Side Rendering (CSR), Server-Side Rendering (SSR), and Static Site Generation (SSG) offered different strategies for building performant web apps, each of them carried trade-offs that grew more apparent at scale. הגבלות של CSR, SSR ו- SSG 1 Hydration overhead גם עם SSR או SSG, ברגע שה-HTML מגיע לדפדפן, React צריך "להיטות" את הדף - לחבר את האזינים לאירועים, להתחיל מחדש רכיבים, ולבנות מחדש את האפליקציה באופן יעיל בזיכרון. 2. JavaScript bundle bloat With CSR, every component, utility, and API call that’s part of the page must be sent to the browser — regardless of whether it’s interactive or not. SSR and SSG reduce this slightly, but most of the bundle still needs to be executed on the client. As apps grow, this leads to bloated bundles that slow down the user experience. 3. Disconnected data-fetching logic In the pre-RSC world, data lived outside the components that rendered it. You had to use or (or call APIs in ) to fetch data, then pass it into components via props. This separation added cognitive overhead and made code harder to co-locate and reuse. getServerSideProps getStaticProps useEffect אילו בעיות RSC נועד לפתור React Server Components (RSC) were created to address these growing pain points with a simple but powerful idea: → let components execute on the server by default, and only send JavaScript to the browser when it’s absolutely necessary Eliminate unnecessary JavaScript RSC allows components to be rendered server-side אם רכיב אינו דורש אינטראקטיביות, אין צורך לחות או לטעון את חבילת JS שלו בכלל. without Server-side data access within the component tree RSC מסיר את הגבול המלאכותי בין איסוף נתונים לבין rendering. to directly access databases, file systems, or APIs — co-locating data and view logic naturally, with no need for API routes or prop drilling. async/await Improve rendering efficiency and developer experience By moving non-interactive logic to the server, developers can build lighter apps with smaller bundles and better performance. RSC also simplifies the mental model — you just write components, and let the framework handle where they run and how they ship. RSC doesn’t aim to replace SSR or SSG, instead, it complements them. It lets you think , not just the page level, about what should run on the server and what belongs in the browser. at the component level In short: React Server Components were designed to bring modern frontend development back to its lean, fast, and maintainable roots without compromising interactivity. 2. Rendering Strategies in Next.js 15: RSC vs SSR vs CSR 2. Rendering Strategies in Next.js 15: RSC vs SSR vs CSR Next.js 15 offers developers a granular rendering model that goes far beyond traditional page-level strategies. With כדי להפוך למושג ברמה הראשונה, חשוב להבין כיצד הם משווים לשני מודלים מוכרים: and . React Server Components (RSC) Server-Side Rendering (SSR) Client-Side Rendering (CSR) בעוד SSG (Static Site Generation) הוא עדיין בעל ערך במקרים ספציפיים, זה יכול להיחשב הוא נבנה על גבי ה-SSR. represent distinct runtime rendering paths, and understanding them is crucial for making performance- and architecture-aware decisions in 2025. caching strategy RSC vs SSR vs CSR 💡 Before We Compare: What Do We Mean by "Interactive Component"? בהקשר של React ו Next.js, is any UI element that → interactive component requires client-side JavaScript to respond to user input or browser events This includes (but is not limited to): → → → → כפתורים שמעדכנים מצב על-ידי לחיצה טפסים עם אימות או כניסות נשלטות Dropdowns and modals that toggle open/closed Animations triggered by scrolling or hover Tabs, carousels, filters, sliders Components that use , , or useState useEffect useReducer If a component has , internal , or relies on the זה חייב ללכת על הלקוח. event handlers state DOM or browser APIs Interactivity = Browser-side behavior + JS event listeners + local state. Understanding this distinction helps clarify : to avoid shipping JavaScript for UI pieces that don’t need to be interactive. why RSC exists 🧩 Rendering Models at a Glance RSC (React Server Components) SSR - Server Side Rendering (הפצה מצד השרת) Feature Feature RSC (React Server Components) RSC (React Server Components) SSR - Server Side Rendering (הפצה מצד השרת) SSR - Server Side Rendering (הפצה מצד השרת) CSR (Client-Side Rendering) CSR (Client-Side Rendering) Server שרת Client Render location Server שרת שרת Server Client Client JavaScript נשלח ל-Browser ✅ Yes ✅ Yes JavaScript נשלח ל-Browser JavaScript נשלח ל-Browser ❌ None ❌ None ✅ Yes ✅ Yes כן כן ✅ Yes Requires hydration ✅ Yes כן כן Requires hydration Requires hydration לא ❌ No ✅ Yes ✅ Yes כן כן כן כן אינטראקטיביות אינטראקטיביות אינטראקטיביות ❌ No ❌ No המלאה ✅ Full ❌ Needs API calls גישה למשאבי השרת ✅ Direct ✅ דרך getServerSideProps ✅ דרך getServerSideProps ❌ Needs API calls ❌ Needs API calls כאשר הוא רץ When it runs On Demand או Streamed On Demand או Streamed על פי בקשה להורדה ב- Browser On load in browser Ideal use case תצוגות סטטיות או קשורות נתונים UI אישי או דינמי תנועות אינטראקטיביות, UX מקומי Ideal use case Ideal use case תצוגות סטטיות או קשורות נתונים תצוגות סטטיות או קשורות נתונים UI אישי או דינמי Personalized or dynamic UI תנועות אינטראקטיביות, UX מקומי תנועות אינטראקטיביות, UX מקומי 🔍 Think in Components, Not Just Pages In earlier versions of Next.js, rendering strategies were applied at the . You had , וכל מה שאתה בוחר ליישם זה היה הגיוני בעולם שבו rendering קרה הכל או כלום - או סטטי בזמן בניית, או דינמי על כל בקשה. page level getServerSideProps getStaticProps עמוד שלם But with and the directory introduced in Next.js 13+ and standardized in 15, זה הופך להיות A זה פותח מחשבה חדשה. React Server Components (RSC) app/ rendering is no longer a top-down, one-size-fits-all decision per-component concern 🧠 A New Way of Thinking: Declarative and Composable Rendering This shift is more than an API change, it's a conceptual shift in how you architect your frontend. Declarative Instead of orchestrating and החלקים מתבצעים באופן ידני, ועכשיו אתה פשוט React ו-Next.js יטפלו בשאר. איך איפה declare what each component does and what it needs You don’t manually wire up API endpoints or pass props from SSR to components. You can just write: // Server Component export default async function ProductInfo() { const product = await db.getProduct(slug) return <div>{product.name}</div> } This component: → → Runs on the server לא שולחים JS ללקוח Doesn’t require any or API layer getServerSideProps Is “just a component” — no extra abstraction needed You describe the UI and its data needs , and the rendering engine figures out the rest. declaratively Composable חלקים שונים של ממשק המשתמש שלך יכולים להשתמש באסטרטגיות rendering שונות - , , and → on the same page at the same time with minimal overhead For example: // Product page layout <ProductInfo /> // Server Component (no JS, rendered on the server) <AddToCartButton /> // Client Component (interactive) <SimilarProducts /> // Static Component (SSG with revalidation) הרכיבים האלה חיים יחד באותו עץ, אבל כל אחד מהם: → → → פועל בסביבה שונה (שרת, לקוח, בונה) Uses only the data and code it needs ספינות בדיוק מה הדרוש לדפדפן - לא יותר, לא פחות כדי להפוך את זה יותר ספציפי, יצרתי זה מראה כיצד אסטרטגיות rendering שונות יכולות להתקיים יחד על דף אחד. מינימום Demo 3. How React Server Components Work Under the Hood כיצד React Server Components עובד תחת הכובע React Server Components (RSC) הם יותר מאשר אסטרטגיית rendering חדשה, הם משנים באופן קיצוני את האופן שבו עצי רכיבים נוצרים, מונחים ומועברים. and how it impacts the boundaries of state, interactivity, and data. how it works behind the scenes גבול שרת/לקוח: עץ תגובה מפוזר React applications using RSC are no longer fully rendered on the client. Instead, the : component tree is split into two worlds מרכיבים שרתים: פועלים רק בשרת. אין JavaScript נשלח לעולם לדפדפן. לא ניתן לשמור על מצב מקומי או לחבר מקשיבים לאירועים. מושלם לעיבוד תוכן סטטי ולוגיקה קשורה לשרת (למשל, גישה DB). רכיבי הלקוח: חייבים להיות מסומנים באופן מפורש עם "שימוש לקוח".הם מתורגמים ל-JavaScript ידידותי לדפדפן ותומכים באינטראקטיביות מלאה, מצב מקומי, שימוש אפקט וטיפול באירועים. At build or runtime, React constructs a tree where server and client components coexist and stitches them together during render. 📍 What Actually Does "use client" כאשר אתה מוסיף לקובץ, זה מסמן כי המודול כולו ואת הייצוא שלו כמו . Behind the scenes, this instructs the Next.js build pipeline to: "use client" client-only → → Compile that file (and its dependencies) into a separate JavaScript bundle Exclude that component from being run on the server התייחסו אליו כמו לרכיב React CSR קלאסי עם הגיון הידראציה המדיניות הזו פועלת כמו כל הרכיבים מעל זה יכול להיות rendered על ידי השרת; כל הרכיבים מתחת זה חייב להיות rendered בדפדפן. boundary marker סטרימינג: rendering in pieces, not all at once RSC embraces במקום לחכות שהעץ המלא של React ייבנה לפני שליחתו לדפדפן, השרת of UI to the client as they become ready. streaming streams serialized fragments → → Server Components are rendered and sent as soon as possible Placeholders (e.g. via ) fill in temporarily <Suspense> Client Components hydrate incrementally, only when they load איך זה אפשרי? RSC introduces a concept called selective hydration. When a Client Component is rendered within a Server Component tree, React inserts a placeholder (<div data-rsc-placeholder />) and defers hydration. Once the client has loaded the corresponding JS bundle: → React lazily loads that specific component Finds the placeholder and stitches it into the live tree Hydrates it in isolation, without re-rendering the entire page This design is האפליקציה שלך מתחילה במהירות, והאינטראקטיביות מגיעה באינטרנט בהדרגה. decoupled and progressive <Suspense fallback={<LoadingDetails />}> <ProductDetails /> // Server Component </Suspense> <AddToCartButton /> // Client Component (hydrated later) ⚙️ Data Fetching and Code Splitting in RSC עוד מפתח "קסם" של RSC: מבלי לסמוך על , , or manual prop-passing. you can fetch data directly inside components with async/await getServerSideProps useEffect // Server Component export default async function Dashboard() { const stats = await getStatsForUser() return <StatsView data={stats} /> } מדוע זה אפשרי? → → רכיבי RSC פועלים כפונקציות שרת אמיתיות, לא כמודולים ממוחשבים על ידי הלקוח They can access , or anything your server runtime supports databases, internal APIs, file systems The result is rendered HTML (not JS) and streamed to the client Also: → → → , since the result is static No hydration needed in the component itself — everything resolves before it hits the browser No loading UI logic אין קוד עבור רכיב זה נשלח ללקוח – אלא אם כן הוא מוצב בתוך גבול לקוח This significantly reduces boilerplate and bundle size, while keeping logic colocated with UI — a long-standing React goal finally realized at scale. 🚫 State, Hooks, and Lifecycle Considerations RSC traditional React hooks like , או , because they . does not support useState useEffect useRef don’t run in the browser Feature מרכיב Server Client Component ❌ אפקט שימוש ❌ ✅ useContext ✅ (if static) מנהלי האירועים Feature מרכיב Server Client Component Feature Feature מרכיב Server מרכיב Server Client Component Client Component useState אפקט שימוש אפקט שימוש useEffect ❌ ❌ useContext ✅ (אם הוא סטטי) useContext useContext ✅ (אם הוא סטטי) ✅ (if static) Async / להמתין ✅ (צריך להדביק את ההשפעות) Async / להמתין async/await ✅ (צריך להדביק את ההשפעות) (צריך להדביק את ההשפעות) מנהלי האירועים מנהלי האירועים ✅ This enforces a clean separation of responsibilities: → מרכיבים של שרתים: נתונים ועיצוב Client Components: interactivity and local state React Server Components are designed to simplify your app. Once you internalize the boundary rules, the streaming model, and async data access, you can with far less boilerplate than before. compose fast, personalized, and minimal-JS apps 4. What’s the Best Practice? Combining RSC, SSR, and SSG 4. What’s the Best Practice? Combining RSC, SSR, and SSG One of the most common questions React engineers face in Next.js 15 isn’t “should I use RSC?” — it’s “how do I combine RSC with SSR and SSG in a maintainable, high-performance way?” היופי של Next.js 15 הוא שאתה כבר לא מוגבל לאסטרטגיית rendering אחת לדף. , יישום הגישה המתאימה ביותר לכל חלק של ה- UI. compose rendering strategies at the component level This section introduces a practical framework for making that decision based on actual architectural needs. התחל עם השאלה הבסיסית: מה צריך הרכיב הזה? Ask these four questions for every component: → → האם היא צריכה להיות אינטראקטיבית? ✅ כן → שימוש בהרכיב הלקוח Does it need secure, request-specific, or real-time data? ✅ Yes → Consider SSR Can it be precomputed or infrequently updated? ✅ Yes → Prefer SSG Does it fetch server data but never need to run on the client? ✅ Yes → Use RSC 🧩 Example: Product Page Strategy Breakdown Here’s how a typical e-commerce prduct page might be composed using all three strategies: Component Rendering Strategy → Reason ProductDetails RSC Fetched from DB, no interactivity, no need to hydrate → PriceWithPersonalization SSR Depends on user session, dynamic per request AddToCartButton CSR → Requires interactivity and local state מוצרים קשורים SSG (with ISR) Safe to cache at build-time, can revalidate every 24h or per tag StockStatusBanner RSC + streaming Frequently changing, streamed in with Suspense to not block TTFB מתן אסטרטגיה RSC AddToCartButton דורש אינטראקטיביות ומדינה מקומית SSG (with ISR) מאובטח לעיכוב בזמן בניית, ניתן לאמת מחדש כל 24 שעות או על ידי תגית מתן אסטרטגיה Component מתן אסטרטגיה מתן אסטרטגיה Reason Reason RSC ProductDetails RSC RSC Fetched from DB, no interactivity, no need to hydrate PriceWithPersonalization Depends on user session, dynamic per request הפרסוםPersonalization PriceWithPersonalization SSR תלוי בפגישה של המשתמש, דינמי על פי בקשה Depends on user session, dynamic per request AddToCartButton דורש אינטראקטיביות ומדינה מקומית AddToCartButton AddToCartButton CSR CSR דורש אינטראקטיביות ומדינה מקומית דורש אינטראקטיביות ומדינה מקומית SSG (with ISR) RelatedProducts SSG (with ISR) SSG (with ISR) מאובטח לעיכוב בזמן בניית, ניתן לאמת מחדש כל 24 שעות או על ידי תגית מאובטח לעיכוב בזמן בניית, ניתן לאמת מחדש כל 24 שעות או על ידי תגית מניותBanner StockStatusBanner RSC + streaming RSC + streaming Frequently changing, streamed in with Suspense to not block TTFB Frequently changing, streamed in with Suspense to not block TTFB כל רכיב עושה אין הידראציה של דף מלא, אין איסוף נתונים גלובלי, אין JavaScript מיותר. just what it needs to do 📐 Design Best Practices for Combining Strategies ✅ 1. Start Server-First Design every component as a Server Component by default. Opt into interactivity ( ) only when necessary. This keeps bundles smaller and simplifies testing. "use client" 2 – שמור על גבולות ברורים השתמש בשמות תיקיה או בשמות קבצים כדי להפוך גבולות מפורטים: /components /server/ProductDetails.tsx /client/AddToCartButton.tsx /shared/ReviewStars.tsx ✅ 3. Embrace Suspense for progressive delivery Use to stream in non-critical RSCs without blocking the whole page: <Suspense> <Suspense fallback={<LoadingReviews />}> <ReviewList /> </Suspense> ✅ 4.Co-locate לוגיקה עם רכיבים Don’t split data-fetching and UI across files unless necessary. In RSC, you can colocate logic directly inside the component tree — the framework takes care of the rest. async ✅ 5. Use ISR (Incremental Static Regeneration) smartly For cacheable, high-traffic pages like blog articles or marketing sections, use SSG + revalidation: export const revalidate = 3600 // regenerate every hour ⚠️ Common Mistakes to Avoid → ❌ by default — you’ll end up with CSR all over again Using "use client" • חיתוך נתונים מרכיבי הלקוח כאשר זה יכול להיות מוחזר על ידי השרת ❌ — instead, let client components be focused, isolated, and stateful Passing too much data between RSC and client components via props ❌ logic inside RSC — no need, RSC server-side Recreating SSR-style getServerSideProps is ✅ Decision Tree Summary Here’s a simplified guide: Is it interactive? │ ├── Yes → Client Component (CSR) │ └── No │ ├── Needs per-request data? → SSR │ ├── Can be pre-rendered? → SSG │ └── Otherwise → RSC אתה לא צריך לזכור את זה, ברגע שאתה internalize איך rendering מפות להיות אחראי, → the decisions become intuitive התרגול הטוב ביותר הוא לא על בחירת "אסטרטגיית ההפקה הטובה ביותר". It’s about — with clarity, purpose, and performance in mind. designing rendering as an intentional part of your component architecture 6. Looking Ahead: Why RSC Is More Than Just a Feature 6. Looking Ahead: Why RSC Is More Than Just a Feature React Server Components are not just a performance optimization or a DX enhancement — . Much like React Hooks in 2019, RSC in 2025 is → they represent a foundational shift in how we build React applications redefining the baseline for frontend architecture 🧠 RSC Changes the Mental Model of Building in React Traditional React development was always built on this assumption: “The browser owns the runtime. We hydrate everything. Every piece of logic and data must live in the client, or be fetched via API.” RSC breaks that assumption. With RSC, you now ask: האם אני יכול לעקוף הידראציה לחלוטין? Can this component run purely on the server? Can I colocate backend logic with my UI? It gives us back , not with wrappers and workarounds, but with . the ability to separate display logic and interactivity cleanly first-class architectural boundaries It’s no longer “client-first.” It’s “purpose-first.” כל חלק של המשתמש שלך קיים במקום שבו הוא יעיל ביותר - שרת, לקוח או סטטי. 🌐 Ecosystem Shift Toward Server-First Rendering RSC isn’t happening in isolation. The broader frontend ecosystem is undergoing a . server-first rendering renaissance Frameworks like: → → Remix מתמקד מאוד בהורדת נתונים של שרתים ופעולות טופס. embraces zero-JS by default, shipping only islands of interactivity. Astro Qwik לוקח הידראציה עד קיצון - דוחף את כל JS עד הכרחי באופן מפורש. Next.js 15, עם RSC ו- App Router, מעמיד כעת את ההפקה לפי רכיב במרכז החוויה של המפתחים. זהו משקף של אמת קשה שכולנו הרגשנו: Sending less JavaScript is the only way to scale interactivity and performance on the modern web. React Server Components are the React-native answer to that challenge — deeply integrated, ergonomic, and production-ready. 🔮 What to Expect Next The evolution is still ongoing. As React 19 and the ecosystem mature, we can expect: More granular for RSC trees debugging and profiling tools to show boundaries and hydration timelines Better DevTools integration דפוסים ברמה גבוהה יותר לאסטרטגיות הפקה abstract (לדוגמה, <ServerOnly>, <DeferredClient> wrappers) Broader adoption in design systems, frameworks, and libraries (e.g., RSC-aware UI kits) 💬 Enjoyed the read? If this article helped you think differently about React and Next.js for more deep dives Follow me on HackerNoon HackerNoon to chat about React, architecture, or RSC migration Or connect with me on LinkedIn לינקדאין