Skip to content

Commit 51892eb

Browse files
Migrated 'with-absolute-imports' to App-router Convention (#68666)
Hey There 👋 This PR Includes the following changes -> Migration of with-absolute-imports example to App Router -> Updated all packages -> Added the Layout page as per App router Convention. cc - @samcx Co-authored-by: Sam Ko <[email protected]>
1 parent 3131049 commit 51892eb

File tree

4 files changed

+29
-8
lines changed

4 files changed

+29
-8
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export const metadata = {
2+
title: "Next.js",
3+
description: "Generated by Next.js",
4+
};
5+
6+
export default function RootLayout({
7+
children,
8+
}: {
9+
children: React.ReactNode;
10+
}) {
11+
return (
12+
<html lang="en">
13+
<body>{children}</body>
14+
</html>
15+
);
16+
}
File renamed without changes.

examples/with-absolute-imports/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
},
88
"dependencies": {
99
"next": "latest",
10-
"react": "^18.2.0",
11-
"react-dom": "^18.2.0"
10+
"react": "^18.3.1",
11+
"react-dom": "^18.3.1"
1212
},
1313
"devDependencies": {
14-
"@types/node": "^18.11.9",
15-
"@types/react": "^18.0.25",
16-
"@types/react-dom": "^18.0.8",
17-
"typescript": "^4.8.4"
14+
"@types/node": "^22.1.0",
15+
"@types/react": "^18.3.3",
16+
"@types/react-dom": "^18.3.0",
17+
"typescript": "^5.5.4"
1818
}
1919
}

examples/with-absolute-imports/tsconfig.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,13 @@
1919
// Using "paths" allows you to configure module path aliases
2020
"paths": {
2121
"@/components/*": ["components/*"]
22-
}
22+
},
23+
"plugins": [
24+
{
25+
"name": "next"
26+
}
27+
]
2328
},
24-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
29+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
2530
"exclude": ["node_modules"]
2631
}

0 commit comments

Comments
 (0)