generated from sfeir-open-source/sfeir-school-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement last labs (start) (#5)
* feat: implement last labs (start) * feat: finish suspense lab * fix: update lab instructions --------- Co-authored-by: Antoine RICHARD <[email protected]>
- Loading branch information
1 parent
9ca8060
commit 6d3c807
Showing
319 changed files
with
7,241 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
<!-- .slide: class="exercice" --> | ||
|
||
# Expected errors | ||
# 06.02 - Expected errors | ||
|
||
## Lab | ||
|
||
<small> | ||
|
||
**1. Implement a global 404 page** | ||
|
||
- This page should display the current invalid URL (example : the page "/invalid-page" does not exist) | ||
- This page should display the current invalid URL <br/>(example : the page "/invalid-page" does not exist) | ||
|
||
**2. Implement 404 pages for expense details, employee details & employee edition pages** | ||
|
||
- This pages should display the current invalid id (example : the employee "1234" does not exist) | ||
- This pages should display the current invalid id <br/>(example : the employee "1234" does not exist) | ||
|
||
<br/> <br/> | ||
|
||
**ℹ️ Running the lab**<br/> | ||
`npm run start -w api`<br/> | ||
`npm run dev -w 06.02` | ||
|
||
</small> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<!-- .slide: class="exercice" --> | ||
|
||
# next.config.js lifecycles | ||
# 07.01 - next.config.js lifecycles | ||
|
||
## Lab | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<!-- .slide: class="exercice" --> | ||
|
||
# Middleware | ||
# 07.02 - Middleware | ||
|
||
## Lab | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,31 @@ | ||
<!-- .slide: class="exercice" --> | ||
|
||
# Rendering methods | ||
<h1 id="rendering-methods" style="margin-bottom: 30px;">08.01 - Rendering methods</h1> | ||
|
||
## Lab | ||
|
||
<small> | ||
|
||
TODO | ||
**1. Opt out static rendering on homepage** | ||
|
||
- The page should be rendered on every request | ||
- The page should fetch its data on every request | ||
|
||
**2. Implement Incremental Static Regeneration for employees** | ||
|
||
- Pre-render employee details and edit pages at build time | ||
- Don't accept new employee requests at run-time | ||
|
||
**3. Implement Incremental Static Regeneration for expenses** | ||
|
||
- Pre-render expenses details pages at build time | ||
- Render new expenses details pages at run-time | ||
|
||
**4. Bonus** : <br/> | ||
Implement a `<NoSSR>{children}</NoSSR/>` component : that make sure its children are never rendered on the server | ||
|
||
**ℹ️ Running the lab**<br/> | ||
`npm run start -w api`<br/> | ||
`npm run dev -w 08.01` | ||
|
||
</small> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,27 @@ | ||
<!-- .slide: class="exercice" --> | ||
|
||
# Streaming | ||
<h1 id="streaming" style="margin-bottom: 30px;">08.02 - Streaming</h1> | ||
|
||
## Lab | ||
|
||
<small> | ||
|
||
TODO | ||
**1. Streaming an entire page** | ||
|
||
- The expense list page is long to load | ||
- Implement streaming to this page to optimise loading | ||
|
||
**2. Streaming and parallel routing** | ||
|
||
- Add a loading state for homepage components | ||
|
||
**3. Streaming only a part of a page** | ||
|
||
- In the `ExpenseDetails` component, the `ExpenseEmployee` component is blocking : it must be loaded for the page to be rendered | ||
- Add a loading state only to this part of the page | ||
|
||
**ℹ️ Running the lab**<br/> | ||
`npm run start -w api`<br/> | ||
`npm run dev -w 08.02` | ||
|
||
</small> |
2 changes: 0 additions & 2 deletions
2
steps/00.00-sfeir-people-demo/src/app/(dashboard)/employees/[id]/edit/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
API_BASE_URL=http://localhost:3001 | ||
API_KEY=XXXX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
.yarn/install-state.gz | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# 08.01 - Rendering methods | Solution | ||
|
||
## Prerequisites | ||
|
||
Running the API server : | ||
|
||
``` | ||
npm run start -w api | ||
``` | ||
|
||
## Running the solution | ||
|
||
``` | ||
npm run dev -w 08.01-solution | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const apiUrl = new URL(process.env.API_BASE_URL || 'http://localhost:3001'); | ||
|
||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
images: { | ||
remotePatterns: [ | ||
{ | ||
hostname: apiUrl.hostname, | ||
port: apiUrl.port, | ||
}, | ||
], | ||
}, | ||
}; | ||
|
||
export default nextConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"name": "08.01-solution", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start", | ||
"lint": "next lint" | ||
}, | ||
"dependencies": { | ||
"bright": "^0.8.5", | ||
"clsx": "^2.1.1", | ||
"jose": "^5.6.3", | ||
"jsonwebtoken": "^9.0.2", | ||
"next": "14.2.5", | ||
"react": "^18", | ||
"react-dom": "^18", | ||
"react-error-boundary": "^4.0.13", | ||
"rehype-sanitize": "^6.0.0", | ||
"rehype-stringify": "^10.0.0", | ||
"remark-parse": "^11.0.0", | ||
"remark-rehype": "^11.1.0", | ||
"server-only": "^0.0.1", | ||
"showdown": "^2.1.0", | ||
"unified": "^11.0.5" | ||
}, | ||
"devDependencies": { | ||
"@types/jsonwebtoken": "^9.0.6", | ||
"@types/node": "^20", | ||
"@types/react": "^18", | ||
"@types/react-dom": "^18", | ||
"@types/showdown": "^2.0.6", | ||
"eslint": "^8", | ||
"eslint-config-next": "14.2.5", | ||
"typescript": "^5" | ||
} | ||
} |
Oops, something went wrong.