Skip to content

Commit

Permalink
Merge branch 'canary' into canary
Browse files Browse the repository at this point in the history
  • Loading branch information
oddnavy authored Apr 21, 2020
2 parents f31be3d + c60511c commit e820cdf
Show file tree
Hide file tree
Showing 199 changed files with 528 additions and 570 deletions.
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
### Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [abuse@zeit.co](mailto:abuse@zeit.co). All
reported by contacting the project team at [abuse@vercel.com](mailto:abuse@vercel.com). All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand Down
10 changes: 5 additions & 5 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to Next.js

Our Commitment to Open Source can be found [here](https://zeit.co/blog/oss)
Our Commitment to Open Source can be found [here](https://vercel.com/blog/oss)

1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device.
2. Create a new branch `git checkout -b MY_BRANCH_NAME`
Expand Down Expand Up @@ -123,7 +123,7 @@ When you add an example to the [examples](examples) directory, don’t forget to
- Fill in `Example Name` and `Description`.
- To add additional installation instructions, please add it where appropriate.
- To add additional notes, add `## Notes` section at the end.
- Remove the `Deploy your own` section if your example can’t be immediately deployed to ZEIT Now.
- Remove the `Deploy your own` section if your example can’t be immediately deployed to Vercel.

````markdown
# Example Name
Expand All @@ -132,9 +132,9 @@ Description

## Deploy your own

Deploy the example using [ZEIT Now](https://zeit.co/now):
Deploy the example using [Vercel](https://vercel.com/now):

[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/next.js/tree/canary/examples/DIRECTORY_NAME)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/next.js/tree/canary/examples/DIRECTORY_NAME)

## How to use

Expand Down Expand Up @@ -167,5 +167,5 @@ yarn
yarn dev
```

Deploy it to the cloud with [ZEIT Now](https://zeit.co/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
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 docs/advanced-features/multi-zones.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ There are no special zones related APIs. You only need to do following:

You can merge zones using any HTTP proxy.

For [ZEIT Now](https://zeit.co/now), you can use a single `now.json` to deploy both apps. It allows you to define routing routes for multiple apps like below:
For [Vercel](https://vercel.com/now), you can use a single `now.json` to deploy both apps. It allows you to define routing routes for multiple apps like below:

```json
{
Expand Down
2 changes: 1 addition & 1 deletion docs/api-reference/data-fetching/getInitialProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ description: Enable Server-Side Rendering in a page and do initial data populati

> `getInitialProps` will disable [Automatic Static Optimization](/docs/advanced-features/automatic-static-optimization.md).
`getInitialProps` is an [`async`](https://zeit.co/blog/async-and-await) function that can be added to any page as a [`static method`](https://javascript.info/static-properties-methods). Take a look at the following example:
`getInitialProps` is an [`async`](https://vercel.com/blog/async-and-await) function that can be added to any page as a [`static method`](https://javascript.info/static-properties-methods). Take a look at the following example:

```jsx
import fetch from 'isomorphic-unfetch'
Expand Down
4 changes: 2 additions & 2 deletions docs/api-reference/next.config.js/build-target.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Your application will be built and deployed as a monolith. This is the default t

## `serverless` target

> Deployments to [ZEIT Now](https://zeit.co) will automatically enable this target. You should not opt-into it yourself.
> Deployments to [Vercel](https://vercel.com) will automatically enable this target. You should not opt-into it yourself.
This target will output independent pages that don't require a monolithic server.

It's only compatible with `next start` or Serverless deployment platforms (like [ZEIT Now](https://zeit.co)) — you cannot use the custom server API.
It's only compatible with `next start` or Serverless deployment platforms (like [Vercel](https://vercel.com)) — you cannot use the custom server API.

To opt-into this target, set the following configuration in your `next.config.js`:

Expand Down
4 changes: 2 additions & 2 deletions docs/api-reference/next/link.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ import Link from 'next/link'
function Home() {
return (
<div>
<Link href={{ pathname: '/about', query: { name: 'ZEIT' } }}>
<Link href={{ pathname: '/about', query: { name: 'test' } }}>
<a>About us</a>
</Link>
</div>
Expand All @@ -150,7 +150,7 @@ function Home() {
export default Home
```

The above example will be a link to `/about?name=ZEIT`. You can use every property as defined in the [Node.js URL module documentation](https://nodejs.org/api/url.html#url_url_strings_and_url_objects).
The above example will be a link to `/about?name=test`. You can use every property as defined in the [Node.js URL module documentation](https://nodejs.org/api/url.html#url_url_strings_and_url_objects).

## Replace the URL instead of push

Expand Down
30 changes: 15 additions & 15 deletions docs/deployment.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
---
description: Deploy your Next.js app to production with ZEIT Now and other hosting options.
description: Deploy your Next.js app to production with Vercel and other hosting options.
---

# Deployment

## ZEIT Now (Recommended)
## Vercel (Recommended)

The easiest way to deploy Next.js to production is to use the **[ZEIT Now platform](https://zeit.co)** from the creators of Next.js. [ZEIT Now](https://zeit.co) is an all-in-one platform with Global CDN supporting static & JAMstack deployment and Serverless Functions.
The easiest way to deploy Next.js to production is to use the **[Vercel platform](https://vercel.com)** from the creators of Next.js. [Vercel](https://vercel.com) is an all-in-one platform with Global CDN supporting static & JAMstack deployment and Serverless Functions.

### Getting started

If you haven’t already done so, push your Next.js app to a Git provider of your choice: [GitHub](http://github.com/), [GitLab](https://gitlab.com/), or [BitBucket](https://bitbucket.org/). Your repository can be private or public.

Then, follow these steps:

1. [Sign up to ZEIT Now](https://zeit.co/signup) (no credit card is required).
2. After signing up, you’ll arrive on the [“Import Project”](https://zeit.co/import) page. Under “From Git Repository”, choose the Git provider you use and set up an integration. (Instructions: [GitHub](https://zeit.co/docs/v2/git-integrations/zeit-now-for-github) / [GitLab](https://zeit.co/docs/v2/git-integrations/zeit-now-for-gitlab) / [BitBucket](https://zeit.co/docs/v2/git-integrations/zeit-now-for-bitbucket)).
1. [Sign up to Vercel](https://vercel.com/signup) (no credit card is required).
2. After signing up, you’ll arrive on the [“Import Project”](https://vercel.com/import) page. Under “From Git Repository”, choose the Git provider you use and set up an integration. (Instructions: [GitHub](https://vercel.com/docs/v2/git-integrations/zeit-now-for-github) / [GitLab](https://vercel.com/docs/v2/git-integrations/zeit-now-for-gitlab) / [BitBucket](https://vercel.com/docs/v2/git-integrations/zeit-now-for-bitbucket)).
3. Once that’s set up, click “Import Project From …” and import your Next.js app. It auto-detects that your app is using Next.js and sets up the build configuration for you. No need to change anything — everything should work just fine!
4. After importing, it’ll deploy your Next.js app and provide you with a deployment URL. Click “Visit” to see your app in production.

Congratulations! You’ve just deployed your Next.js app! If you have questions, take a look at the [ZEIT Now documentation](https://zeit.co/docs).
Congratulations! You’ve just deployed your Next.js app! If you have questions, take a look at the [Vercel documentation](https://vercel.com/docs).

> If you’re using a [custom server](/docs/advanced-features/custom-server.md), we strongly recommend migrating away from it (for example, by using [dynamic routing](/docs/routing/dynamic-routes.md)). If you cannot migrate, consider [other hosting options](#other-hosting-options).
### DPS: Develop, Preview, Ship

Let’s talk about the workflow we recommend using. [ZEIT Now](https://zeit.co) supports what we call the **DPS** workflow: **D**evelop, **P**review, and **S**hip:
Let’s talk about the workflow we recommend using. [Vercel](https://vercel.com) supports what we call the **DPS** workflow: **D**evelop, **P**review, and **S**hip:

- **Develop:** Write code in Next.js. Keep the development server running and take advantage of its hot code reloading feature.
- **Preview:** Every time you push changes to a branch on GitHub / GitLab / BitBucket, ZEIT Now automatically creates a new deployment with a unique URL. You can view them on GitHub when you open a pull request, or under “Preview Deployments” on your project page on ZEIT Now. [Learn more about it here](https://zeit.co/features/deployment-previews).
- **Ship:** When you’re ready to ship, merge the pull request to your default branch (e.g. `master`). ZEIT Now will automatically create a production deployment.
- **Preview:** Every time you push changes to a branch on GitHub / GitLab / BitBucket, Vercel automatically creates a new deployment with a unique URL. You can view them on GitHub when you open a pull request, or under “Preview Deployments” on your project page on Vercel. [Learn more about it here](https://vercel.com/features/deployment-previews).
- **Ship:** When you’re ready to ship, merge the pull request to your default branch (e.g. `master`). Vercel will automatically create a production deployment.

By using the DPS workflow, in addition to doing _code reviews_, you can do _deployment previews_. Each deployment creates a unique URL that can be shared or used for integration tests.

### Optimized for Next.js

[ZEIT Now](https://zeit.co) is made by the creators of Next.js and has first-class support for Next.js.
[Vercel](https://vercel.com) is made by the creators of Next.js and has first-class support for Next.js.

For example, the [hybrid pages](/docs/basic-features/pages.md) approach is fully supported out of the box.

- Every page can either use [Static Generation](/docs/basic-features/pages.md#static-generation) or [Server-Side Rendering](/docs/basic-features/pages.md#server-side-rendering).
- Pages that use [Static Generation](/docs/basic-features/pages.md#static-generation) and assets (JS, CSS, images, fonts, etc) will automatically be served from the [ZEIT Now Smart CDN](https://zeit.co/smart-cdn), which is blazingly fast.
- Pages that use [Static Generation](/docs/basic-features/pages.md#static-generation) and assets (JS, CSS, images, fonts, etc) will automatically be served from the [Vercel Smart CDN](https://vercel.com/smart-cdn), which is blazingly fast.
- Pages that use [Server-Side Rendering](/docs/basic-features/pages.md#server-side-rendering) and [API routes](/docs/api-routes/introduction.md) will automatically become isolated Serverless Functions. This allows page rendering and API requests to scale infinitely.

### Custom Domains, Environment Variables, Automatic HTTPS, and more

- **Custom Domains:** Once deployed on [ZEIT Now](https://zeit.co), you can assign a custom domain to your Next.js app. Take a look at [our documentation here](https://zeit.co/docs/v2/custom-domains).
- **Environment Variables:** You can also set environment variables on ZEIT Now. Take a look at [our documentation here](https://zeit.co/docs/v2/build-step#using-environment-variables-and-secrets). You can then [use those environment variables](/docs/api-reference/next.config.js/environment-variables.md) in your Next.js app.
- **Custom Domains:** Once deployed on [Vercel](https://vercel.com), you can assign a custom domain to your Next.js app. Take a look at [our documentation here](https://vercel.com/docs/v2/custom-domains).
- **Environment Variables:** You can also set environment variables on Vercel. Take a look at [our documentation here](https://vercel.com/docs/v2/build-step#using-environment-variables-and-secrets). You can then [use those environment variables](/docs/api-reference/next.config.js/environment-variables.md) in your Next.js app.
- **Automatic HTTPS:** HTTPS is enabled by default (including custom domains) and doesn't require extra configuration. We auto-renew SSL certificates.
- **More:** [Read our documentation](https://zeit.co/docs) to learn more about the ZEIT Now platform.
- **More:** [Read our documentation](https://vercel.com/docs) to learn more about the Vercel platform.

## Other hosting options

Expand All @@ -74,4 +74,4 @@ Make sure your `package.json` has the `"build"` and `"start"` scripts:

If you’d like to do a static HTML export of your Next.js app, follow the directions on [our documentation](/docs/advanced-features/static-html-export.md). By default, `next export` will generate an `out` directory, which can be served by any static hosting service or CDN.

> We strongly recommend using [ZEIT Now](https://zeit.co/) even if your Next.js app is fully static. [ZEIT Now](https://zeit.co/) is optimized to make static Next.js apps blazingly fast. `next export` works with Zero Config deployments on ZEIT Now.
> We strongly recommend using [Vercel](https://vercel.com/) even if your Next.js app is fully static. [Vercel](https://vercel.com/) is optimized to make static Next.js apps blazingly fast. `next export` works with Zero Config deployments on Vercel.
2 changes: 1 addition & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: Get to know more about Next.js with the frequently asked questions.

<details>
<summary>Is this production ready?</summary>
<p>Next.js has been powering <a href="https://zeit.co">https://zeit.co</a>  since its inception.</p>
<p>Next.js has been powering <a href="https://vercel.com">https://vercel.com</a>  since its inception.</p>

<p>We’re ecstatic about both the developer experience and end-user performance, so we decided to share it with the community.</p>
</details>
Expand Down
4 changes: 2 additions & 2 deletions docs/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ description: Learn how to upgrade Next.js.

### Preamble

#### Production Deployment on ZEIT Now v2
#### Production Deployment on Vercel

If you previously configured `routes` in your `now.json` file for dynamic routes, these rules can be removed when leveraging Next.js 9's new [Dynamic Routing feature](https://nextjs.org/docs/routing/dynamic-routes).

Next.js 9's dynamic routes are **automatically configured on [Now](https://zeit.co/now)** and do not require any `now.json` customization.
Next.js 9's dynamic routes are **automatically configured on [Now](https://vercel.com/now)** and do not require any `now.json` customization.

You can read more about [Dynamic Routing here](https://nextjs.org/docs/routing/dynamic-routes).

Expand Down
2 changes: 1 addition & 1 deletion errors/api-routes-static-export.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This command is meant for static-only hosts, and is not necessary to make your a

#### Possible Ways to Fix It

Use `next build` with platforms that don't require `next export` like https://zeit.co or remove any paths using API routes from your `exportPathMap` in `next.config.js`.
Use `next build` with platforms that don't require `next export` like https://vercel.com or remove any paths using API routes from your `exportPathMap` in `next.config.js`.

### Useful Links

Expand Down
2 changes: 1 addition & 1 deletion errors/build-dir-not-writeable.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#### Why This Error Occurred

The filesystem does not allow writing to the specified directory. A common cause for this error is starting a [custom server](https://nextjs.org/docs#custom-server-and-routing) in development mode on a production server, for example, [now.sh](https://zeit.co) which [doesn't allow you to write to the filesystem after your app is built](https://zeit.co/docs/deployment-types/node#file-system-specifications).
The filesystem does not allow writing to the specified directory. A common cause for this error is starting a [custom server](https://nextjs.org/docs#custom-server-and-routing) in development mode on a production server, for example, [Vercel](https://vercel.com) which [doesn't allow you to write to the filesystem after your app is built](https://vercel.com/docs/deployment-types/node#file-system-specifications).

#### Possible Ways to Fix It

Expand Down
2 changes: 1 addition & 1 deletion errors/no-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Configure Next.js' cache to be persisted across builds. Next.js stores its cache

Storing this folder across builds varies by CI provider. We've provided a list of a few common providers below.

#### ZEIT Now
#### Vercel

Next.js caching is automatically configured for you. There's no action required on your part.

Expand Down
6 changes: 3 additions & 3 deletions examples/active-class-name/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ ReactRouter has a convenience property on the `Link` element to allow an author

## Deploy your own

Deploy the example using [ZEIT Now](https://zeit.co/now):
Deploy the example using [Vercel](https://vercel.com):

[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/next.js/tree/canary/examples/active-class-name)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/next.js/tree/canary/examples/active-class-name)

## How to use

Expand Down Expand Up @@ -39,4 +39,4 @@ yarn
yarn dev
```

Deploy it to the cloud with [ZEIT Now](https://zeit.co/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
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)).
6 changes: 3 additions & 3 deletions examples/amp-first/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ This example sets up the boilerplate for an AMP First Site. You can see a live v

## Deploy your own

Deploy the example using [ZEIT Now](https://zeit.co/now):
Deploy the example using [Vercel](https://vercel.com):

[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/next.js/tree/canary/examples/amp-first)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/next.js/tree/canary/examples/amp-first)

## How to use

Expand Down Expand Up @@ -97,4 +97,4 @@ To start the application in production mode, run:
$ yarn start
```

Deploy it to the cloud with [ZEIT Now](https://zeit.co/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
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-first/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ const Home = props => (

// amp-script requires absolute URLs, so we create a property `host` which we can use to calculate the script URL.
export async function getServerSideProps({ req }) {
// WARNING: This is a generally unsafe application unless you're deploying to a managed platform like ZEIT Now.
// WARNING: This is a generally unsafe application unless you're deploying to a managed platform like Vercel.
// Be sure your load balancer is configured to not allow spoofed host headers.
return { props: { host: `${getProtocol(req)}://${req.headers.host}` } }
}
Expand Down
Loading

0 comments on commit e820cdf

Please sign in to comment.