Skip to content

Commit bff7e70

Browse files
authored
Upgrade Next to v14 (#38)
1 parent dcb55a5 commit bff7e70

File tree

14 files changed

+216
-1919
lines changed

14 files changed

+216
-1919
lines changed

.gitignore

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/node_modules
55
/.pnp
66
.pnp.js
7+
.yarn/install-state.gz
78

89
# testing
910
/coverage
@@ -17,14 +18,19 @@
1718

1819
# misc
1920
.DS_Store
21+
*.pem
2022

2123
# debug
2224
npm-debug.log*
2325
yarn-debug.log*
2426
yarn-error.log*
2527

2628
# local env files
27-
.env.local
28-
.env.development.local
29-
.env.test.local
30-
.env.production.local
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Next.js Hello World
22

3-
This repo is forked from [nextjs/examples/hello-world](https://github.com/zeit/next.js/tree/canary/examples/hello-world).
43

5-
This example shows the most basic idea behind Next. We have 2 pages: `pages/index.js` and `pages/about.js`. The former responds to `/` requests and the latter to `/about`. Using `next/link` you can add hyperlinks between them with universal routing capabilities. The `day` directory shows that you can have subdirectories.
4+
This example shows the most basic idea behind Next. We have 2 pages: `src/pages/index.js` and `src/pages/about.js`. The former responds to `/` requests and the latter to `/about`. Using `next/link` you can add hyperlinks between them with universal routing capabilities.
65

76
The app in this repo is deployed at https://next-js.onrender.com.
87

jsconfig.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"compilerOptions": {
3+
"paths": {
4+
"@/*": ["./src/*"]
5+
}
6+
}
7+
}

next.config.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/** @type {import('next').NextConfig} */
2+
const nextConfig = {
3+
// Uncomment the following line to build a static site.
4+
// output: "export",
5+
6+
reactStrictMode: true,
7+
};
8+
9+
export default nextConfig;

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
{
2-
"name": "nextjs-hello-world",
3-
"version": "1.0.0",
2+
"private": true,
43
"scripts": {
5-
"dev": "next",
4+
"dev": "next dev",
65
"build": "next build",
7-
"start": "next start -H 0.0.0.0",
8-
"start-localhost": "next start"
6+
"start": "next start",
7+
"lint": "next lint"
98
},
109
"dependencies": {
11-
"next": "^11.1.1",
12-
"react": "^17.0.2",
13-
"react-dom": "^17.0.2"
10+
"react": "^18",
11+
"react-dom": "^18",
12+
"next": "14.1.3"
1413
},
15-
"license": "ISC"
14+
"engines": {
15+
"node": ">=18.17"
16+
}
1617
}

pages/about.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

pages/day/index.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

pages/index.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

render.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
- type: web
33
name: next-js
4-
env: node
4+
runtime: node
55
plan: starter
66
buildCommand: yarn; yarn build
77
startCommand: yarn start
@@ -12,8 +12,8 @@ services:
1212
# Uncomment the following to deploy this app as a static site on render
1313
# - type: web
1414
# name: nextjs-static
15-
# env: static
16-
# buildCommand: yarn; yarn build; yarn next export
15+
# runtime: static
16+
# buildCommand: yarn; yarn build
1717
# staticPublishPath: out
1818
# pullRequestPreviewsEnabled: true # optional
1919
# envVars:

src/pages/_app.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function App({ Component, pageProps }) {
2+
return <Component {...pageProps} />;
3+
}

src/pages/_document.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Html, Head, Main, NextScript } from "next/document";
2+
3+
export default function Document() {
4+
return (
5+
<Html lang="en">
6+
<Head />
7+
<body>
8+
<Main />
9+
<NextScript />
10+
</body>
11+
</Html>
12+
);
13+
}

src/pages/about.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function About() {
2+
return <div>About</div>;
3+
}

src/pages/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Link from "next/link";
2+
3+
export default function Home() {
4+
return (
5+
<div>
6+
Hello World.{" "}
7+
<Link href="/about">
8+
About
9+
</Link>
10+
</div>
11+
);
12+
}

0 commit comments

Comments
 (0)