Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/canary' into add/gssp-redirect…
Browse files Browse the repository at this point in the history
…-handling
  • Loading branch information
ijjk committed Aug 31, 2020
2 parents b815438 + f1c4cb8 commit 876f7f7
Show file tree
Hide file tree
Showing 442 changed files with 910 additions and 4,252 deletions.
16 changes: 16 additions & 0 deletions check-examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

cd `dirname $0`

for folder in examples/* ; do
cp -n packages/create-next-app/templates/default/gitignore $folder/.gitignore;
if [ -f "$folder/package.json" ]; then
cat $folder/package.json | jq '.license = "MIT"' | sponge $folder/package.json
fi
done;

if [[ ! -z $(git status -s) ]];then
echo "Detected changes"
git status
exit 1
fi
13 changes: 0 additions & 13 deletions check-git-ignore.sh

This file was deleted.

21 changes: 0 additions & 21 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ Deploy the example using [Vercel](https://vercel.com/now):

## How to use

### Using `create-next-app`

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:

```bash
Expand All @@ -148,24 +146,5 @@ npx create-next-app --example DIRECTORY_NAME DIRECTORY_NAME-app
yarn create next-app --example DIRECTORY_NAME DIRECTORY_NAME-app
```

### Download manually

Download the example:

```bash
curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/DIRECTORY_NAME
cd DIRECTORY_NAME
```

Install it and run:

```bash
npm install
npm run dev
# or
yarn
yarn dev
```

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)).
````
4 changes: 3 additions & 1 deletion docs/advanced-features/measuring-performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ export function reportWebVitals(metric) {
>
> ```js
> export function reportWebVitals({ id, name, label, value }) {
> ga('send', 'event', {
> // Use `window.gtag` if you initialized Google Analytics as this example:
> // https://github.com/vercel/next.js/blob/canary/examples/with-google-analytics/pages/_document.js
> window.gtag('send', 'event', {
> eventCategory:
> label === 'web-vital' ? 'Web Vitals' : 'Next.js custom metric',
> eventAction: name,
Expand Down
12 changes: 12 additions & 0 deletions docs/advanced-features/preview-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,18 @@ You can pass an object to `setPreviewData` and have it be available in `getStati

The preview mode works on `getServerSideProps` as well. It will also be available on the `context` object containing `preview` and `previewData`.

### Works with API Routes

API Routes will have access to `preview` and `previewData` under the request object. For example:

```js
export default function myApiRoute(req, res) {
const isPreview = req.preview
const previewData = req.previewData
// ...
}
```

### Unique per `next build`

Both the bypass cookie value and the private key for encrypting the `previewData` change when `next build` is completed.
Expand Down
1 change: 1 addition & 0 deletions docs/api-reference/next/link.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description: Enable client-side transitions between routes with the built-in Lin
<summary><b>Examples</b></summary>
<ul>
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/hello-world">Hello World</a></li>
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/active-class-name">Active className on Link</a></li>
</ul>
</details>

Expand Down
21 changes: 0 additions & 21 deletions examples/active-class-name/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ Deploy the example using [Vercel](https://vercel.com):

## How to use

### Using `create-next-app`

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:

```bash
Expand All @@ -20,23 +18,4 @@ npx create-next-app --example active-class-name active-class-name-app
yarn create next-app --example active-class-name active-class-name-app
```

### Download manually

Download the example:

```bash
curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/active-class-name
cd active-class-name
```

Install it and run:

```bash
npm install
npm run dev
# or
yarn
yarn dev
```

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)).
2 changes: 1 addition & 1 deletion examples/active-class-name/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"react": "^16.7.0",
"react-dom": "^16.7.0"
},
"license": "ISC"
"license": "MIT"
}
21 changes: 0 additions & 21 deletions examples/amp-first/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ Deploy the example using [Vercel](https://vercel.com):

## How to use

### Using `create-next-app`

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:

```bash
Expand All @@ -25,25 +23,6 @@ npx create-next-app --example amp-first amp-first-app
yarn create next-app --example amp-first amp-first-app
```

### Download manually

Download the example:

```bash
curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/amp-first
cd amp-first
```

Install it and run:

```bash
npm install
npm run dev
# or
yarn
yarn dev
```

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.

## Todo
Expand Down
2 changes: 1 addition & 1 deletion examples/amp-first/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"react": "^16.10.2",
"react-dom": "^16.10.2"
},
"license": "ISC"
"license": "MIT"
}
21 changes: 0 additions & 21 deletions examples/amp-story/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ Deploy the example using [Vercel](https://vercel.com):

## How to use

### Using `create-next-app`

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:

```bash
Expand All @@ -20,23 +18,4 @@ npx create-next-app --example amp-story amp-app
yarn create next-app --example amp-story amp-app
```

### Download manually

Download the example:

```bash
curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/amp-story
cd amp-story
```

Install it and run:

```bash
npm install
npm run dev
# or
yarn
yarn dev
```

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)).
2 changes: 1 addition & 1 deletion examples/amp-story/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"react": "^16.7.0",
"react-dom": "^16.7.0"
},
"license": "ISC"
"license": "MIT"
}
21 changes: 0 additions & 21 deletions examples/amp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ Deploy the example using [Vercel](https://vercel.com):

## How to use

### Using `create-next-app`

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:

```bash
Expand All @@ -20,23 +18,4 @@ npx create-next-app --example amp amp-app
yarn create next-app --example amp amp-app
```

### Download manually

Download the example:

```bash
curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/amp
cd amp
```

Install it and run:

```bash
npm install
npm run dev
# or
yarn
yarn dev
```

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)).
2 changes: 1 addition & 1 deletion examples/amp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"react": "^16.7.0",
"react-dom": "^16.7.0"
},
"license": "ISC"
"license": "MIT"
}
21 changes: 0 additions & 21 deletions examples/analyze-bundles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ Deploy the example using [Vercel](https://vercel.com):

## How to use

### Using `create-next-app`

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:

```bash
Expand All @@ -20,25 +18,6 @@ npx create-next-app --example analyze-bundles analyze-bundles-app
yarn create next-app --example analyze-bundles analyze-bundles-app
```

### Download manually

Download the example:

```bash
curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/analyze-bundles
cd analyze-bundles
```

Install it

```bash
npm install
npm run dev
# or
yarn
yarn dev
```

### Analyze webpack output

To analyze your webpack output, invoke the following command:
Expand Down
2 changes: 1 addition & 1 deletion examples/analyze-bundles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"react": "^16.8.0",
"react-dom": "^16.8.0"
},
"license": "ISC"
"license": "MIT"
}
21 changes: 0 additions & 21 deletions examples/api-routes-apollo-server-and-client-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ In this simple example, we integrate Apollo seamlessly with [Next.js data fetchi

## How to use

### Using `create-next-app`

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:

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

### Download manually

Download the example:

```bash
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
cd api-routes-apollo-server-and-client-auth
```

Install it and run:

```bash
npm install
npm run dev
# or
yarn
yarn dev
```

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)).
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
"react-dom": "^16.7.0",
"uuid": "8.1.0"
},
"license": "ISC"
"license": "MIT"
}
21 changes: 0 additions & 21 deletions examples/api-routes-apollo-server-and-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ In this simple example, we integrate Apollo seamlessly with [Next.js data fetchi

## How to use

### Using `create-next-app`

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:

```bash
Expand All @@ -16,23 +14,4 @@ npx create-next-app --example api-routes-apollo-server-and-client api-routes-apo
yarn create next-app --example api-routes-apollo-server-and-client api-routes-apollo-server-and-client-app
```

### Download manually

Download the example:

```bash
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
cd api-routes-apollo-server-and-client
```

Install it and run:

```bash
npm install
npm run dev
# or
yarn
yarn dev
```

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)).
2 changes: 1 addition & 1 deletion examples/api-routes-apollo-server-and-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"react": "^16.7.0",
"react-dom": "^16.7.0"
},
"license": "ISC"
"license": "MIT"
}
Loading

0 comments on commit 876f7f7

Please sign in to comment.