Skip to content

Commit

Permalink
Merge branch 'canary' into basePathz
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot authored Jul 30, 2020
2 parents aec5b40 + 9d68a36 commit 9e3d066
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ By using the DPS workflow, in addition to doing _code reviews_, you can do _depl
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 [Vercel Smart CDN](https://vercel.com/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's Edge Network](https://vercel.com/docs/v2/edge-network/overview), 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
Expand Down
10 changes: 5 additions & 5 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ Open `package.json` and add the following `scripts`:

```json
"scripts": {
"dev": "next",
"dev": "next dev",
"build": "next build",
"start": "next start"
}
```

These scripts refer to the different stages of developing an application:

- `dev` - Runs `next` which starts Next.js in development mode
- `build` - Runs `next build` which builds the application for production usage
- `start` - Runs `next start` which starts a Next.js production server
- `dev` - Runs [`next dev`](/docs/api-reference/cli#development) which starts Next.js in development mode
- `build` - Runs [`next build`](/docs/api-reference/cli#build) which builds the application for production usage
- `start` - Runs [`next start`](/docs/api-reference/cli#production) which starts a Next.js production server

Next.js is built around the concept of pages. A page is a [React Component](https://reactjs.org/docs/components-and-props.html) exported from a `.js`, `.jsx`, `.ts`, or `.tsx` file in the `pages` directory.
Next.js is built around the concept of [pages](/docs/basic-features/pages.md). A page is a [React Component](https://reactjs.org/docs/components-and-props.html) exported from a `.js`, `.jsx`, `.ts`, or `.tsx` file in the `pages` directory.

Pages are associated with a route based on their file name. For example `pages/about.js` is mapped to `/about`. You can even add dynamic route parameters with the filename.

Expand Down
4 changes: 1 addition & 3 deletions examples/with-sentry/pages/_error.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import NextErrorComponent from 'next/error'
import * as Sentry from '@sentry/node'

const MyError = async ({ statusCode, hasGetInitialPropsRun, err }) => {
const MyError = ({ statusCode, hasGetInitialPropsRun, err }) => {
if (!hasGetInitialPropsRun && err) {
// getInitialProps is not called in case of
// https://github.com/vercel/next.js/issues/8592. As a workaround, we pass
// err via _app.js so it can be captured
Sentry.captureException(err)
// flush is needed after calling captureException to send server side errors to Sentry, otherwise the serverless function will exit before it's sent
await Sentry.flush(2000)
}

return <NextErrorComponent statusCode={statusCode} />
Expand Down

0 comments on commit 9e3d066

Please sign in to comment.