language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | vercel | next.js | 93990ab3fcae1a7e9cabc16e4153738c54e230b2.json | Add a nerv example. (#3573)
* Add a nerv example.
* Fix for indentation/style
* Fix for name | examples/using-nerv/README.md | @@ -0,0 +1,44 @@
+[](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/using-nerv)
+
+# Hello World example
+
+## How to use
+
+### Using `create-next-app`
+
+Download [`create-next-app`](https://github.com/segmentio/create-next-app... | true |
Other | vercel | next.js | 93990ab3fcae1a7e9cabc16e4153738c54e230b2.json | Add a nerv example. (#3573)
* Add a nerv example.
* Fix for indentation/style
* Fix for name | examples/using-nerv/next.config.js | @@ -0,0 +1,16 @@
+module.exports = {
+ webpack: function (config, { dev }) {
+ // For the development version, we'll use React.
+ // Because, it supports react hot loading and so on.
+ if (dev) {
+ return config
+ }
+
+ config.resolve.alias = {
+ react: 'nervjs',
+ 'react-dom': 'nervjs'
+... | true |
Other | vercel | next.js | 93990ab3fcae1a7e9cabc16e4153738c54e230b2.json | Add a nerv example. (#3573)
* Add a nerv example.
* Fix for indentation/style
* Fix for name | examples/using-nerv/package.json | @@ -0,0 +1,21 @@
+{
+ "name": "using-nerv",
+ "version": "1.0.0",
+ "scripts": {
+ "dev": "node server.js",
+ "build": "next build",
+ "start": "NODE_ENV=production node server.js"
+ },
+ "dependencies": {
+ "module-alias": "^2.0.0",
+ "next": "latest",
+ "nervjs": "^1.2.4",
+ "react": "^16.0.... | true |
Other | vercel | next.js | 93990ab3fcae1a7e9cabc16e4153738c54e230b2.json | Add a nerv example. (#3573)
* Add a nerv example.
* Fix for indentation/style
* Fix for name | examples/using-nerv/pages/about.js | @@ -0,0 +1,5 @@
+import React from 'react'
+
+export default () => (
+ <div>About us</div>
+) | true |
Other | vercel | next.js | 93990ab3fcae1a7e9cabc16e4153738c54e230b2.json | Add a nerv example. (#3573)
* Add a nerv example.
* Fix for indentation/style
* Fix for name | examples/using-nerv/pages/index.js | @@ -0,0 +1,6 @@
+import React from 'react'
+import Link from 'next/link'
+
+export default () => (
+ <div>Hello World. <Link href='/about'><a>About</a></Link></div>
+) | true |
Other | vercel | next.js | 93990ab3fcae1a7e9cabc16e4153738c54e230b2.json | Add a nerv example. (#3573)
* Add a nerv example.
* Fix for indentation/style
* Fix for name | examples/using-nerv/server.js | @@ -0,0 +1,29 @@
+const port = parseInt(process.env.PORT, 10) || 3000
+const dev = process.env.NODE_ENV !== 'production'
+const moduleAlias = require('module-alias')
+
+// For the development version, we'll use React.
+// Because, it support react hot loading and so on.
+if (!dev) {
+ moduleAlias.addAlias('react', 'ne... | true |
Other | vercel | next.js | 341c34d4bfc0b001b2dc018c44676368a289be84.json | Move getConfig message to the line above in readme | readme.md | @@ -1185,7 +1185,8 @@ module.exports = {
```js
// pages/index.js
import getConfig from 'next/config'
-const {serverRuntimeConfig, publicRuntimeConfig} = getConfig() // Only holds serverRuntimeConfig and publicRuntimeConfig from next.config.js nothing else.
+// Only holds serverRuntimeConfig and publicRuntimeConfig f... | false |
Other | vercel | next.js | cfe748d4b5c1ec7ef9ec4adc4bec534a9616aed8.json | Add note about getConfig | readme.md | @@ -1185,7 +1185,7 @@ module.exports = {
```js
// pages/index.js
import getConfig from 'next/config'
-const {serverRuntimeConfig, publicRuntimeConfig} = getConfig()
+const {serverRuntimeConfig, publicRuntimeConfig} = getConfig() // Only holds serverRuntimeConfig and publicRuntimeConfig from next.config.js nothing el... | false |
Other | vercel | next.js | 7cf9199a5fffed639bc4e35f01a040f605a1dae0.json | Add alt attributes to examples in readme.md (#4053) | readme.md | @@ -178,7 +178,7 @@ To support importing `.css` `.scss` or `.less` files you can use these modules,
Create a folder called `static` in your project root directory. From your code you can then reference those files with `/static/` URLs:
```jsx
-export default () => <img src="/static/my-image.png" />
+export default ... | false |
Other | vercel | next.js | e1a0f18a92a143db8e19ef663bccbae7d3b6a6cb.json | Add note about _document being only server side | readme.md | @@ -900,6 +900,9 @@ export default () => <HelloBundle title="Dynamic Bundle" />
Pages in `Next.js` skip the definition of the surrounding document's markup. For example, you never include `<html>`, `<body>`, etc. To override that default behavior, you must create a file at `./pages/_document.js`, where you can extend ... | false |
Other | vercel | next.js | f0308687c1407fef194c149226b8ccf3c164400d.json | fix mistake in docs (#4013) | readme.md | @@ -562,7 +562,7 @@ componentWillReceiveProps(nextProps) {
>
> Shallow routing works **only** for same page URL changes. For an example, let's assume we have another page called `about`, and you run this:
> ```js
-> Router.push('/about?counter=10', '/about?counter=10', { shallow: true })
+> Router.push('/?counter=10... | false |
Other | vercel | next.js | 0eb5bab4522808916dfe9414aaf14b7af4e09a8c.json | Fix a/b typo in custom-server-typescript routing (#4003) | examples/custom-server-typescript/pages/index.tsx | @@ -3,7 +3,7 @@ import Link from 'next/link'
export default () => (
<ul>
- <li><Link href='/b' as='/a'><a>a</a></Link></li>
- <li><Link href='/a' as='/b'><a>b</a></Link></li>
+ <li><Link href='/a' as='/a'><a>a</a></Link></li>
+ <li><Link href='/b' as='/b'><a>b</a></Link></li>
</ul>
) | true |
Other | vercel | next.js | 0eb5bab4522808916dfe9414aaf14b7af4e09a8c.json | Fix a/b typo in custom-server-typescript routing (#4003) | examples/custom-server-typescript/server/index.ts | @@ -14,9 +14,9 @@ app.prepare()
const { pathname, query } = parsedUrl
if (pathname === '/a') {
- app.render(req, res, '/b', query)
- } else if (pathname === '/b') {
app.render(req, res, '/a', query)
+ } else if (pathname === '/b') {
+ app.render(req, res, '/b', query)
} else {
... | true |
Other | vercel | next.js | b02e5849e9472c80839704b0003448f30482a818.json | Show only Spectrum link | readme.md | @@ -4,7 +4,6 @@
[](https://travis-ci.org/zeit/next.js)
[](https://ci.appveyor.com/project/arunoda/next-js/branch/master)
[ | server/index.js | @@ -166,6 +166,14 @@ export default class Server {
await this.serveStatic(req, res, p)
},
+ '/_next/:buildId/manifest.js.map': async (req, res, params) => {
+ if (!this.dev) return this.send404(res)
+
+ this.handleBuildId(params.buildId, res)
+ const p = join(this.dir, this.d... | false |
Other | vercel | next.js | d3518242a6e979f9e33d5738548a5b89f74a709a.json | FIX deploy with-firebase-hosting (#3946)
* FIX deploy with-firebase-hosting
* add npm run command in place of yarn in firebase.json predeploy hooks
* Change yarn with npm
* firebase-hosting example: Add warning in examples README
* firebase-hosting example: clarify warning language
* firebase-hosting ex... | examples/with-firebase-hosting/firebase.json | @@ -7,11 +7,11 @@
"function": "next"
}
],
- "predeploy": "yarn build-public"
+ "predeploy": "npm run build-public"
},
"functions": {
"source": "dist/functions",
"predeploy":
- "yarn build-funcs && yarn build-app && yarn copy-deps && yarn install-deps"
+ "npm run buil... | true |
Other | vercel | next.js | d3518242a6e979f9e33d5738548a5b89f74a709a.json | FIX deploy with-firebase-hosting (#3946)
* FIX deploy with-firebase-hosting
* add npm run command in place of yarn in firebase.json predeploy hooks
* Change yarn with npm
* firebase-hosting example: Add warning in examples README
* firebase-hosting example: clarify warning language
* firebase-hosting ex... | examples/with-firebase-hosting/package.json | @@ -1,25 +1,22 @@
{
"name": "with-firebase-hosting",
"version": "3.0.0",
- "description":
- "Host Next.js SSR app on Firebase Cloud Functions with Firebase Hosting redirects.",
+ "description": "Host Next.js SSR app on Firebase Cloud Functions with Firebase Hosting redirects.",
"scripts": {
"dev": "... | true |
Other | vercel | next.js | b0cdc1368e3c48ea8de2806a0ddd60e512038f73.json | Remove unused dependencies (#3962) | bin/next-dev | @@ -62,7 +62,9 @@ srv.start(argv.port, argv.hostname)
.catch((err) => {
if (err.code === 'EADDRINUSE') {
let errorMessage = `Port ${argv.port} is already in use.`
- const pkgAppPath = require('pkg-up').sync('.')
+ const pkgAppPath = require('find-up').sync('package.json', {
+ cwd: dir
+ })
c... | true |
Other | vercel | next.js | b0cdc1368e3c48ea8de2806a0ddd60e512038f73.json | Remove unused dependencies (#3962) | package.json | @@ -82,14 +82,11 @@
"htmlescape": "1.1.1",
"http-errors": "1.6.2",
"http-status": "1.0.1",
- "json-loader": "0.5.7",
"loader-utils": "1.1.0",
"minimist": "1.2.0",
"mkdirp-then": "1.2.0",
- "mv": "2.1.1",
"mz": "2.7.0",
"path-to-regexp": "2.1.0",
- "pkg-up": "2.0.0",
... | true |
Other | vercel | next.js | b0cdc1368e3c48ea8de2806a0ddd60e512038f73.json | Remove unused dependencies (#3962) | yarn.lock | @@ -2978,16 +2978,6 @@ glob@7.1.2, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1, glo
once "^1.3.0"
path-is-absolute "^1.0.0"
-glob@^6.0.1:
- version "6.0.4"
- resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22"
- dependencies:
- inf... | true |
Other | vercel | next.js | edfd44c3cabf05f43ee5461a0a26d6dc59f1288f.json | Add EventSource polyfill to hot-middleware-client (#3945)
* Move security related test cases into a its own file.
* Removes the unused renderScript function
* Add a nerv example. (#3573)
* Add a nerv example.
* Fix for indentation/style
* Fix for name
* Release 5.0.0
* Add multi-zones docs. (#3688... | client/webpack-hot-middleware-client.js | @@ -1,3 +1,4 @@
+import 'event-source-polyfill'
import webpackHotMiddlewareClient from 'webpack-hot-middleware/client?autoConnect=false'
import Router from '../lib/router'
| true |
Other | vercel | next.js | edfd44c3cabf05f43ee5461a0a26d6dc59f1288f.json | Add EventSource polyfill to hot-middleware-client (#3945)
* Move security related test cases into a its own file.
* Removes the unused renderScript function
* Add a nerv example. (#3573)
* Add a nerv example.
* Fix for indentation/style
* Fix for name
* Release 5.0.0
* Add multi-zones docs. (#3688... | package.json | @@ -72,6 +72,7 @@
"cross-spawn": "5.1.0",
"del": "3.0.0",
"etag": "1.8.1",
+ "event-source-polyfill": "0.0.12",
"find-up": "2.1.0",
"fresh": "0.5.2",
"friendly-errors-webpack-plugin": "1.6.1", | true |
Other | vercel | next.js | edfd44c3cabf05f43ee5461a0a26d6dc59f1288f.json | Add EventSource polyfill to hot-middleware-client (#3945)
* Move security related test cases into a its own file.
* Removes the unused renderScript function
* Add a nerv example. (#3573)
* Add a nerv example.
* Fix for indentation/style
* Fix for name
* Release 5.0.0
* Add multi-zones docs. (#3688... | yarn.lock | @@ -2499,6 +2499,10 @@ event-emitter@~0.3.5:
d "1"
es5-ext "~0.10.14"
+event-source-polyfill@0.0.12:
+ version "0.0.12"
+ resolved "https://registry.yarnpkg.com/event-source-polyfill/-/event-source-polyfill-0.0.12.tgz#e539cd67fdef2760a16aa5262fa98134df52e3af"
+
events@^1.0.0:
version "1.1.1"
resolv... | true |
Other | vercel | next.js | a225da4bb11d6618eb506ae1341acd34b135b593.json | Fix null pointer exception in with-react-18next (#3944)
The example does not crash if a user chooses a non-existing language (e.g. goes to localhost:3000/?lng=ru) | examples/with-react-i18next/i18n.js | @@ -45,7 +45,7 @@ i18n.getInitialProps = (req, namespaces) => {
req.i18n.languages.forEach((l) => {
initialI18nStore[l] = {}
namespaces.forEach((ns) => {
- initialI18nStore[l][ns] = req.i18n.services.resourceStore.data[l][ns] || {}
+ initialI18nStore[l][ns] = (req.i18n.services.resourceStore.data... | false |
Other | vercel | next.js | 0107051eaa6668e0a538af0237c88a0531a8be7c.json | Set default for serverRuntimeConfig (#3938) | server/index.js | @@ -63,7 +63,9 @@ export default class Server {
availableChunks: dev ? {} : getAvailableChunks(this.dir, this.dist)
}
- const {serverRuntimeConfig, publicRuntimeConfig, assetPrefix} = this.nextConfig
+ // Only serverRuntimeConfig needs the default
+ // publicRuntimeConfig gets it's default in cli... | false |
Other | vercel | next.js | fd7cb2a804a1ddcf208ed8adad57d2a3d5d1d14b.json | Add Spectrum badge (#3927)
:raised_hands: | readme.md | @@ -5,6 +5,7 @@
[](https://ci.appveyor.com/project/arunoda/next-js/branch/master)
[](https://coveralls.io/r/zeit/next.js?branch=master)... | false |
Other | vercel | next.js | bd973ab0fcd2c806437cdb1b13848374fbeab7cf.json | Change wording of issue template | .github/issue_template.md | @@ -2,8 +2,8 @@
<!--
IMPORTANT
-> If you have a question about Next.js you should ask your question on Spectrum https://spectrum.chat/next-js
-> or join our Slack community at https://zeit.chat and ask in the `#next` channel
+If you have a question about Next.js please ask it on Spectrum https://spectrum.chat/next-... | false |
Other | vercel | next.js | 5e4dc75db1c52a6f562a9090130bb863fe285e6d.json | Add message to ask questions on Spectrum | .github/issue_template.md | @@ -1,5 +1,11 @@
<!--- Provide a general summary of the issue in the Title above -->
+<!--
+IMPORTANT
+> If you have a question about Next.js you should ask your question on Spectrum https://spectrum.chat/next-js
+> or join our Slack community at https://zeit.chat and ask in the `#next` channel
+-->
+
<!--
Tha... | false |
Other | vercel | next.js | ba226c2d26347807daafc1ada3be81dd516569c6.json | Fix typo in documentation. (#3907) | readme.md | @@ -1009,7 +1009,7 @@ module.exports = (phase, {defaultConfig}){
}
```
-`phase` is the current context in which the configuration is loaded. You can see all phases here: [contants](./lib/constants.js)
+`phase` is the current context in which the configuration is loaded. You can see all phases here: [constants](./li... | false |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | .gitignore | @@ -13,3 +13,8 @@ npm-debug.log
# coverage
.nyc_output
coverage
+
+# editors
+.idea/*
+*.iml
+*.sublime-*
\ No newline at end of file | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/basic-css/package.json | @@ -7,7 +7,9 @@
"start": "next start"
},
"dependencies": {
- "next": "^2.0.0-beta"
+ "next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"author": "",
"license": "ISC" | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/custom-server-express/package.json | @@ -6,6 +6,8 @@
},
"dependencies": {
"express": "^4.14.0",
- "next": "^2.0.0-beta"
+ "next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
}
} | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/custom-server-hapi/package.json | @@ -6,6 +6,8 @@
},
"dependencies": {
"hapi": "^16.1.0",
- "next": "^2.0.0-beta"
+ "next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
}
} | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/custom-server-koa/package.json | @@ -8,6 +8,8 @@
"dependencies": {
"koa": "^1.2.4",
"koa-router": "^5.4.0",
- "next": "^2.0.0-beta"
+ "next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
}
} | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/custom-server/package.json | @@ -5,6 +5,8 @@
"start": "NODE_ENV=production node server.js"
},
"dependencies": {
- "next": "^2.0.0-beta"
+ "next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
}
} | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/data-fetch/package.json | @@ -8,7 +8,9 @@
},
"dependencies": {
"isomorphic-fetch": "^2.2.1",
- "next": "^2.0.0-beta"
+ "next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"author": "",
"license": "ISC" | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/head-elements/package.json | @@ -7,7 +7,9 @@
"start": "next start"
},
"dependencies": {
- "next": "*"
+ "next": "*",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"author": "",
"license": "ISC" | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/hello-world/package.json | @@ -7,7 +7,9 @@
"start": "next start"
},
"dependencies": {
- "next": "*"
+ "next": "*",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"author": "",
"license": "ISC" | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/layout-component/package.json | @@ -7,7 +7,9 @@
"start": "next start"
},
"dependencies": {
- "next": "*"
+ "next": "*",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"author": "",
"license": "ISC" | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/nested-components/package.json | @@ -7,7 +7,9 @@
"start": "next start"
},
"dependencies": {
- "next": "*"
+ "next": "*",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"author": "",
"license": "ISC" | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/parameterized-routing/package.json | @@ -6,6 +6,8 @@
},
"dependencies": {
"next": "^2.0.0-beta",
- "path-match": "1.2.4"
+ "path-match": "1.2.4",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
}
} | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/progressive-render/package.json | @@ -7,6 +7,8 @@
},
"dependencies": {
"next": "latest",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2",
"react-no-ssr": "1.1.0"
}
} | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/shared-modules/package.json | @@ -9,7 +9,9 @@
"start": "next start"
},
"dependencies": {
- "next": "*"
+ "next": "*",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"author": "",
"license": "ISC" | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/ssr-caching/package.json | @@ -7,6 +7,8 @@
"dependencies": {
"express": "^4.14.0",
"lru-cache": "^4.0.2",
- "next": "^2.0.0-beta"
+ "next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
}
} | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/using-inferno/package.json | @@ -7,9 +7,11 @@
"start": "next start"
},
"dependencies": {
- "next": "^2.0.0-beta",
"inferno": "^1.0.7",
- "inferno-compat": "^1.0.7"
+ "inferno-compat": "^1.0.7",
+ "next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"author": "",
"license": "MIT" | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/using-preact/package.json | @@ -9,7 +9,9 @@
"dependencies": {
"next": "^2.0.0-beta",
"preact": "^7.1.0",
- "preact-compat": "^3.9.4"
+ "preact-compat": "^3.9.4",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"author": "",
"license": "ISC", | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/using-router/package.json | @@ -9,7 +9,9 @@
"start": "next start"
},
"dependencies": {
- "next": "^2.0.0-beta"
+ "next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"author": "",
"license": "ISC" | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/with-amp/package.json | @@ -7,7 +7,9 @@
"start": "next start"
},
"dependencies": {
- "next": "^2.0.0-beta"
+ "next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"author": "",
"license": "ISC" | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/with-aphrodite/package.json | @@ -8,7 +8,9 @@
},
"dependencies": {
"aphrodite": "^1.1.0",
- "next": "^2.0.0-beta"
+ "next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"author": "",
"license": "ISC" | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/with-apollo/package.json | @@ -11,7 +11,9 @@
"graphql": "^0.8.2",
"graphql-tag": "^1.2.3",
"next": "^2.0.0-beta",
+ "react": "^15.4.2",
"react-apollo": "^0.8.1",
+ "react-dom": "^15.4.2",
"react-redux": "^5.0.2",
"redux": "^3.6.0",
"redux-thunk": "^2.1.0" | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/with-custom-babel-config/package.json | @@ -9,7 +9,9 @@
"start": "next start"
},
"dependencies": {
- "next": "^2.0.0-beta"
+ "next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"author": "",
"license": "ISC", | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/with-cxs/package.json | @@ -8,7 +8,9 @@
},
"dependencies": {
"cxs": "^3.0.0",
- "next": "^2.0.0-beta"
+ "next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"author": "",
"license": "ISC" | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/with-fela/package.json | @@ -9,6 +9,8 @@
"dependencies": {
"fela": "^4.1.2",
"next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2",
"react-fela": "^4.1.2"
}
-}
\ No newline at end of file
+} | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/with-flow/package.json | @@ -1,20 +1,22 @@
{
"name": "with-flow",
- "version": "1.0.0",
+ "version": "1.0.0",
"license": "MIT",
"author": "Jag Reehal",
"scripts": {
"dev": "next",
"build": "next build",
- "flow": "flow",
+ "flow": "flow",
"start": "next start"
},
"dependencies": {
- "next": ... | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/with-glamor/package.json | @@ -8,7 +8,9 @@
},
"dependencies": {
"glamor": "^2.20.12",
- "next": "^2.0.0-beta"
+ "next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"author": "",
"license": "ISC" | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/with-jest/package.json | @@ -1,7 +1,9 @@
{
"name": "with-jest",
"dependencies": {
- "next": "^2.0.0-beta"
+ "next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"scripts": {
"test": "jest", | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/with-loading/package.json | @@ -10,7 +10,9 @@
},
"dependencies": {
"next": "^2.0.0-beta",
- "nprogress": "^0.2.0"
+ "nprogress": "^0.2.0",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"author": "",
"license": "ISC" | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/with-mobx/package.json | @@ -9,11 +9,13 @@
"dependencies": {
"mobx": "^2.7.0",
"mobx-react": "^4.0.4",
- "next": "^2.0.0-beta"
+ "next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-plugin-transform-decorators-legacy": "^1.... | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/with-prefetching/package.json | @@ -7,7 +7,9 @@
"start": "next start"
},
"dependencies": {
- "next": "^2.0.0-beta"
+ "next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"author": "",
"license": "ISC" | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/with-redux/package.json | @@ -8,6 +8,8 @@
},
"dependencies": {
"next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2",
"react-redux": "^5.0.1",
"redux": "^3.6.0",
"redux-thunk": "^2.1.0" | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/with-styled-components/package.json | @@ -8,6 +8,8 @@
},
"dependencies": {
"next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2",
"styled-components": "1.2.1"
},
"author": "", | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/with-styled-jsx-postcss/package.json | @@ -9,6 +9,8 @@
"dependencies": {
"next": "^2.0.0-beta",
"postcss-cssnext": "^2.9.0",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2",
"styled-jsx-postcss": "^0.1.5"
},
"author": "Giuseppe Gurgone", | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/with-styletron/package.json | @@ -8,6 +8,8 @@
},
"dependencies": {
"next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2",
"styletron-client": "^2.2.0",
"styletron-react": "^2.2.1",
"styletron-server": "^2.2.0" | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | examples/with-universal-configuration/package.json | @@ -7,7 +7,9 @@
"start": "next start"
},
"dependencies": {
- "next": "^2.0.0-beta"
+ "next": "^2.0.0-beta",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"devDependencies": {
"babel-plugin-transform-define": "^1.2.0" | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | package.json | @@ -72,8 +72,6 @@
"mz": "2.6.0",
"path-match": "1.2.4",
"pkg-up": "1.0.0",
- "react": "15.4.2",
- "react-dom": "15.4.2",
"react-hot-loader": "3.0.0-beta.6",
"send": "0.14.1",
"source-map-support": "0.4.11",
@@ -110,7 +108,13 @@
"standard": "8.6.0",
"wd": "^1.1.3",
"web... | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | server/build/babel/preset.js | @@ -18,9 +18,6 @@ module.exports = {
{
alias: {
'babel-runtime': babelRuntimePath,
- react: require.resolve('react'),
- 'react-dom': require.resolve('react-dom'),
- 'react-dom/server': require.resolve('react-dom/server'),
'next/link': require.resolve('../... | true |
Other | vercel | next.js | 4a73ccbb00d6fa112bc8e0763dfceeade263033f.json | add react and react dom as peer (#1024)
- tackles #997
- add ./idea to gitignore for webstorm users
- update all the examples | server/build/webpack.js | @@ -173,9 +173,6 @@ export default async function createCompiler (dir, { dev = false, quiet = false
{
alias: {
'babel-runtime': babelRuntimePath,
- react: require.resolve('react'),
- 'react-dom': require.resolve('react-dom'),
- ... | true |
Other | vercel | next.js | 01cc89845040828c6e1f2bc053ff9c853d1635c5.json | Update Apollo example (#1021)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the ... | examples/with-apollo/lib/initClient.js | @@ -5,12 +5,12 @@ let apolloClient = null
function createClient (headers) {
return new ApolloClient({
ssrMode: !process.browser,
- headers,
dataIdFromObject: result => result.id || null,
networkInterface: createNetworkInterface({
uri: 'https://api.graph.cool/simple/v1/cixmkt2ul01q00122mksg8... | true |
Other | vercel | next.js | 01cc89845040828c6e1f2bc053ff9c853d1635c5.json | Update Apollo example (#1021)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the ... | examples/with-apollo/lib/withData.js | @@ -29,8 +29,8 @@ export default (Component) => (
return {
initialState: {
...state,
- apollo: {
- data: state.apollo.data
+ [client.reduxRootKey]: {
+ data: client.getInitialState().data
}
},
headers, | true |
Other | vercel | next.js | f6510c05b26934e544fad2c48c93caed7ac2de58.json | Pass parsed request-URL into the run-method (#1000) | examples/custom-server-hapi/next-wrapper.js | @@ -2,7 +2,7 @@ const pathWrapper = (app, pathName, opts) => ({ raw, query }, hapiReply) =>
app.renderToHTML(raw.req, raw.res, pathName, query, opts)
.then(hapiReply)
-const defaultHandlerWrapper = app => ({ raw }, hapiReply) =>
-app.run(raw.req, raw.res)
+const defaultHandlerWrapper = app => ({ raw, url }, hapiRep... | false |
Other | vercel | next.js | ddd93e9865fe3b05ca5d8d473650c8265f3fb5c3.json | Improve babel settings (#976)
* fix babelrc settings
* use only transform-es2015-modules-commonjs for transpiling emitting files | package.json | @@ -50,6 +50,7 @@
"babel-plugin-react-require": "^3.0.0",
"babel-plugin-transform-async-to-generator": "6.22.0",
"babel-plugin-transform-class-properties": "6.22.0",
+ "babel-plugin-transform-es2015-modules-commonjs": "6.22.0",
"babel-plugin-transform-object-rest-spread": "6.22.0",
"babel-pl... | true |
Other | vercel | next.js | ddd93e9865fe3b05ca5d8d473650c8265f3fb5c3.json | Improve babel settings (#976)
* fix babelrc settings
* use only transform-es2015-modules-commonjs for transpiling emitting files | server/build/webpack.js | @@ -109,7 +109,6 @@ export default async function createCompiler (dir, { dev = false, quiet = false
.filter((p) => !!p)
const mainBabelOptions = {
- babelrc: true,
cacheDirectory: true,
sourceMaps: dev ? 'both' : false,
presets: []
@@ -119,8 +118,10 @@ export default async function createCom... | true |
Other | vercel | next.js | 3143e0d0a1fc72c36f7483ad6bcdd8c4364416fe.json | Add styled-jsx to babel plugins (#970)
* Resolve all modules through module resolver
* Add styled-jsx back | server/build/webpack.js | @@ -179,7 +179,8 @@ export default async function createCompiler (dir, { dev = false, quiet = false
'next/css': require.resolve('../../lib/css'),
'next/head': require.resolve('../../lib/head'),
'next/document': require.resolve('../../server/document'),
- ... | false |
Other | vercel | next.js | efe0c7b43323d753c52befbd214850bf80fd7279.json | Resolve all modules through module resolver (#963) | server/build/webpack.js | @@ -154,11 +154,12 @@ export default async function createCompiler (dir, { dev = false, quiet = false
if (!(/\.js$/.test(interpolatedName))) {
return { content, sourceMap }
}
-
+ const babelRuntimePath = require.resolve('babel-runtime/package')
+ .replace(/[\\/]package\.json... | false |
Other | vercel | next.js | 61bdae5a086dff51ceb168fab3bd353d31e89cc3.json | Fix typo in react-md example readme (#959) | examples/with-react-md/README.md | @@ -25,6 +25,6 @@ now
## The idea behind the example
-This example features how yo use [react-md](https://react-md.mlaursen.com/) (React Material Design) with Next.js.
+This example features how you use [react-md](https://react-md.mlaursen.com/) (React Material Design) with Next.js.
I recommend reading [layout-... | false |
Other | vercel | next.js | f9717347a48ce778db21a78a01083a177a9f9110.json | Resolve preset es2015 from next directory (#949) | server/build/webpack.js | @@ -156,7 +156,7 @@ export default async function createCompiler (dir, { dev = false, quiet = false
}
const transpiled = babelCore.transform(content, {
- presets: ['es2015'],
+ presets: [require.resolve('babel-preset-es2015')],
sourceMaps: dev ? 'both' : false,
... | false |
Other | vercel | next.js | ec2c8c6784aae680964a32ab7a5bc2b657e5cf98.json | Fix .json import issue (#944)
* Fix .json import error
This is a regression we've added by #926 (tree-shaking-support)
* Add a test case. | server/build/loaders/emit-file-loader.js | @@ -16,7 +16,7 @@ module.exports = function (content, sourceMap) {
}
if (query.transform) {
- const transformed = query.transform({ content, sourceMap })
+ const transformed = query.transform({ content, sourceMap, interpolatedName })
return emit(transformed.content, transformed.sourceMap)
}
| true |
Other | vercel | next.js | ec2c8c6784aae680964a32ab7a5bc2b657e5cf98.json | Fix .json import issue (#944)
* Fix .json import error
This is a regression we've added by #926 (tree-shaking-support)
* Add a test case. | server/build/webpack.js | @@ -149,7 +149,12 @@ export default async function createCompiler (dir, { dev = false, quiet = false
// By default, our babel config does not transpile ES2015 module syntax because
// webpack knows how to handle them. (That's how it can do tree-shaking)
// But Node.js doesn't know how to handle the... | true |
Other | vercel | next.js | ec2c8c6784aae680964a32ab7a5bc2b657e5cf98.json | Fix .json import issue (#944)
* Fix .json import error
This is a regression we've added by #926 (tree-shaking-support)
* Add a test case. | test/integration/basic/lib/data.json | @@ -0,0 +1,3 @@
+{
+ "name": "Zeit"
+}
\ No newline at end of file | true |
Other | vercel | next.js | ec2c8c6784aae680964a32ab7a5bc2b657e5cf98.json | Fix .json import issue (#944)
* Fix .json import error
This is a regression we've added by #926 (tree-shaking-support)
* Add a test case. | test/integration/basic/pages/json.js | @@ -0,0 +1,5 @@
+import data from '../lib/data'
+
+export default () => (
+ <div>{data.name}</div>
+) | true |
Other | vercel | next.js | ec2c8c6784aae680964a32ab7a5bc2b657e5cf98.json | Fix .json import issue (#944)
* Fix .json import error
This is a regression we've added by #926 (tree-shaking-support)
* Add a test case. | test/integration/basic/test/rendering.js | @@ -61,6 +61,11 @@ export default function ({ app }, suiteName, render) {
expect($('pre').text().includes(expectedErrorMessage)).toBeTruthy()
})
+ test('allows to import .json files', async () => {
+ const html = await render('/json')
+ expect(html.includes('Zeit')).toBeTruthy()
+ })
+
... | true |
Other | vercel | next.js | f3e541fe23a2742b29b3d7305579fd1d06c02cb1.json | Add support for Webpack 2's tree-shaking (#926)
* Let webpack2 to handle ES2015 module system
Since Node.js can't do that, we need to transpile
ES2015 module system in the emit-file-loader.
* Use sourceMaps only in dev.
* Introduce a transform option to emit-file-loader
So, we can move our ES2015 transpile co... | server/build/babel/preset.js | @@ -3,7 +3,7 @@ const babelRuntimePath = require.resolve('babel-runtime/package')
module.exports = {
presets: [
- require.resolve('babel-preset-es2015'),
+ [require.resolve('babel-preset-es2015'), { modules: false }],
require.resolve('babel-preset-react')
],
plugins: [ | true |
Other | vercel | next.js | f3e541fe23a2742b29b3d7305579fd1d06c02cb1.json | Add support for Webpack 2's tree-shaking (#926)
* Let webpack2 to handle ES2015 module system
Since Node.js can't do that, we need to transpile
ES2015 module system in the emit-file-loader.
* Use sourceMaps only in dev.
* Introduce a transform option to emit-file-loader
So, we can move our ES2015 transpile co... | server/build/loaders/emit-file-loader.js | @@ -10,7 +10,15 @@ module.exports = function (content, sourceMap) {
const opts = { context, content, regExp }
const interpolatedName = loaderUtils.interpolateName(this, name, opts)
- this.emitFile(interpolatedName, content, sourceMap)
+ const emit = (code, map) => {
+ this.emitFile(interpolatedName, code, ... | true |
Other | vercel | next.js | f3e541fe23a2742b29b3d7305579fd1d06c02cb1.json | Add support for Webpack 2's tree-shaking (#926)
* Let webpack2 to handle ES2015 module system
Since Node.js can't do that, we need to transpile
ES2015 module system in the emit-file-loader.
* Use sourceMaps only in dev.
* Introduce a transform option to emit-file-loader
So, we can move our ES2015 transpile co... | server/build/webpack.js | @@ -10,6 +10,7 @@ import UnlinkFilePlugin from './plugins/unlink-file-plugin'
import WatchPagesPlugin from './plugins/watch-pages-plugin'
import JsonPagesPlugin from './plugins/json-pages-plugin'
import getConfig from '../config'
+import * as babelCore from 'babel-core'
const documentPage = join('pages', '_docume... | true |
Other | vercel | next.js | ee717af0889312cc6cc6337da0d405356a5a2a58.json | examples/with-redux: remove global store (#908)
This patch removes the global `store` on the client. IMO this example
should avoid polluting the global namespace with simple scoping tricks
can solve the problem equally as well. | examples/with-redux/store.js | @@ -12,13 +12,15 @@ export const startClock = () => dispatch => {
return setInterval(() => dispatch({ type: 'TICK', light: true, ts: Date.now() }), 800)
}
+let store = null
+
export const initStore = (reducer, initialState, isServer) => {
if (isServer && typeof window === 'undefined') {
return createStor... | false |
Other | vercel | next.js | db50fc7dee90aa4aed2ccdc59bd9da1db96dd810.json | chore(package): update wd to version 1.1.3 (#906)
https://greenkeeper.io/ | package.json | @@ -106,7 +106,7 @@
"portfinder": "^1.0.10",
"run-sequence": "1.2.2",
"standard": "8.6.0",
- "wd": "^1.1.1",
+ "wd": "^1.1.3",
"webpack-stream": "3.2.0",
"cross-env": "^3.1.4"
}, | false |
Other | vercel | next.js | 8310f812ec547b03134fc765d65a1639f19b5808.json | Fix Apollo Example (#900)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the Apol... | examples/with-apollo/components/PostList.js | @@ -14,9 +14,7 @@ function PostList ({ data: { allPosts, loading, _allPostsMeta }, loadMorePosts }
return (
<section>
<ul>
- {allPosts
- .sort((x, y) => new Date(y.createdAt) - new Date(x.createdAt))
- .map((post, index) =>
+ {allPosts.map((post, index) =>
<li key={... | true |
Other | vercel | next.js | 8310f812ec547b03134fc765d65a1639f19b5808.json | Fix Apollo Example (#900)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the Apol... | examples/with-apollo/components/Submit.js | @@ -70,7 +70,7 @@ export default graphql(createPost, {
const newPost = mutationResult.data.createPost
return Object.assign({}, previousResult, {
// Append the new post
- allPosts: [...previousResult.allPosts, newPost]
+ allPosts: [newPost, ...previousResult.allPo... | true |
Other | vercel | next.js | a76ec83b64a4c49fb606da221df3eaa560503c7e.json | Update Apollo Example (#888)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the A... | examples/with-apollo/lib/withData.js | @@ -11,10 +11,15 @@ export default (Component) => (
const client = initClient(headers)
const store = initStore(client, client.initialState)
+ const props = {
+ url: { query: ctx.query, pathname: ctx.pathname },
+ ...await (Component.getInitialProps ? Component.getInitialProps(ctx) : {... | false |
Other | vercel | next.js | 4b257483e2974cfde843447380ebdf77fb83029c.json | Add Apollo example (#780)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the Apol... | README.md | @@ -638,6 +638,13 @@ On the client side, we have a parameter call `as` on `<Link>` that _decorates_ t
It’s up to you. `getInitialProps` is an `async` function (or a regular function that returns a `Promise`). It can retrieve data from anywhere.
</details>
+<details>
+ <summary>Can I use it with GraphQL?</summary>
... | true |
Other | vercel | next.js | 4b257483e2974cfde843447380ebdf77fb83029c.json | Add Apollo example (#780)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the Apol... | examples/with-apollo/README.md | @@ -0,0 +1,26 @@
+# Apollo Example
+## Demo
+https://next-with-apollo.now.sh
+
+## How to use
+Install it and run
+
+```bash
+npm install
+npm run dev
+```
+
+Deploy it to the cloud with [now](https://zeit.co/now) ([download](https://zeit.co/download))
+
+```bash
+now
+```
+
+## The idea behind the example
+Apollo is a... | true |
Other | vercel | next.js | 4b257483e2974cfde843447380ebdf77fb83029c.json | Add Apollo example (#780)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the Apol... | examples/with-apollo/components/App.js | @@ -0,0 +1,40 @@
+export default ({ children }) => (
+ <main>
+ {children}
+ <style jsx global>{`
+ * {
+ font-family: Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, serif;
+ }
+ body {
+ margin: 0;
+ ... | true |
Other | vercel | next.js | 4b257483e2974cfde843447380ebdf77fb83029c.json | Add Apollo example (#780)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the Apol... | examples/with-apollo/components/Header.js | @@ -0,0 +1,27 @@
+import Link from 'next/prefetch'
+
+export default ({ pathname }) => (
+ <header>
+ <Link href='/'>
+ <a className={pathname === '/' && 'is-active'}>Home</a>
+ </Link>
+
+ <Link href='/about'>
+ <a className={pathname === '/about' && 'is-active'}>About</a>
+ </Link>
+
+ <styl... | true |
Other | vercel | next.js | 4b257483e2974cfde843447380ebdf77fb83029c.json | Add Apollo example (#780)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the Apol... | examples/with-apollo/components/PostList.js | @@ -0,0 +1,114 @@
+import gql from 'graphql-tag'
+import { graphql } from 'react-apollo'
+import PostUpvoter from './PostUpvoter'
+
+const POSTS_PER_PAGE = 10
+
+function PostList ({ data: { allPosts, loading, _allPostsMeta }, loadMorePosts }) {
+ if (loading) {
+ return <div>Loading</div>
+ }
+
+ const areMorePo... | true |
Other | vercel | next.js | 4b257483e2974cfde843447380ebdf77fb83029c.json | Add Apollo example (#780)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the Apol... | examples/with-apollo/components/PostUpvoter.js | @@ -0,0 +1,54 @@
+import React from 'react'
+import gql from 'graphql-tag'
+import { graphql } from 'react-apollo'
+
+function PostUpvoter ({ upvote, votes, id }) {
+ return (
+ <button onClick={() => upvote(id, votes + 1)}>
+ {votes}
+ <style jsx>{`
+ button {
+ background-color: transpar... | true |
Other | vercel | next.js | 4b257483e2974cfde843447380ebdf77fb83029c.json | Add Apollo example (#780)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the Apol... | examples/with-apollo/components/Submit.js | @@ -0,0 +1,79 @@
+import gql from 'graphql-tag'
+import { graphql } from 'react-apollo'
+
+function Submit ({ createPost }) {
+ function handleSubmit (e) {
+ e.preventDefault()
+
+ let title = e.target.elements.title.value
+ let url = e.target.elements.url.value
+
+ if (title === '' || url === '') {
+ ... | true |
Other | vercel | next.js | 4b257483e2974cfde843447380ebdf77fb83029c.json | Add Apollo example (#780)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the Apol... | examples/with-apollo/lib/initClient.js | @@ -0,0 +1,22 @@
+import ApolloClient, { createNetworkInterface } from 'apollo-client'
+
+export const initClient = (headers) => {
+ const client = new ApolloClient({
+ ssrMode: !process.browser,
+ headers,
+ dataIdFromObject: result => result.id || null,
+ networkInterface: createNetworkInterface({
+ ... | true |
Other | vercel | next.js | 4b257483e2974cfde843447380ebdf77fb83029c.json | Add Apollo example (#780)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the Apol... | examples/with-apollo/lib/initStore.js | @@ -0,0 +1,16 @@
+import { createStore } from 'redux'
+import getReducer from './reducer'
+import createMiddleware from './middleware'
+
+export const initStore = (client, initialState) => {
+ let store
+ if (!process.browser || !window.REDUX_STORE) {
+ const middleware = createMiddleware(client.middleware())
+ ... | true |
Other | vercel | next.js | 4b257483e2974cfde843447380ebdf77fb83029c.json | Add Apollo example (#780)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the Apol... | examples/with-apollo/lib/middleware.js | @@ -0,0 +1,9 @@
+import { applyMiddleware, compose } from 'redux'
+
+export default function createMiddleware (clientMiddleware) {
+ const middleware = applyMiddleware(clientMiddleware)
+ if (process.browser && window.devToolsExtension) {
+ return compose(middleware, window.devToolsExtension())
+ }
+ return midd... | true |
Other | vercel | next.js | 4b257483e2974cfde843447380ebdf77fb83029c.json | Add Apollo example (#780)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the Apol... | examples/with-apollo/lib/reducer.js | @@ -0,0 +1,7 @@
+import { combineReducers } from 'redux'
+
+export default function getReducer (client) {
+ return combineReducers({
+ apollo: client.reducer()
+ })
+} | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.