Skip to content

Commit 5d76ec3

Browse files
committed
update boilerplate
1 parent 7884409 commit 5d76ec3

File tree

9 files changed

+37
-22
lines changed

9 files changed

+37
-22
lines changed

04-frameworks/08-nextjs/03-boilerplate/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ Next.js is unopinionated about how you [organize your project](https://nextjs.or
1010

1111
- [Route groups](https://nextjs.org/docs/app/building-your-application/routing/colocation#route-groups): `(folderName)` to groups several routes under the same folder without create a new group route.
1212

13+
- [Image component](https://nextjs.org/docs/app/api-reference/components/image) in `./src/app/cars/layout.tsx`, differences with `<img style={{ width: 32, height: 'auto' }} src="/home-logo.png" />`.
14+
- If we use `img` it downloads the full image and resizes it in the browser: ~214kB.
15+
- If we use `Image` component it downloads the image with the size we need: ~3.2kB.
16+
- Try `Image` component with `blurDataURL="/home-logo-low-resolution.png"` and `placeholder="blur"`.
17+
1318
- [Using fonts](https://nextjs.org/docs/app/building-your-application/optimizing/fonts)
1419
- [Font display values](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display#values)
1520

04-frameworks/08-nextjs/03-boilerplate/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
5+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

04-frameworks/08-nextjs/03-boilerplate/package.json

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,23 @@
1010
"postinstall": "cd ./api-server && npm install"
1111
},
1212
"imports": {
13-
"#*": [
14-
"./src/*",
15-
"./src/*.ts",
16-
"./src/*.tsx",
17-
"./src/*/index.ts",
18-
"./src/*/index.tsx"
19-
]
13+
"#*": "./src/*"
2014
},
2115
"author": "Lemoncode",
2216
"license": "MIT",
2317
"dependencies": {
24-
"next": "^14.2.9",
18+
"next": "^15.1.6",
2519
"normalize.css": "^8.0.1",
26-
"react": "^18.3.1",
27-
"react-dom": "^18.3.1",
20+
"react": "^19.0.0",
21+
"react-dom": "^19.0.0",
2822
"sharp": "^0.33.5"
2923
},
3024
"devDependencies": {
31-
"@types/node": "22.5.4",
32-
"@types/react": "^18.3.5",
33-
"@types/react-dom": "^18.3.0",
25+
"@types/node": "22.13.1",
26+
"@types/react": "^19.0.8",
27+
"@types/react-dom": "^19.0.3",
3428
"npm-run-all": "^4.1.5",
3529
"rimraf": "^6.0.1",
36-
"typescript": "^5.6.2"
30+
"typescript": "^5.7.3"
3731
}
3832
}
577 Bytes
Loading

04-frameworks/08-nextjs/03-boilerplate/tsconfig.json

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"compilerOptions": {
3-
"lib": ["dom", "dom.iterable", "esnext"],
3+
"lib": [
4+
"dom",
5+
"dom.iterable",
6+
"esnext"
7+
],
48
"allowJs": true,
59
"skipLibCheck": true,
610
"strict": false,
@@ -19,9 +23,19 @@
1923
],
2024
"baseUrl": ".",
2125
"paths": {
22-
"#*": ["./src/*"]
23-
}
26+
"#*": [
27+
"./src/*"
28+
]
29+
},
30+
"target": "ES2017"
2431
},
25-
"include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"],
26-
"exclude": ["node_modules"]
32+
"include": [
33+
"next-env.d.ts",
34+
".next/types/**/*.ts",
35+
"**/*.ts",
36+
"**/*.tsx"
37+
],
38+
"exclude": [
39+
"node_modules"
40+
]
2741
}

04-frameworks/08-nextjs/04-static-site-generation/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ Let's works with Nextjs using pages generated at build time.
44

55
We will start from `03-boilerplate`.
66

7-
# Steps to build it
7+
## Steps to build it
88

99
`npm install` to install previous sample packages:
1010

1111
```bash
1212
npm install
1313
```
1414

15+
## Rendering modes
16+
1517
We can render Nextjs pages in 3 modes:
1618

1719
- Static Site Generation
@@ -20,7 +22,7 @@ We can render Nextjs pages in 3 modes:
2022

2123
> We can combine them
2224
23-
# Static Site Generation
25+
## Static Site Generation
2426

2527
Pages are generated at build time, it means that it will fetch all necessary data from backend at build time.
2628

577 Bytes
Loading
577 Bytes
Loading
577 Bytes
Loading

0 commit comments

Comments
 (0)