Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Intro to Next 13 Server Components
Search
Callum Silcock
March 09, 2023
Technology
330
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Intro to Next 13 Server Components
A lightning talk on the new Next 13 BETA Server Components feature and how to use them
Callum Silcock
March 09, 2023
More Decks by Callum Silcock
See All by Callum Silcock
Unlocking Lockfiles - A Developers Guide to Package Management
csilk
0
200
Attacking the Frontend
csilk
0
280
Advanced Testing concepts
csilk
0
410
Automating Design Review with Visual Regression
csilk
0
480
🎟 Tech Delivery Blueprint (Agile)
csilk
0
61
Using Given / When / Then with Cypress
csilk
0
1.4k
Intro To Basic UX Concepts
csilk
0
180
ReactJS For Beginners
csilk
0
130
What is Redux (vs. MVC)
csilk
1
210
Other Decks in Technology
See All in Technology
internal/testlog で遊ぼう
rokuosan
0
280
Kiro Crew で始める マルチエージェント開発
miu_crescent
PRO
0
200
Microsoft MVP プログラムを紹介するから目指す人増えてくれ
tsubakimoto_s
0
140
500名弱規模の組織のPythonプロジェクト(dbt) をどう管理するか?
hiracky16
0
360
Dylib Hijacking on macOS: Dead or Alive?
patrickwardle
0
130
アクセスキーが漏れた日にやるべきこと- 無効化の先にある本当の対応
kazzpapa3
0
360
AI駆動開発はどこまで来たのか? ファインディの最新実態調査で読み解く現在地 Devin Con Tokyo
akiratom
4
1.9k
Eight Engineering Unit 紹介資料
sansan33
PRO
3
8.3k
本番に近いテストをもっと手軽に - Postmanで広がるAPIテストの世界 / Expanding the World of API Testing with Postman
yokawasa
1
130
Digitization部 紹介資料
sansan33
PRO
2
7.8k
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
54k
紙 to デジタル
ichien178
0
340
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
528
40k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
310
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
450
How to Talk to Developers About Accessibility
jct
2
530
The SEO identity crisis: Don't let AI make you average
varn
0
540
Prompt Engineering for Job Search
mfonobong
0
420
Agile that works and the tools we love
rasmusluckow
331
22k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.3k
Bash Introduction
62gerente
615
220k
Paper Plane
katiecoart
PRO
2
53k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
300
Transcript
🛄 VS 📳 NEXT 13 SERVER COMPONENTS Another CodingWithCallum™️ Session
⚡️ lightning talk ⚡️
🛄 SERVER COMPONENT A component that is fetched and rendered
ON THE SERVER
📳 CLIENT COMPONENT A component that is fetched and rendered
ON THE CLIENT
EXAMPLES
None
USING SERVER COMPONENTS 🛄 Only download HTML built by the
server Instant render Speed 🏃♀️💨 + the JS required for the client components (if any) react cached Make direct API calls (server to server)
NOT USING SERVER COMPONENTS 📳 Install all JS Dependencies to
run the site React etc. Then grab all our Client JS Components Then render
WHEN TO USE SERVER 🛄 VS CLIENT 📳 COMPONENTS Need
to access browser related stuff = Client Component Anything Else? = Server Component
None
INTERLEAVING
HOW DO I DEFINE A CLIENT 📳 COMPONENT 'use client';
import { useState } from 'react'; export default function Counter() { const [count, setCount] = useState(0); return ( <div> <p>You clicked {count} times</p> <button onClick={() => setCount(count + 1)}> Click me </button>
</div> );
SHARED COMPONENT 🛄📳 What if something is Server And Client
Wait what?
SHARING DATA FROM 🛄 SERVER TO 📳 CLIENT Make your
API requests on the server Keep as many dependencies on the server as possible Eg. pass i18n translations from server > client to avoid client code (prop drilling in this case is OK)
MUTATING DATA ON THE 📳 CLIENT RPC from the client
This will change Next is working on a RFC on this at the moment We will go with what their suggestion is Watch this space
READ THE DOCS! Next 13 Server And Client Components
None