Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9e99336

Browse files
Merge branch 'canary' into patch-1
2 parents 4fec6b3 + 6926ab7 commit 9e99336

File tree

428 files changed

+521
-4235
lines changed

Some content is hidden

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

428 files changed

+521
-4235
lines changed

check-examples.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
cd `dirname $0`
4+
5+
for folder in examples/* ; do
6+
cp -n packages/create-next-app/templates/default/gitignore $folder/.gitignore;
7+
if [ -f "$folder/package.json" ]; then
8+
cat $folder/package.json | jq '.license = "MIT"' | sponge $folder/package.json
9+
fi
10+
done;
11+
12+
if [[ ! -z $(git status -s) ]];then
13+
echo "Detected changes"
14+
git status
15+
exit 1
16+
fi

check-git-ignore.sh

-13
This file was deleted.

contributing.md

-21
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ Deploy the example using [Vercel](https://vercel.com/now):
138138

139139
## How to use
140140

141-
### Using `create-next-app`
142-
143141
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
144142

145143
```bash
@@ -148,24 +146,5 @@ npx create-next-app --example DIRECTORY_NAME DIRECTORY_NAME-app
148146
yarn create next-app --example DIRECTORY_NAME DIRECTORY_NAME-app
149147
```
150148

151-
### Download manually
152-
153-
Download the example:
154-
155-
```bash
156-
curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/DIRECTORY_NAME
157-
cd DIRECTORY_NAME
158-
```
159-
160-
Install it and run:
161-
162-
```bash
163-
npm install
164-
npm run dev
165-
# or
166-
yarn
167-
yarn dev
168-
```
169-
170149
Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
171150
````

docs/advanced-features/measuring-performance.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ export function reportWebVitals(metric) {
158158
>
159159
> ```js
160160
> export function reportWebVitals({ id, name, label, value }) {
161-
> ga('send', 'event', {
161+
> // Use `window.gtag` if you initialized Google Analytics as this example:
162+
> // https://github.com/vercel/next.js/blob/canary/examples/with-google-analytics/pages/_document.js
163+
> window.gtag('send', 'event', {
162164
> eventCategory:
163165
> label === 'web-vital' ? 'Web Vitals' : 'Next.js custom metric',
164166
> eventAction: name,

examples/active-class-name/README.md

-21
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ Deploy the example using [Vercel](https://vercel.com):
1010

1111
## How to use
1212

13-
### Using `create-next-app`
14-
1513
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
1614

1715
```bash
@@ -20,23 +18,4 @@ npx create-next-app --example active-class-name active-class-name-app
2018
yarn create next-app --example active-class-name active-class-name-app
2119
```
2220

23-
### Download manually
24-
25-
Download the example:
26-
27-
```bash
28-
curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/active-class-name
29-
cd active-class-name
30-
```
31-
32-
Install it and run:
33-
34-
```bash
35-
npm install
36-
npm run dev
37-
# or
38-
yarn
39-
yarn dev
40-
```
41-
4221
Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).

examples/active-class-name/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
"react": "^16.7.0",
1313
"react-dom": "^16.7.0"
1414
},
15-
"license": "ISC"
15+
"license": "MIT"
1616
}

examples/amp-first/README.md

-21
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ Deploy the example using [Vercel](https://vercel.com):
1515

1616
## How to use
1717

18-
### Using `create-next-app`
19-
2018
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
2119

2220
```bash
@@ -25,25 +23,6 @@ npx create-next-app --example amp-first amp-first-app
2523
yarn create next-app --example amp-first amp-first-app
2624
```
2725

28-
### Download manually
29-
30-
Download the example:
31-
32-
```bash
33-
curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/amp-first
34-
cd amp-first
35-
```
36-
37-
Install it and run:
38-
39-
```bash
40-
npm install
41-
npm run dev
42-
# or
43-
yarn
44-
yarn dev
45-
```
46-
4726
Open [http://localhost:3000](http://localhost:3000) to view it in the browser. The page will reload if you make edits. You will also see AMP validation errors in the console.
4827

4928
## Todo

examples/amp-first/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
"react": "^16.10.2",
1212
"react-dom": "^16.10.2"
1313
},
14-
"license": "ISC"
14+
"license": "MIT"
1515
}

examples/amp-story/README.md

-21
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ Deploy the example using [Vercel](https://vercel.com):
1010

1111
## How to use
1212

13-
### Using `create-next-app`
14-
1513
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
1614

1715
```bash
@@ -20,23 +18,4 @@ npx create-next-app --example amp-story amp-app
2018
yarn create next-app --example amp-story amp-app
2119
```
2220

23-
### Download manually
24-
25-
Download the example:
26-
27-
```bash
28-
curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/amp-story
29-
cd amp-story
30-
```
31-
32-
Install it and run:
33-
34-
```bash
35-
npm install
36-
npm run dev
37-
# or
38-
yarn
39-
yarn dev
40-
```
41-
4221
Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).

examples/amp-story/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
"react": "^16.7.0",
1212
"react-dom": "^16.7.0"
1313
},
14-
"license": "ISC"
14+
"license": "MIT"
1515
}

examples/amp/README.md

-21
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ Deploy the example using [Vercel](https://vercel.com):
1010

1111
## How to use
1212

13-
### Using `create-next-app`
14-
1513
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
1614

1715
```bash
@@ -20,23 +18,4 @@ npx create-next-app --example amp amp-app
2018
yarn create next-app --example amp amp-app
2119
```
2220

23-
### Download manually
24-
25-
Download the example:
26-
27-
```bash
28-
curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/amp
29-
cd amp
30-
```
31-
32-
Install it and run:
33-
34-
```bash
35-
npm install
36-
npm run dev
37-
# or
38-
yarn
39-
yarn dev
40-
```
41-
4221
Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).

examples/amp/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
"react": "^16.7.0",
1212
"react-dom": "^16.7.0"
1313
},
14-
"license": "ISC"
14+
"license": "MIT"
1515
}

examples/analyze-bundles/README.md

-21
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ Deploy the example using [Vercel](https://vercel.com):
1010

1111
## How to use
1212

13-
### Using `create-next-app`
14-
1513
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
1614

1715
```bash
@@ -20,25 +18,6 @@ npx create-next-app --example analyze-bundles analyze-bundles-app
2018
yarn create next-app --example analyze-bundles analyze-bundles-app
2119
```
2220

23-
### Download manually
24-
25-
Download the example:
26-
27-
```bash
28-
curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/analyze-bundles
29-
cd analyze-bundles
30-
```
31-
32-
Install it
33-
34-
```bash
35-
npm install
36-
npm run dev
37-
# or
38-
yarn
39-
yarn dev
40-
```
41-
4221
### Analyze webpack output
4322

4423
To analyze your webpack output, invoke the following command:

examples/analyze-bundles/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
"react": "^16.8.0",
1616
"react-dom": "^16.8.0"
1717
},
18-
"license": "ISC"
18+
"license": "MIT"
1919
}

examples/api-routes-apollo-server-and-client-auth/README.md

-21
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ In this simple example, we integrate Apollo seamlessly with [Next.js data fetchi
66

77
## How to use
88

9-
### Using `create-next-app`
10-
119
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) or [npx](https://github.com/zkat/npx#readme) to bootstrap the example:
1210

1311
```bash
@@ -16,23 +14,4 @@ npx create-next-app --example api-routes-apollo-server-and-client-auth api-route
1614
yarn create next-app --example api-routes-apollo-server-and-client-auth api-routes-apollo-server-and-client-auth-app
1715
```
1816

19-
### Download manually
20-
21-
Download the example:
22-
23-
```bash
24-
curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/api-routes-apollo-server-and-client-auth
25-
cd api-routes-apollo-server-and-client-auth
26-
```
27-
28-
Install it and run:
29-
30-
```bash
31-
npm install
32-
npm run dev
33-
# or
34-
yarn
35-
yarn dev
36-
```
37-
3817
Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).

examples/api-routes-apollo-server-and-client-auth/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
"react-dom": "^16.7.0",
1919
"uuid": "8.1.0"
2020
},
21-
"license": "ISC"
21+
"license": "MIT"
2222
}

examples/api-routes-apollo-server-and-client/README.md

-21
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ In this simple example, we integrate Apollo seamlessly with [Next.js data fetchi
66

77
## How to use
88

9-
### Using `create-next-app`
10-
119
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
1210

1311
```bash
@@ -16,23 +14,4 @@ npx create-next-app --example api-routes-apollo-server-and-client api-routes-apo
1614
yarn create next-app --example api-routes-apollo-server-and-client api-routes-apollo-server-and-client-app
1715
```
1816

19-
### Download manually
20-
21-
Download the example:
22-
23-
```bash
24-
curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/api-routes-apollo-server-and-client
25-
cd api-routes-apollo-server-and-client
26-
```
27-
28-
Install it and run:
29-
30-
```bash
31-
npm install
32-
npm run dev
33-
# or
34-
yarn
35-
yarn dev
36-
```
37-
3817
Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).

examples/api-routes-apollo-server-and-client/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
"react": "^16.7.0",
1616
"react-dom": "^16.7.0"
1717
},
18-
"license": "ISC"
18+
"license": "MIT"
1919
}

examples/api-routes-apollo-server/README.md

-21
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ Deploy the example using [Vercel](https://vercel.com):
1010

1111
## How to use
1212

13-
### Using `create-next-app`
14-
1513
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
1614

1715
```bash
@@ -20,25 +18,6 @@ npx create-next-app --example api-routes-apollo-server api-routes-apollo-server-
2018
yarn create next-app --example api-routes-apollo-server api-routes-apollo-server-app
2119
```
2220

23-
### Download manually
24-
25-
Download the example:
26-
27-
```bash
28-
curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/api-routes-apollo-server
29-
cd api-routes-apollo-server
30-
```
31-
32-
Install it and run:
33-
34-
```bash
35-
npm install
36-
npm run dev
37-
# or
38-
yarn
39-
yarn dev
40-
```
41-
4221
Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
4322

4423
## Notes

0 commit comments

Comments
 (0)