Skip to content

Commit 0cd2732

Browse files
mcsdevvTimer
authored andcommitted
Remove deploy to now button from all examples (vercel#7101)
1 parent e27203f commit 0cd2732

File tree

63 files changed

+189
-147
lines changed

Some content is hidden

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

63 files changed

+189
-147
lines changed

examples/amp/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ now
3939

4040
## The idea behind the example
4141

42-
This example shows how to create AMP pages using Next.js and the experimental AMP feature. It shows a normal page (non-AMP), an AMP only page, and a hybrid AMP page.
42+
This example shows how to create AMP pages using Next.js and the experimental AMP feature. It shows a normal page (non-AMP), an AMP only page, and a hybrid AMP page.

examples/custom-server-fastify/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ npm run dev
3030
yarn
3131
yarn dev
3232
```
33+
3334
Fastify
3435
Deploy it to the cloud with [now](https://zeit.co/now) ([download](https://zeit.co/download))
3536

examples/custom-server-koa/README.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ Because the Next.js server is just a node.js module you can combine it with any
4545

4646
The example shows a server that serves the component living in `pages/a.js` when the route `/b` is requested and `pages/b.js` when the route `/a` is accessed. This is obviously a non-standard routing strategy. You can see how this custom routing is being made inside `server.js`.
4747

48-
4948
## Side note: Enabling gzip compression
5049

5150
The most common Koa middleware for handling the gzip compression is [compress](https://github.com/koajs/compress), but unfortunately it is currently not compatible with Next.<br>
@@ -54,10 +53,8 @@ The most common Koa middleware for handling the gzip compression is [compress](h
5453
If you need to enable the gzip compression, the most simple way to do so is by wrapping the express-middleware [compression](https://github.com/expressjs/compression) with [koa-connect](https://github.com/vkurchatkin/koa-connect):
5554

5655
```javascript
57-
const compression = require('compression');
58-
const koaConnect = require('koa-connect');
59-
56+
const compression = require("compression");
57+
const koaConnect = require("koa-connect");
6058

6159
server.use(koaConnect(compression()));
62-
6360
```

examples/parameterized-routing/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ yarn dev
3333

3434
See now documentation [here](https://zeit.co/docs/v2/deployments/routes/) and Next.js example [here](https://zeit.co/examples/nextjs/) for info on deploying with [now](https://zeit.co/now) ([download](https://zeit.co/download))
3535

36-
3736
## The idea behind the example
3837

3938
Next.js allows [Custom server and routing](https://github.com/zeit/next.js#custom-server-and-routing) so you can, as we show in this example, parametrize your routes. What we are doing in `server.js` is matching any route with the pattern `/blog/:id` and then passing the id as a parameter to the `pages/blog.js` page.

examples/pass-server-data/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The server knows whether or not to use next.js to render the route based on the
5757

5858
Take a look at the following files:
5959

60-
* server.js
61-
* routes/item.js
62-
* pages/item.js
63-
* operations/get-item.js
60+
- server.js
61+
- routes/item.js
62+
- pages/item.js
63+
- operations/get-item.js

examples/progressive-render/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ In that case you can wrap the component in `react-no-ssr` which will only render
4545

4646
This example features:
4747

48-
* An app with a component that must only be rendered in the client
49-
* A loading component that will be displayed before rendering the client-only component
48+
- An app with a component that must only be rendered in the client
49+
- A loading component that will be displayed before rendering the client-only component

examples/shared-modules/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ now
4141

4242
This example features:
4343

44-
* An app with two pages which has a common Counter component
45-
* That Counter component maintain the counter inside its module. This is used primarily to illustrate that modules get initialized once and their state variables persist in runtime
44+
- An app with two pages which has a common Counter component
45+
- That Counter component maintain the counter inside its module. This is used primarily to illustrate that modules get initialized once and their state variables persist in runtime

examples/using-inferno/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ This example uses [Inferno](https://github.com/infernojs/inferno), an insanely f
4343

4444
Here's how we did it:
4545

46-
* Use `next.config.js` to customize our webpack config to support [inferno-compat](https://www.npmjs.com/package/inferno-compat)
46+
- Use `next.config.js` to customize our webpack config to support [inferno-compat](https://www.npmjs.com/package/inferno-compat)

examples/using-nerv/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ This example uses [Nerv](https://nerv.aotu.io/) instead of React. It's a "blazin
4343

4444
Here's how we did it:
4545

46-
* Use `next.config.js` to customize our webpack config to support [Nerv](https://nerv.aotu.io/)
46+
- Use `next.config.js` to customize our webpack config to support [Nerv](https://nerv.aotu.io/)

examples/using-preact/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ This example uses [Preact](https://github.com/developit/preact) instead of React
4343

4444
Here's how we did it:
4545

46-
* Use `next.config.js` to customize our webpack config to support [preact-compat](https://github.com/developit/preact-compat)
46+
- Use `next.config.js` to customize our webpack config to support [preact-compat](https://github.com/developit/preact-compat)

examples/using-router/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ now
4141

4242
This example features:
4343

44-
* An app linking pages using `next/router` instead of `<Link>` component.
45-
* Access the pathname using `next/router` and render it in a component
44+
- An app linking pages using `next/router` instead of `<Link>` component.
45+
- Access the pathname using `next/router` and render it in a component

examples/with-algolia-react-instantsearch/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ cd with-algolia-react-instantsearch
2222
```
2323

2424
Set up Algolia:
25+
2526
- create an [algolia](https://www.algolia.com/) account or use this already [configured index](https://community.algolia.com/react-instantsearch/Getting_started.html#before-we-start)
2627
- update the appId, apikey and indexName you want to search on in components/app.js
2728

@@ -42,6 +43,7 @@ now
4243
```
4344

4445
## The idea behind the example
46+
4547
The goal of this example is to illustrate how you can use [Algolia React InstantSearch](https://community.algolia.com/react-instantsearch/) to perform
4648
your search with a Server-rendered application developed with Next.js. It also illustrates how you
4749
can keep in sync the Url with the search.

examples/with-apollo-and-redux-saga/README.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,26 @@ now
3838
```
3939

4040
## The idea behind the example
41+
4142
In 2.0.0, Apollo Client severs out-of-the-box support for redux in favor of Apollo's client side state management. This example aims to be an amalgamation of the [`with-apollo`](https://github.com/zeit/next.js/tree/master/examples/with-apollo) and [`with-redux-saga`](https://github.com/zeit/next.js/tree/master/examples/with-redux-saga) examples.
4243

4344
Note that you can access the redux store like you normally would using `react-redux`'s `connect`. Here's a quick example:
4445

4546
```js
4647
const mapStateToProps = state => ({
47-
location: state.form.location,
48+
location: state.form.location
4849
});
4950

50-
export default withReduxSaga(connect(mapStateToProps, null)(Index));
51+
export default withReduxSaga(
52+
connect(
53+
mapStateToProps,
54+
null
55+
)(Index)
56+
);
5157
```
5258

5359
`connect` must go inside `withReduxSaga` otherwise `connect` will not be able to find the store.
5460

5561
### Note:
56-
In these *with-apollo* examples, the ```withData()``` HOC must wrap a top-level component from within the ```pages``` directory. Wrapping a child component with the HOC will result in a ```Warning: Failed prop type: The prop 'serverState' is marked as required in 'WithData(Apollo(Component))', but its value is 'undefined'``` error. Down-tree child components will have access to Apollo, and can be wrapped with any other sort of ```graphql()```, ```compose()```, etc HOC's.
62+
63+
In these _with-apollo_ examples, the `withData()` HOC must wrap a top-level component from within the `pages` directory. Wrapping a child component with the HOC will result in a `Warning: Failed prop type: The prop 'serverState' is marked as required in 'WithData(Apollo(Component))', but its value is 'undefined'` error. Down-tree child components will have access to Apollo, and can be wrapped with any other sort of `graphql()`, `compose()`, etc HOC's.

examples/with-apollo-and-redux/README.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ now
3838
```
3939

4040
## The idea behind the example
41+
4142
This example serves as a conduit if you were using Apollo 1.X with Redux, and are migrating to Apollo 2.x, however, you have chosen not to manage your entire application state within Apollo (`apollo-link-state`).
4243

4344
In 2.0.0, Apollo serves out-of-the-box support for redux in favor of Apollo's state management. This example aims to be an amalgamation of the [`with-apollo`](https://github.com/zeit/next.js/tree/master/examples/with-apollo) and [`with-redux`](https://github.com/zeit/next.js/tree/master/examples/with-redux) examples.
@@ -46,11 +47,17 @@ Note that you can access the redux store like you normally would using `react-re
4647

4748
```js
4849
const mapStateToProps = state => ({
49-
location: state.form.location,
50+
location: state.form.location
5051
});
5152

52-
export default withRedux(connect(mapStateToProps, null)(Index));
53+
export default withRedux(
54+
connect(
55+
mapStateToProps,
56+
null
57+
)(Index)
58+
);
5359
```
5460

5561
### Note:
56-
In these *with-apollo* examples, the ```withData()``` HOC must wrap a top-level component from within the ```pages``` directory. Wrapping a child component with the HOC will result in a ```Warning: Failed prop type: The prop 'serverState' is marked as required in 'WithData(Apollo(Component))', but its value is 'undefined'``` error. Down-tree child components will have access to Apollo, and can be wrapped with any other sort of ```graphql()```, ```compose()```, etc HOC's.
62+
63+
In these _with-apollo_ examples, the `withData()` HOC must wrap a top-level component from within the `pages` directory. Wrapping a child component with the HOC will result in a `Warning: Failed prop type: The prop 'serverState' is marked as required in 'WithData(Apollo(Component))', but its value is 'undefined'` error. Down-tree child components will have access to Apollo, and can be wrapped with any other sort of `graphql()`, `compose()`, etc HOC's.

examples/with-apollo-auth/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ This is an extention of the _[with Apollo](https://github.com/zeit/next.js/tree/
4343

4444
> [Apollo](https://www.apollographql.com/client/) is a GraphQL client that allows you to easily query the exact data you need from a GraphQL server. In addition to fetching and mutating data, Apollo analyzes your queries and their results to construct a client-side cache of your data, which is kept up to date as further queries and mutations are run, fetching more results from the server.
4545
>
46-
> In this simple example, we integrate Apollo seamlessly with Next by wrapping our *pages* inside a [higher-order component (HOC)](https://facebook.github.io/react/docs/higher-order-components.html). Using the HOC pattern we're able to pass down a central store of query result data created by Apollo into our React component hierarchy defined inside each page of our Next application.
46+
> In this simple example, we integrate Apollo seamlessly with Next by wrapping our _pages_ inside a [higher-order component (HOC)](https://facebook.github.io/react/docs/higher-order-components.html). Using the HOC pattern we're able to pass down a central store of query result data created by Apollo into our React component hierarchy defined inside each page of our Next application.
4747
>
48-
> On initial page load, while on the server and inside `getInitialProps`, we invoke the Apollo method, [`getDataFromTree`](https://www.apollographql.com/docs/react/features/server-side-rendering.html#getDataFromTree). This method returns a promise; at the point in which the promise resolves, our Apollo Client store is completely initialized.
48+
> On initial page load, while on the server and inside `getInitialProps`, we invoke the Apollo method, [`getDataFromTree`](https://www.apollographql.com/docs/react/features/server-side-rendering.html#getDataFromTree). This method returns a promise; at the point in which the promise resolves, our Apollo Client store is completely initialized.
4949
>
5050
> This example relies on [graph.cool](https://www.graph.cool) for its GraphQL backend.
5151
>
52-
> *Note: If you're interested in integrating the client with your existing Redux store check out the [`with-apollo-and-redux`](https://github.com/zeit/next.js/tree/master/examples/with-apollo-and-redux) example.*
52+
> _Note: If you're interested in integrating the client with your existing Redux store check out the [`with-apollo-and-redux`](https://github.com/zeit/next.js/tree/master/examples/with-apollo-and-redux) example._
5353
5454
[graph.cool](https://www.graph.cool) can be setup with many different
5555
[authentication providers](https://www.graph.cool/docs/reference/integrations/overview-seimeish6e/#authentication-providers), the most basic of which is [email-password authentication](https://www.graph.cool/docs/reference/simple-api/user-authentication-eixu9osueb/#email-and-password). Once email-password authentication is enabled for your graph.cool project, you are provided with 2 useful mutations: `createUser` and `signinUser`.
@@ -65,6 +65,6 @@ It is important to note the use of Apollo's `resetStore()` method after signing
6565
To get this example running locally, you will need to create a graph.cool
6666
account, and provide [the `project.graphcool` schema](https://github.com/zeit/next.js/blob/master/examples/with-apollo-auth/project.graphcool).
6767

68-
6968
### Note:
70-
In these *with-apollo* examples, the ```withData()``` HOC must wrap a top-level component from within the ```pages``` directory. Wrapping a child component with the HOC will result in a ```Warning: Failed prop type: The prop 'serverState' is marked as required in 'WithData(Apollo(Component))', but its value is 'undefined'``` error. Down-tree child components will have access to Apollo, and can be wrapped with any other sort of ```graphql()```, ```compose()```, etc HOC's.
69+
70+
In these _with-apollo_ examples, the `withData()` HOC must wrap a top-level component from within the `pages` directory. Wrapping a child component with the HOC will result in a `Warning: Failed prop type: The prop 'serverState' is marked as required in 'WithData(Apollo(Component))', but its value is 'undefined'` error. Down-tree child components will have access to Apollo, and can be wrapped with any other sort of `graphql()`, `compose()`, etc HOC's.

examples/with-apollo/README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ now
4545

4646
[Apollo](https://www.apollographql.com/client/) is a GraphQL client that allows you to easily query the exact data you need from a GraphQL server. In addition to fetching and mutating data, Apollo analyzes your queries and their results to construct a client-side cache of your data, which is kept up to date as further queries and mutations are run, fetching more results from the server.
4747

48-
In this simple example, we integrate Apollo seamlessly with Next by wrapping our *pages/_app.js* inside a [higher-order component (HOC)](https://facebook.github.io/react/docs/higher-order-components.html). Using the HOC pattern we're able to pass down a central store of query result data created by Apollo into our React component hierarchy defined inside each page of our Next application.
48+
In this simple example, we integrate Apollo seamlessly with Next by wrapping our _pages/\_app.js_ inside a [higher-order component (HOC)](https://facebook.github.io/react/docs/higher-order-components.html). Using the HOC pattern we're able to pass down a central store of query result data created by Apollo into our React component hierarchy defined inside each page of our Next application.
4949

50-
On initial page load, while on the server and inside `getInitialProps`, we invoke the Apollo method, [`getDataFromTree`](https://www.apollographql.com/docs/react/features/server-side-rendering.html#getDataFromTree). This method returns a promise; at the point in which the promise resolves, our Apollo Client store is completely initialized.
50+
On initial page load, while on the server and inside `getInitialProps`, we invoke the Apollo method, [`getDataFromTree`](https://www.apollographql.com/docs/react/features/server-side-rendering.html#getDataFromTree). This method returns a promise; at the point in which the promise resolves, our Apollo Client store is completely initialized.
5151

5252
This example relies on [graph.cool](https://www.graph.cool) for its GraphQL backend.
5353

54-
55-
Note: Do not be alarmed that you see two renders being executed. Apollo recursively traverses the React render tree looking for Apollo query components. When it has done that, it fetches all these queries and then passes the result to a cache. This cache is then used to render the data on the server side (another React render).
54+
Note: Do not be alarmed that you see two renders being executed. Apollo recursively traverses the React render tree looking for Apollo query components. When it has done that, it fetches all these queries and then passes the result to a cache. This cache is then used to render the data on the server side (another React render).
5655
https://www.apollographql.com/docs/react/features/server-side-rendering.html#getDataFromTree

examples/with-app-layout/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ now
3939

4040
## The idea behind the example
4141

42-
Shows how to use _app.js to implement a global layout for all pages.
42+
Shows how to use \_app.js to implement a global layout for all pages.

examples/with-cerebral/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ Declarative CerebralJS:
4949
getUser,
5050
{
5151
success: setUser,
52-
error: setError,
52+
error: setError
5353
},
54-
setLoading(false),
54+
setLoading(false)
5555
];
5656
```
5757

examples/with-context-api/README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Deploy it to the cloud with [now](https://zeit.co/now) ([download](https://zeit.
3737
now
3838
```
3939

40-
## The idea behind the example*
40+
## The idea behind the example\*
4141

4242
This example shows how to use react context api in our app.
4343

@@ -47,5 +47,4 @@ The `pages/index.js` shows how to, from the home page, increment and decrement t
4747

4848
The `pages/about.js` shows how to, from the about page, how to pass an increment value from the about page into the context provider itself.
4949

50-
51-
**Based on WesBos example*.
50+
\*_Based on WesBos example_.

examples/with-custom-babel-config/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ now
4141

4242
This example features:
4343

44-
* An app using proposed [do expressions](https://babeljs.io/docs/plugins/transform-do-expressions/).
45-
* It uses babel-preset-stage-0, which allows us to use above JavaScript feature.
46-
* It uses '.babelrc' file in the app directory to add above preset.
44+
- An app using proposed [do expressions](https://babeljs.io/docs/plugins/transform-do-expressions/).
45+
- It uses babel-preset-stage-0, which allows us to use above JavaScript feature.
46+
- It uses '.babelrc' file in the app directory to add above preset.
4747

4848
> Most of the time, when writing a custom `.babelrc` file, you need to add `next/babel` as a preset.

examples/with-docker/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ now --docker -e API_URL="https://example.com"
4747

4848
## The idea behind the example
4949

50-
This example show how to set custom environment variables for your __docker application__ at runtime.
50+
This example show how to set custom environment variables for your **docker application** at runtime.
5151

5252
The `dockerfile` is the simplest way to run Next.js app in docker, and the size of output image is `173MB`. However, for an even smaller build, you can do multi-stage builds with `dockerfile.multistage`. The size of output image is `85MB`.
5353

examples/with-dotenv/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ This example shows how to inline env vars.
4343

4444
**Please note**:
4545

46-
* It is a bad practice to commit env vars to a repository. Thats why you should normally [gitignore](https://git-scm.com/docs/gitignore) your `.env` file.
47-
* In this example, as soon as you reference an env var in your code it will be automatically be publicly available and exposed to the client.
48-
* If you want to have more centralized control of what is exposed to the client check out the example [with-universal-configuration-build-time](../with-universal-configuration-build-time).
49-
* Env vars are set (inlined) at build time. If you need to configure your app on rutime check out [examples/with-universal-configuration-runtime](../with-universal-configuration-runtime).
46+
- It is a bad practice to commit env vars to a repository. Thats why you should normally [gitignore](https://git-scm.com/docs/gitignore) your `.env` file.
47+
- In this example, as soon as you reference an env var in your code it will be automatically be publicly available and exposed to the client.
48+
- If you want to have more centralized control of what is exposed to the client check out the example [with-universal-configuration-build-time](../with-universal-configuration-build-time).
49+
- Env vars are set (inlined) at build time. If you need to configure your app on rutime check out [examples/with-universal-configuration-runtime](../with-universal-configuration-runtime).

0 commit comments

Comments
 (0)