diff --git a/.circleci/config.yml b/.circleci/config.yml index d7621b77c1386..b10f6d1dfe2a2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,12 +35,27 @@ commands: steps: - run: name: Installing Dependencies - command: yarn install --frozen-lockfile + command: yarn install --frozen-lockfile --check-files + - run: + name: Install correct Chrome Driver version + command: yarn add chromedriver@76 -W && git checkout yarn.lock package.json + - run: google-chrome --version + - run: chromedriver --version yarn_lint: steps: - run: name: Linting command: yarn lint + yarn_react_integration: + steps: + - run: + name: Upgrade to most recent release in React's Next channel + command: yarn upgrade react@next react-dom@next -W --dev # upgrade (vs add) will skip re-building Next.js, which doesn't bundle React internals (so this is OK!) + yarn_info: + steps: + - run: + name: React Versions + command: yarn why react && yarn why react-dom test_all: steps: - run: @@ -114,11 +129,18 @@ jobs: - yarn_install - yarn_lint - *persist_to_workspace + build-react-canary: + executor: node + steps: + - *attach_workspace + - yarn_react_integration + - *persist_to_workspace test: parallelism: 3 executor: node steps: - *attach_workspace + - yarn_info - test_all - *store_test_results test-ie11: @@ -196,3 +218,19 @@ workflows: only: - master - canary + q12h-react-canary: + triggers: + - schedule: + cron: '0 0,12 * * *' + filters: + branches: + only: + - canary + jobs: + - build + - build-react-canary: + requires: + - build + - test: + requires: + - build-react-canary diff --git a/README-zh-CN.md b/README-zh-CN.md index fb07b8038531f..9061ab8bb3677 100644 --- a/README-zh-CN.md +++ b/README-zh-CN.md @@ -133,7 +133,7 @@ export default () =>
hi there
### 静态文件服务(如图像) -在根目录下新建文件夹叫`static`。代码可以通过`/static/`来引入相关的静态资源。 +在根目录下新建文件夹叫`public`。代码可以通过`/`来引入相关的静态资源。 ```jsx -export default () =>This is an AMP Story.
++ This is the about page, navigating between this page and Home is + always pretty fast. However, when you navigate to the Profile{' '} + page it takes more time because it uses SSR to fetch the user first; +
+nickname: {user.nickname}
+name: {user.name}
+Loading login info...
} + + {!loading && !user && ( + <> ++ To test the login click in Login +
++ Once you have logged in you should be able to click in{' '} + Profile and Logout +
+ > + )} + + {user && ( + <> +nickname: {user.nickname}
+name: {user.name}
+ > + )} +nickname: {user.nickname}
+name: {user.name}
+Counter: {count}
+ + ++ + Home + +
+ > + ) } + +export default AboutPage diff --git a/examples/with-context-api/pages/index.js b/examples/with-context-api/pages/index.js index c0511575d49b5..c047908819e55 100644 --- a/examples/with-context-api/pages/index.js +++ b/examples/with-context-api/pages/index.js @@ -1,27 +1,33 @@ -import React, { Component } from 'react' +import React from 'react' import Link from 'next/link' -/* First we import the consumer */ -import { CounterConsumer } from '../components/CounterProvider' +import { useCount, useDispatchCount } from '../components/Counter' -export default class index extends Component { - render () { - return ( - /* Then we use our context through render props */ -Counter: {count}
+ + ++ + About + +
+ > + ) } + +export default IndexPage diff --git a/examples/with-cookie-auth/README.md b/examples/with-cookie-auth/README.md index 616ff4c0a95dd..a41cd5452ba2e 100644 --- a/examples/with-cookie-auth/README.md +++ b/examples/with-cookie-auth/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Download [`create-next-app`](https://github.com/segmentio/create-next-app) to bootstrap the example: +Download [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) to bootstrap the example: ``` npm i -g create-next-app diff --git a/examples/with-custom-babel-config/README.md b/examples/with-custom-babel-config/README.md index e4d84238e1261..d8120318f3b41 100644 --- a/examples/with-custom-babel-config/README.md +++ b/examples/with-custom-babel-config/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-custom-babel-config with-custom-babel-config-app diff --git a/examples/with-custom-reverse-proxy/README.md b/examples/with-custom-reverse-proxy/README.md index a520c4af9f455..70323218f2f14 100644 --- a/examples/with-custom-reverse-proxy/README.md +++ b/examples/with-custom-reverse-proxy/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-custom-reverse-proxy with-custom-reverse-proxy-app diff --git a/examples/with-cxs/README.md b/examples/with-cxs/README.md index 09458bf7380ce..9fdb2392affbc 100644 --- a/examples/with-cxs/README.md +++ b/examples/with-cxs/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-cxs with-cxs-app diff --git a/examples/with-data-prefetch/README.md b/examples/with-data-prefetch/README.md index 26bedd163050d..ff07117444035 100644 --- a/examples/with-data-prefetch/README.md +++ b/examples/with-data-prefetch/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-data-prefetch with-data-prefetch-app diff --git a/examples/with-docker/README.md b/examples/with-docker/README.md index bd1ef19113f56..ae18ad304f9e3 100644 --- a/examples/with-docker/README.md +++ b/examples/with-docker/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-docker with-docker-app diff --git a/examples/with-dotenv/README.md b/examples/with-dotenv/README.md index 3127b598a70e8..6ec6626115068 100644 --- a/examples/with-dotenv/README.md +++ b/examples/with-dotenv/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-dotenv with-dotenv-app diff --git a/examples/with-draft-js/README.md b/examples/with-draft-js/README.md index 8baaa3d45d4fc..7c4a018fea52d 100644 --- a/examples/with-draft-js/README.md +++ b/examples/with-draft-js/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-draft-js diff --git a/examples/with-dynamic-app-layout/readme.md b/examples/with-dynamic-app-layout/readme.md index d97f911887ed8..4b3155d307408 100644 --- a/examples/with-dynamic-app-layout/readme.md +++ b/examples/with-dynamic-app-layout/readme.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-dynamic-app-layout with-dynamic-app-layout-app diff --git a/examples/with-dynamic-import/README.md b/examples/with-dynamic-import/README.md index 356cc3459f05e..82134931f2744 100644 --- a/examples/with-dynamic-import/README.md +++ b/examples/with-dynamic-import/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-dynamic-import with-dynamic-import-app diff --git a/examples/with-electron-typescript/README.md b/examples/with-electron-typescript/README.md index d1b12af4f90ab..cacc6b8bf7d35 100644 --- a/examples/with-electron-typescript/README.md +++ b/examples/with-electron-typescript/README.md @@ -6,7 +6,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-electron-typescript with-electron-typescript-app diff --git a/examples/with-electron/README.md b/examples/with-electron/README.md index 7f392cac21ef3..79c1ff2c1ea24 100644 --- a/examples/with-electron/README.md +++ b/examples/with-electron/README.md @@ -6,7 +6,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-electron with-electron-app diff --git a/examples/with-emotion-fiber/README.md b/examples/with-emotion-fiber/README.md index 364fc921e2e7e..a4466b4068c6d 100644 --- a/examples/with-emotion-fiber/README.md +++ b/examples/with-emotion-fiber/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-emotion-fiber with-emotion-fiber-app diff --git a/examples/with-emotion/README.md b/examples/with-emotion/README.md index f62b3b417de2f..93ab2cbe513b6 100644 --- a/examples/with-emotion/README.md +++ b/examples/with-emotion/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-emotion with-emotion-app diff --git a/examples/with-env-from-next-config-js/README.md b/examples/with-env-from-next-config-js/README.md index d44e11c359534..899c196e28080 100644 --- a/examples/with-env-from-next-config-js/README.md +++ b/examples/with-env-from-next-config-js/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-env-from-next-config-app diff --git a/examples/with-external-styled-jsx-sass/README.md b/examples/with-external-styled-jsx-sass/README.md index 81b938d310b43..9e14442f9d7dd 100644 --- a/examples/with-external-styled-jsx-sass/README.md +++ b/examples/with-external-styled-jsx-sass/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-external-styled-jsx-sass with-external-styled-jsx-sass-app diff --git a/examples/with-fela/README.md b/examples/with-fela/README.md index 937f4f3d0dd5a..fb7013ee111a5 100755 --- a/examples/with-fela/README.md +++ b/examples/with-fela/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-fela with-fela-app diff --git a/examples/with-firebase-authentication/README.md b/examples/with-firebase-authentication/README.md index 601f9d8920977..e7b3feda64e0e 100644 --- a/examples/with-firebase-authentication/README.md +++ b/examples/with-firebase-authentication/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-firebase-authentication with-firebase-authentication-app diff --git a/examples/with-firebase-hosting-and-docker/README.md b/examples/with-firebase-hosting-and-docker/README.md index 50e2586310c9e..ce4761e158049 100644 --- a/examples/with-firebase-hosting-and-docker/README.md +++ b/examples/with-firebase-hosting-and-docker/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-firebase-hosting-and-docker with-firebase-hosting-and-docker-app diff --git a/examples/with-firebase-hosting-and-typescript/README.md b/examples/with-firebase-hosting-and-typescript/README.md index 35a191813cb1b..2b6df506b9aa2 100644 --- a/examples/with-firebase-hosting-and-typescript/README.md +++ b/examples/with-firebase-hosting-and-typescript/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-firebase-hosting-and-typescript with-firebase-hosting-and-typescript-app diff --git a/examples/with-firebase-hosting/README.md b/examples/with-firebase-hosting/README.md index 13bb7feb5e442..3c3f89559677e 100644 --- a/examples/with-firebase-hosting/README.md +++ b/examples/with-firebase-hosting/README.md @@ -4,7 +4,7 @@ **Using `create-next-app`** -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-firebase-hosting with-firebase-hosting-app diff --git a/examples/with-flow/README.md b/examples/with-flow/README.md index ab1349e3ff94c..9e9ef5d7031bf 100644 --- a/examples/with-flow/README.md +++ b/examples/with-flow/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-flow with-flow-app diff --git a/examples/with-freactal/README.md b/examples/with-freactal/README.md index 8f9c1f777985c..2460c17458530 100644 --- a/examples/with-freactal/README.md +++ b/examples/with-freactal/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-freactal with-freactal-app diff --git a/examples/with-glamor/README.md b/examples/with-glamor/README.md index bbff0f9d90d9f..dc833821cb2fd 100644 --- a/examples/with-glamor/README.md +++ b/examples/with-glamor/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-glamor with-glamor-app diff --git a/examples/with-glamorous/README.md b/examples/with-glamorous/README.md index fd4386babe80c..1b9a02340bb9e 100644 --- a/examples/with-glamorous/README.md +++ b/examples/with-glamorous/README.md @@ -6,7 +6,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-glamorous with-glamorous-app diff --git a/examples/with-google-analytics/README.md b/examples/with-google-analytics/README.md index 69298c873e0bc..2c3982b5fbe4b 100644 --- a/examples/with-google-analytics/README.md +++ b/examples/with-google-analytics/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Download [`create-next-app`](https://github.com/segmentio/create-next-app) to bootstrap the example: +Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) to bootstrap the example: ```bash npx create-next-app --example with-google-analytics with-google-analytics-app diff --git a/examples/with-graphql-hooks/README.md b/examples/with-graphql-hooks/README.md index accc427da7a3d..55b063087eaad 100644 --- a/examples/with-graphql-hooks/README.md +++ b/examples/with-graphql-hooks/README.md @@ -10,7 +10,7 @@ https://next-with-graphql-hooks.now.sh ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-graphql-hooks with-graphql-hooks-app diff --git a/examples/with-grommet/README.md b/examples/with-grommet/README.md index 1cf03b4bbdcf5..f69a02aff2a3a 100644 --- a/examples/with-grommet/README.md +++ b/examples/with-grommet/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-grommet with-grommet-app diff --git a/examples/with-hashed-statics/README.md b/examples/with-hashed-statics/README.md index f4d561f389e05..2a719ae8fa640 100644 --- a/examples/with-hashed-statics/README.md +++ b/examples/with-hashed-statics/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-hashed-statics with-hashed-statics-app diff --git a/examples/with-higher-order-component/README.md b/examples/with-higher-order-component/README.md index c9b5269ad2256..fb1b136c78c75 100644 --- a/examples/with-higher-order-component/README.md +++ b/examples/with-higher-order-component/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Download [`create-next-app`](https://github.com/segmentio/create-next-app) to +Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) to bootstrap the example: ```bash diff --git a/examples/with-http2/README.md b/examples/with-http2/README.md index a40282086b1fb..efce7b7cf3b54 100644 --- a/examples/with-http2/README.md +++ b/examples/with-http2/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-http2 with-http2-app diff --git a/examples/with-immutable-redux-wrapper/README.md b/examples/with-immutable-redux-wrapper/README.md index d4de2196fdaf9..7fdf1902a58cb 100644 --- a/examples/with-immutable-redux-wrapper/README.md +++ b/examples/with-immutable-redux-wrapper/README.md @@ -1,12 +1,12 @@ # Immutable Redux Example -> This example and documentation is based on the [with-redux](https://github.com/zeit/next.js/tree/master/examples/with-redux) example. +> This example and documentation is based on the [with-redux-wrapper](https://github.com/zeit/next.js/tree/master/examples/with-redux-wrapper) example. ## How to use ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-immutable-redux-wrapper with-immutable-redux-wrapper-app diff --git a/examples/with-immutable-redux-wrapper/package.json b/examples/with-immutable-redux-wrapper/package.json index 6680fe1e33d64..0077829e4eba7 100644 --- a/examples/with-immutable-redux-wrapper/package.json +++ b/examples/with-immutable-redux-wrapper/package.json @@ -9,7 +9,7 @@ "dependencies": { "immutable": "4.0.0-rc.9", "next": "latest", - "next-redux-wrapper": "2.0.0-beta.6", + "next-redux-wrapper": "4.0.1", "react": "^16.7.0", "react-dom": "^16.7.0", "react-redux": "^5.0.1", diff --git a/examples/with-ioc/README.md b/examples/with-ioc/README.md index f540b48bf3296..b8b2fc2252099 100644 --- a/examples/with-ioc/README.md +++ b/examples/with-ioc/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-ioc with-ioc-app diff --git a/examples/with-jest-flow/README.md b/examples/with-jest-flow/README.md index f1387a0d0f53b..f6ad8dee410db 100644 --- a/examples/with-jest-flow/README.md +++ b/examples/with-jest-flow/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-jest-flow with-jest-flow-app diff --git a/examples/with-jest-react-testing-library/README.md b/examples/with-jest-react-testing-library/README.md index a0010e4816d2d..788d96f746335 100644 --- a/examples/with-jest-react-testing-library/README.md +++ b/examples/with-jest-react-testing-library/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-jest-react-testing-library with-rtl-app diff --git a/examples/with-jest-typescript/README.md b/examples/with-jest-typescript/README.md index b308b367f2c51..0bb7ac9611ae7 100644 --- a/examples/with-jest-typescript/README.md +++ b/examples/with-jest-typescript/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-jest-typescript with-jest-typescript-app diff --git a/examples/with-jest/README.md b/examples/with-jest/README.md index 69771ad5669c3..b8fdadb096775 100644 --- a/examples/with-jest/README.md +++ b/examples/with-jest/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-jest with-jest-app diff --git a/examples/with-kea/README.md b/examples/with-kea/README.md index 10b85d8659eef..70bc8c1150351 100644 --- a/examples/with-kea/README.md +++ b/examples/with-kea/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-kea with-kea-app diff --git a/examples/with-linaria/README.md b/examples/with-linaria/README.md index 49fce57a0f2fc..d015858f35e57 100644 --- a/examples/with-linaria/README.md +++ b/examples/with-linaria/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-linaria with-linaria-app diff --git a/examples/with-lingui/README.md b/examples/with-lingui/README.md index 92c7eef45a7c8..92406b0d41d98 100644 --- a/examples/with-lingui/README.md +++ b/examples/with-lingui/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-lingui with-lingui-app diff --git a/examples/with-loading/README.md b/examples/with-loading/README.md index ee5c28452d40e..c7150303037e9 100644 --- a/examples/with-loading/README.md +++ b/examples/with-loading/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-loading with-loading-app diff --git a/examples/with-loading/pages/_app.js b/examples/with-loading/pages/_app.js index 9ac9e58343d7b..5cb5ecc33b7e6 100644 --- a/examples/with-loading/pages/_app.js +++ b/examples/with-loading/pages/_app.js @@ -19,7 +19,7 @@ export default class MyApp extends App { <> {/* Import CSS for nprogress */} - + - - -Disable JavaScript to see it in action:
-class Index extends React.Component { - static getInitialProps (context) { - const { isServer } = context - return { isServer } - } - render () { - return ( -+ This modal is rendered using{' '} + + portals + + . +
+ ++ Automatically prefetch pages in the background as soon the Link appears + in the view: +
+ + Home + {' '} + + Features + +Prefetch on onMouseEnter or on other events:
+ + { + router.prefetch('/about') + console.log('prefetching /about!') + }} + > + About + + +Disable prefetching
+ + Contact + + +This is the ABOUT page.
+export default () =>This is the CONTACT page.
+export default () =>This is the FEATURES page.
+export default () =>This is the HOME page
+export default () =>Loading ...
+}) + +const modules = { + toolbar: [ + [{ header: '1' }, { header: '2' }, { font: [] }], + [{ size: [] }], + ['bold', 'italic', 'underline', 'strike', 'blockquote'], + [ + { list: 'ordered' }, + { list: 'bullet' }, + { indent: '-1' }, + { indent: '+1' } + ], + ['link', 'image', 'video'], + ['clean'] + ], + clipboard: { + // toggle to add extra line breaks when pasting HTML: + matchVisual: false + } +} +/* + * Quill editor formats + * See https://quilljs.com/docs/formats/ + */ +const formats = [ + 'header', + 'font', + 'size', + 'bold', + 'italic', + 'underline', + 'strike', + 'blockquote', + 'list', + 'bullet', + 'indent', + 'link', + 'image', + 'video' +] + +export default () => ( +Was this tool helpful? Let us know how we can improve it
diff --git a/examples/with-react-css-modules/README.md b/examples/with-react-css-modules/README.md index d92f5e281ac5b..8f32080a87ad3 100644 --- a/examples/with-react-css-modules/README.md +++ b/examples/with-react-css-modules/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-react-css-modules with-react-css-modules-app diff --git a/examples/with-react-esi/README.md b/examples/with-react-esi/README.md index 38e3f70cbdfca..8d567475579cc 100644 --- a/examples/with-react-esi/README.md +++ b/examples/with-react-esi/README.md @@ -6,7 +6,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-react-esi with-react-esi-app diff --git a/examples/with-react-ga/README.md b/examples/with-react-ga/README.md index 49b2013d86a73..82731e3ba4c1c 100644 --- a/examples/with-react-ga/README.md +++ b/examples/with-react-ga/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-react-ga with-react-ga-app diff --git a/examples/with-react-helmet/README.md b/examples/with-react-helmet/README.md index 15f7c3c4fa988..4b5d91e476287 100644 --- a/examples/with-react-helmet/README.md +++ b/examples/with-react-helmet/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-react-helmet with-react-helmet-app diff --git a/examples/with-react-intl/README.md b/examples/with-react-intl/README.md index 79f106f58fcc3..1c13d3c6a95c2 100644 --- a/examples/with-react-intl/README.md +++ b/examples/with-react-intl/README.md @@ -4,7 +4,7 @@ ### Using `create-next-app` -Execute [`create-next-app`](https://github.com/segmentio/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: +Execute [`create-next-app`](https://github.com/zeit/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 npx create-next-app --example with-react-intl with-react-intl-app diff --git a/examples/with-react-intl/pages/_app.js b/examples/with-react-intl/pages/_app.js index 93316278bb06a..c461e637ac7a5 100644 --- a/examples/with-react-intl/pages/_app.js +++ b/examples/with-react-intl/pages/_app.js @@ -1,9 +1,13 @@ import App from 'next/app' import React from 'react' -import { IntlProvider } from 'react-intl' +import { createIntl, createIntlCache, RawIntlProvider } from 'react-intl' + +// This is optional but highly recommended +// since it prevents memory leak +const cache = createIntlCache() export default class MyApp extends App { - static async getInitialProps ({ Component, router, ctx }) { + static async getInitialProps ({ Component, ctx }) { let pageProps = {} if (Component.getInitialProps) { @@ -21,10 +25,18 @@ export default class MyApp extends App { render () { const { Component, pageProps, locale, messages } = this.props + const intl = createIntl( + { + locale, + messages + }, + cache + ) + return ( -