Skip to content

Commit ee179ee

Browse files
committed
feedback updates
1 parent d2248c1 commit ee179ee

File tree

51 files changed

+240
-555
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+240
-555
lines changed

exercises/01.routing/01.problem.routing/README.mdx

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,25 @@
33
Welcome to your first exercise! In this exercise,
44
you will learn how to register routes in a React Router application.
55

6-
## Exercise Overview
6+
## Understanding the `routes.ts` file
7+
8+
The `app/routes.ts` file is where you define the routes for your application. Each route corresponds to a specific URL path
9+
and is associated with a React component that will be rendered when the user navigates to that path.
10+
11+
This file is picked up by the React Router vite plugin and is used to generate the routing configuration for your app.
12+
What's important to keep in mind is that this in the end, is just a regular TypeScript file, so you can use all the features of TypeScript
13+
to help you define your routes. You can fetch them from third-parties, define helper functions, and so on.
14+
15+
React router offers you a few utilities to help you define your routes more easily.
16+
17+
## Exercise Goals
718

819
In this exercise, you will:
920

1021
1. Explore the `app/routes` directory.
11-
2. Register those routes in the `app/routes.ts` file.
12-
3. (Bonus) Create a utility to easily define landing page routes.
13-
14-
## Getting Started
22+
2. Learn about the utilites offered by React Router to define routes.
23+
3. Register those routes in the `app/routes.ts` file.
24+
4. (Bonus) Create a utility to easily define landing page routes.
1525

1626
To get started, find our helpful assistants comments in the `app/routes.ts` file. (They include 🐨 emoji)
17-
and implement the following routes:
18-
19-
- `Landing page layout` that wraps all the other routes (`./routes/_landing.tsx`).
20-
- `/` - The index route that renders the landing page (`./routes/_landing._index/route.tsx`).
21-
- `/about` - The about route that renders the `About` page (`./routes/_landing.about.tsx`).
22-
- `/products` - The products route that renders the `Products` page (`./routes/_landing.products._index.tsx`).
23-
- `/products/:productId` - The product details route that renders the `ProductDetails` page (`./routes/_landing.products.$productId.tsx`).
24-
- `/contact` - The contact route that renders the `Contact` page (`./routes/_landing.contact.tsx`).
25-
- `/cart` - The cart route that renders the `Cart` page (`./routes/_landing.cart.tsx`).
26-
- `/terms-of-use` - The terms of use route that renders the `TermsOfUse` page (`./routes/_landing.terms-of-use.tsx`).
27-
- `/terms-of-service` - The terms of service route that renders the `TermsOfService` page (`./routes/_landing.terms-of-service.tsx`).
28-
29-
> Bonus (only after completing the above): Create a utility function to easily define landing page routes.
30-
> This utility should be used to define the routes above
27+
and implement the required routes for this project!

exercises/01.routing/01.problem.routing/app/routes.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,26 @@ import {
77
} from '@react-router/dev/routes'
88

99
// 🐨 Create your route configuration here.
10-
// 🐨 This file is used to define the structure of your application routes.
10+
// 💰 This file is used to define the structure of your application routes.
1111
//
1212
// 🐨 You need to add the following routes:
13-
// - Home page ("/")
14-
// - About page ("/about")
15-
// - Contact page ("/contact")
13+
// - `Landing page layout` that wraps all the other routes (`./routes/_landing.tsx`).
14+
// - `/` - The index route that renders the landing page (`./routes/_landing._index/route.tsx`).
15+
// - `/about` - The about route that renders the `About` page (`./routes/_landing.about.tsx`).
16+
// - `/products` - The products route that renders the `Products` page (`./routes/_landing.products._index.tsx`).
17+
// - `/products/:productId` - The product details route that renders the `ProductDetails` page (`./routes/_landing.products.$productId.tsx`).
18+
// - `/contact` - The contact route that renders the `Contact` page (`./routes/_landing.contact.tsx`).
19+
// - `/cart` - The cart route that renders the `Cart` page (`./routes/_landing.cart.tsx`).
20+
// - `/terms-of-use` - The terms of use route that renders the `TermsOfUse` page (`./routes/_landing.terms-of-use.tsx`).
21+
// - `/terms-of-service` - The terms of service route that renders the `TermsOfService` page (`./routes/_landing.terms-of-service.tsx`).
22+
1623
// 💰 Create a products route with children here!
1724
// - Products page ("/products")
1825
// - Product details page ("/products/:productId")
19-
// - Terms of Use page ("/terms-of-use")
20-
// - Terms of Service page ("/terms-of-service")
2126
//
22-
// 🐨 The files are already ready for you in the `app/routes` directory!
27+
// 💰 The files are already ready for you in the `app/routes` directory!
2328
//
24-
// Bonus points: Create a utility to define landing page routes
29+
// 💯 Bonus points: Create a utility to define landing page routes
2530
// and use it to create the routes for the landing page.
2631

2732
export default [] satisfies RouteConfig

exercises/01.routing/01.problem.routing/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
},
1515
"dependencies": {
1616
"@epic-web/workshop-utils": "^6.40.0",
17-
"@react-router/node": "^7.5.3",
18-
"@react-router/serve": "^7.5.3",
17+
"@react-router/node": "^7.9.5",
18+
"@react-router/serve": "^7.9.5",
1919
"isbot": "^5.1.27",
2020
"lucide-react": "^0.525.0",
2121
"react": "^19.1.0",
2222
"react-dom": "^19.1.0",
23-
"react-router": "^7.5.3"
23+
"react-router": "^7.9.5"
2424
},
2525
"devDependencies": {
2626
"@playwright/test": "^1.39.0",
27-
"@react-router/dev": "^7.5.3",
27+
"@react-router/dev": "^7.9.5",
2828
"@tailwindcss/vite": "^4.1.4",
2929
"@types/node": "^20",
3030
"@types/react": "^19.1.2",

exercises/01.routing/01.solution.routing/README.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ In this exercise you learned how to use the `routes.ts` file to manually registe
66
and you also learned how to create a utility function to make it easier to register routes
77
that share a common layout.
88

9-
Even though I'm proud of you for completing this exercise, 👨‍💼 Peter the manager isn't! He
10-
thinks this approach of manually registering routes is too tedious and time consuming. He wants you
9+
Even though I'm proud of you for completing this exercise, 👨‍💼 Peter the manager isn't!
10+
11+
He thinks this approach of manually registering routes is too tedious and time consuming. He wants you
1112
to find a better way to register routes in the next exercise. So let's move on to the
1213
next exercise where you will learn how to use a third party
1314
library to automatically detect and register your routes for you!

exercises/01.routing/01.solution.routing/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
},
1515
"dependencies": {
1616
"@epic-web/workshop-utils": "^6.40.0",
17-
"@react-router/node": "^7.5.3",
18-
"@react-router/serve": "^7.5.3",
17+
"@react-router/node": "^7.9.5",
18+
"@react-router/serve": "^7.9.5",
1919
"isbot": "^5.1.27",
2020
"lucide-react": "^0.525.0",
2121
"react": "^19.1.0",
2222
"react-dom": "^19.1.0",
23-
"react-router": "^7.5.3"
23+
"react-router": "^7.9.5"
2424
},
2525
"devDependencies": {
2626
"@playwright/test": "^1.39.0",
27-
"@react-router/dev": "^7.5.3",
27+
"@react-router/dev": "^7.9.5",
2828
"@tailwindcss/vite": "^4.1.4",
2929
"@types/node": "^20",
3030
"@types/react": "^19.1.2",

exercises/01.routing/02.problem.automatic-routing/README.mdx

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,11 @@ Now that we understand how to define routes and use them effectively, let's use
88
from the React Router team to automatically detect and register routes for us so we can focus
99
on building features instead of boilerplate.
1010

11-
## Exercise Overview
11+
## Exercise Goals
1212

1313
In this exercise, you will:
1414

15-
1. Install `@react-router/fs-routes` package.
16-
2. Register those routes in the `app/routes.ts` file.
17-
18-
## Getting Started
15+
1. Use a custom convention to automatically detect and register routes in the `app/routes.ts` file.
16+
2. Understand how automatic route detection works and how to leverage it in your projects.
1917

2018
To get started, find our helpful assistants comments in the `app/routes.ts` file. (They include 🐨 emoji)
21-
22-
You will need to install a new package to help you with automatic route detection:
23-
24-
```sh
25-
npm install @react-router/fs-routes
26-
```
27-
28-
Then, implement the following steps in the `app/routes.ts` file:
29-
30-
1. Import the `flatRoutes` function from `@react-router/fs-routes`.
31-
2. Use the `flatRoutes` function to automatically detect and register all the routes in the
32-
`app/routes` directory.

exercises/01.routing/02.problem.automatic-routing/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@
1414
},
1515
"dependencies": {
1616
"@epic-web/workshop-utils": "^6.40.0",
17-
"@react-router/node": "^7.5.3",
18-
"@react-router/serve": "^7.5.3",
17+
"@react-router/node": "^7.9.5",
18+
"@react-router/serve": "^7.9.5",
1919
"isbot": "^5.1.27",
2020
"lucide-react": "^0.525.0",
2121
"react": "^19.1.0",
2222
"react-dom": "^19.1.0",
23-
"react-router": "^7.5.3"
23+
"react-router": "^7.9.5"
2424
},
2525
"devDependencies": {
2626
"@playwright/test": "^1.39.0",
27-
"@react-router/dev": "^7.5.3",
27+
"@react-router/dev": "^7.9.5",
28+
"@react-router/fs-routes": "^7.9.5",
2829
"@tailwindcss/vite": "^4.1.4",
2930
"@types/node": "^20",
3031
"@types/react": "^19.1.2",

exercises/01.routing/02.solution.automatic-routing/README.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ and registered in your application, saving you time and effort.
1212
your app for the next few exercises. Although, I don't really know how to add the stylesheets
1313
and fonts to your app, so you will have to figure that part out on your own!
1414

15+
<NextDiffLink> Check out the changes in the next exercise </NextDiffLink>
16+
1517
## Additional considerations
1618

1719
The package we used only supports a single layer of nested routes. If you need more complex

exercises/01.routing/02.solution.automatic-routing/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@
1414
},
1515
"dependencies": {
1616
"@epic-web/workshop-utils": "^6.40.0",
17-
"@react-router/node": "^7.5.3",
18-
"@react-router/serve": "^7.5.3",
17+
"@react-router/node": "^7.9.5",
18+
"@react-router/serve": "^7.9.5",
1919
"isbot": "^5.1.27",
2020
"lucide-react": "^0.525.0",
2121
"react": "^19.1.0",
2222
"react-dom": "^19.1.0",
23-
"react-router": "^7.5.3"
23+
"react-router": "^7.9.5"
2424
},
2525
"devDependencies": {
2626
"@playwright/test": "^1.39.0",
27-
"@react-router/dev": "^7.5.3",
28-
"@react-router/fs-routes": "^7.8.2",
27+
"@react-router/dev": "^7.9.5",
28+
"@react-router/fs-routes": "^7.9.5",
2929
"@tailwindcss/vite": "^4.1.4",
3030
"@types/node": "^20",
3131
"@types/react": "^19.1.2",

exercises/02.metadata/01.problem.styling/README.mdx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,15 @@ export const links: LinksFunction = () => [
6060
]
6161
```
6262

63-
## Exercise overview
63+
## Exercise Goals
6464

65-
In this exercise, we're adding a global stylesheet and a Google Fonts link to our app.
66-
To get started head to the `root.tsx` and find the exercise instructions there!
65+
In this exercise, you'll be adding a global stylesheet and a Google Fonts link to our app.
66+
67+
We want to learn how to:
6768

69+
- Add a global stylesheet to our app using the `links` export.
70+
- Add custom fonts from Google Fonts using the `links` export.
71+
- Use the links export to preload important resources for our app.
72+
73+
To get started head to the `root.tsx` and find the exercise instructions there!
6874
Bonus points if you preconnect to the Google Fonts domain to speed up font loading! 🚀

0 commit comments

Comments
 (0)