Skip to content

Commit 7c0891c

Browse files
committed
update 05-server-side-rendering
1 parent 4cecdb8 commit 7c0891c

19 files changed

Lines changed: 68 additions & 65 deletions

File tree

04-frameworks/08-nextjs/05-server-side-rendering/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ export default CarPage;
141141
142142
> `cache: 'force-cache'`: will fetch data only once.
143143
144-
>`cache: 'no-store'`: will fetch data on each refresh (F5).
144+
> `cache: 'no-store'`: will fetch data on each refresh (F5).
145145
146-
>`next: { revalidate: 10 },`: will fetch data on each refresh (F5) after revalidate seconds.
146+
> `next: { revalidate: 10 },`: will fetch data on each refresh (F5) after revalidate seconds.
147147
148148
# About Basefactor + Lemoncode
149149

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3+
import "./.next/types/routes.d.ts";
34

45
// NOTE: This file should not be edited
56
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

04-frameworks/08-nextjs/05-server-side-rendering/next.config.js

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { NextConfig } from 'next';
2+
3+
const nextConfig: NextConfig = {
4+
images: {
5+
dangerouslyAllowLocalIP: true, // only for local development
6+
remotePatterns: [
7+
{
8+
hostname: process.env.IMAGES_DOMAIN,
9+
},
10+
],
11+
},
12+
};
13+
14+
export default nextConfig;
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
2-
"name": "07-nextjs-examples",
2+
"name": "nextjs-examples",
33
"version": "1.0.0",
44
"description": "Nextjs examples",
5+
"type": "module",
6+
"imports": {
7+
"#*": "./src/*"
8+
},
59
"scripts": {
610
"start": "run-p -l start:dev start:api-server",
711
"start:dev": "next dev",
@@ -10,24 +14,21 @@
1014
"start:api-server": "cd api-server && npm run mock-server",
1115
"postinstall": "cd ./api-server && npm install"
1216
},
13-
"imports": {
14-
"#*": "./src/*"
15-
},
1617
"author": "Lemoncode",
1718
"license": "MIT",
1819
"dependencies": {
19-
"next": "^15.1.6",
20+
"next": "^16.0.10",
2021
"normalize.css": "^8.0.1",
21-
"react": "^19.0.0",
22-
"react-dom": "^19.0.0",
23-
"sharp": "^0.33.5"
22+
"react": "^19.2.3",
23+
"react-dom": "^19.2.3",
24+
"sharp": "^0.34.5"
2425
},
2526
"devDependencies": {
26-
"@types/node": "22.13.1",
27-
"@types/react": "^19.0.8",
28-
"@types/react-dom": "^19.0.3",
27+
"@types/node": "25.0.1",
28+
"@types/react": "^19.2.7",
29+
"@types/react-dom": "^19.2.3",
2930
"npm-run-all": "^4.1.5",
30-
"rimraf": "^6.0.1",
31-
"typescript": "^5.7.3"
31+
"rimraf": "^6.1.2",
32+
"typescript": "^5.9.3"
3233
}
3334
}

04-frameworks/08-nextjs/05-server-side-rendering/src/app/cars/[carId]/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import React from 'react';
2-
import { Metadata } from 'next';
31
import { Car, api, mapCarFromApiToVm } from '#pods/car';
2+
import { Metadata } from 'next';
43

54
interface Props {
65
params: Promise<{ carId: string }>;

04-frameworks/08-nextjs/05-server-side-rendering/src/app/cars/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from 'react';
2-
import Link from 'next/link';
31
import Image from 'next/image';
2+
import Link from 'next/link';
3+
import React from 'react';
44
import classes from './layout.module.css';
55

66
interface Props {

04-frameworks/08-nextjs/05-server-side-rendering/src/app/cars/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import React from 'react';
2-
import { Metadata } from 'next';
31
import { CarList, api, mapCarListFromApiToVm } from '#pods/car-list';
2+
import { Metadata } from 'next';
43

54
export const metadata: Metadata = {
65
title: 'Rent a car - Car list',

04-frameworks/08-nextjs/05-server-side-rendering/src/app/layout.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import { Inter } from 'next/font/google';
12
import 'normalize.css';
2-
import './material-icons.css';
33
import React from 'react';
4-
import { Inter } from 'next/font/google';
4+
import './material-icons.css';
55

66
const inter = Inter({
77
subsets: ['latin'],
@@ -16,7 +16,9 @@ const RootLayout = (props: Props) => {
1616
const { children } = props;
1717
return (
1818
<html lang="en" className={inter.className}>
19-
<body>{children}</body>
19+
<body>
20+
<main>{children}</main>
21+
</body>
2022
</html>
2123
);
2224
};

04-frameworks/08-nextjs/05-server-side-rendering/src/app/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import React from 'react';
2-
import Link from 'next/link';
31
import { Metadata } from 'next';
2+
import Link from 'next/link';
43

54
export const metadata: Metadata = {
65
title: 'Rent a car - Home',

0 commit comments

Comments
 (0)