Skip to content

Commit d018f4c

Browse files
committed
feat(react): Fill blank sections for Server Functions and Vercel chapters
1 parent a4b44fc commit d018f4c

File tree

1 file changed

+41
-6
lines changed

1 file changed

+41
-6
lines changed

courses/frontend/react/week5/session-plan.md

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@
1818
- Discuss when to use SSR (dynamic data, personalization, etc.)
1919
- Discuss when to use SSG (static content, blogs, documentation, etc.)
2020

21+
#### Server Components
22+
23+
- Explain how [Server Components](https://react.dev/reference/rsc/server-components) can speed up load times by directly sending HTML to the browser
24+
- Introduce the `"use server"` directive, allowing React components to be rendered on the server
25+
2126
### When to Use Client vs. Server Components?
2227

23-
- Explain how Next.js distinguishes client and server components
28+
- Re-iterate how Next.js distinguishes client and server components (`"use server"` and `"use client"`)
2429
- Illustrate how these fit into the SSR and SSG concepts
2530

2631
### Introduction to Next.js App Router
@@ -64,23 +69,53 @@
6469
- Explain how to access various router properties (push, replace, etc.)
6570
- Demonstrate programmatic navigation using `router.push` and `router.replace`
6671

67-
### Optional Advanced: Server Functions (or Server Actions) & API Routes
72+
### Optional Advanced: Server Functions & API Routes
73+
74+
#### Server Functions
75+
76+
- Explain Server Functions _(previously "Server Actions")_ as a mechanism to run JavaScript code on the server that hosts the website
77+
- Discuss how this is different from running JavaScript in the user's browser
78+
- Reference [the React docs for Server Functions](https://react.dev/reference/rsc/server-functions) demonstrating how to use them
79+
80+
#### Server Components
81+
82+
- Discuss how Server Components allow the use of Server Functions inside the component
83+
- Explain that client components can use Server Functions by importing them from a file with the `"use server"` directive
84+
85+
#### Server Actions
86+
87+
- Introduce "Server Actions" as a specific type of Server Function
88+
- Provide context by mentioning plain old `<form>`s on the internet that are historically sent to a server for processing (we could say a "server function"!)
89+
- Explain how attaching a Server _Function_ to an `action` makes it a Server _Action_
90+
91+
#### API Routes
6892

69-
TODO: …
93+
- Explain how Next.js supports Server Actions and Server Components as React features
94+
- Introduce API routes as a concept from the backend side of web development
95+
- Provide an overview of [Route Handlers](https://nextjs.org/docs/app/getting-started/route-handlers) and how they allow to create an API route that returns JSON
96+
- _(The concept of APIs is covered in detail in the backend specialisation)_
7097

7198
## Vercel
7299

73100
### Introducing Vercel & Good Use Cases
74101

75-
TODO: …
102+
- Introduce Vercel as the company behind Next.js, as well as a provider of cloud infrastructure
103+
- Explain how Vercel's hosting options allow developers to host Next.js applications with very little effort
104+
- Highlight that hosting on Vercel is perfect for a prototype or portfolio website built with React and/or Next.js
76105

77106
### Connecting a GitHub Repository With Vercel
78107

79-
TODO: …
108+
- Demonstrate in the browser how a **public** GitHub repository from your account can be connected to Vercel and deployed with the click of a button
109+
- Illustrate one way to get started with Vercel by installing the Vercel CLI globally `npm -g vercel`
110+
- Show logging in to Vercel using `vercel login` and using ones GitHub account
111+
- Show how one can deploy a local folder with a Next.js app using the `vercel deploy` CLI command
80112

81113
### Limitations of Vercel
82114

83-
TODO: …
115+
- Mention that Vercel apparently works best for hosting Next.js applications or static websites
116+
- Discuss how other frameworks are supported, but that the focus is likely on Next.js
117+
- Mention that knowledge about DNS, domains, npm, dependencies etc. is not required, but useful when managing a site on Vercel
118+
- Highlight that Vercel is well-suited for production applications, but that prices can apparently vary a lot based on usage
84119

85120
## Exercises
86121

0 commit comments

Comments
 (0)