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 | f9e4f1869172835b49d25e91af5142f533ca1163.json | Update example analyze bundles (#9645)
* Update analyze-bundles example
* follow these updates:
1. `server` and `browser` options
* https://github.com/zeit/next-plugins/blob/9ecca7b492518464897ea866b4abcdc6214bf705/packages/next-bundle-analyzer/index.js
2. "Deprecate next-bundle-analyzer"
* https://... | examples/analyze-bundles/README.md | @@ -39,16 +39,12 @@ yarn dev
## The idea behind the example
-This example shows how to analyze the output bundles using [@zeit/next-bundle-analyzer](https://github.com/zeit/next-plugins/tree/master/packages/next-bundle-analyzer)
+This example shows how to analyze the output bundles using [@next/bundle-analyzer](ht... | true |
Other | vercel | next.js | f9e4f1869172835b49d25e91af5142f533ca1163.json | Update example analyze bundles (#9645)
* Update analyze-bundles example
* follow these updates:
1. `server` and `browser` options
* https://github.com/zeit/next-plugins/blob/9ecca7b492518464897ea866b4abcdc6214bf705/packages/next-bundle-analyzer/index.js
2. "Deprecate next-bundle-analyzer"
* https://... | examples/analyze-bundles/next.config.js | @@ -1,21 +1,9 @@
-const withBundleAnalyzer = require('@zeit/next-bundle-analyzer')
+const withBundleAnalyzer = require('@next/bundle-analyzer')({
+ enabled: process.env.ANALYZE === 'true',
+})
const nextConfig = {
- analyzeServer: ['server', 'both'].includes(process.env.BUNDLE_ANALYZE),
- analyzeBrowser: ['browse... | true |
Other | vercel | next.js | f9e4f1869172835b49d25e91af5142f533ca1163.json | Update example analyze bundles (#9645)
* Update analyze-bundles example
* follow these updates:
1. `server` and `browser` options
* https://github.com/zeit/next-plugins/blob/9ecca7b492518464897ea866b4abcdc6214bf705/packages/next-bundle-analyzer/index.js
2. "Deprecate next-bundle-analyzer"
* https://... | examples/analyze-bundles/package.json | @@ -5,12 +5,11 @@
"dev": "next",
"build": "next build",
"start": "next start",
- "analyze": "BUNDLE_ANALYZE=both next build",
- "analyze:server": "BUNDLE_ANALYZE=server next build",
- "analyze:browser": "BUNDLE_ANALYZE=browser next build"
+ "analyze": "cross-env ANALYZE=true yarn build"
},... | true |
Other | vercel | next.js | 04b2f0ebe1e7ac439ce183dc85a02a1882910238.json | Use Real Identifier for SSG Transform (#9656) | packages/next/build/babel/plugins/next-ssg-transform.ts | @@ -12,7 +12,11 @@ const ssgExports = new Set([
EXPORT_NAME_GET_STATIC_PATHS,
])
-type PluginState = { refs: Set<any>; isPrerender: boolean; done: boolean }
+type PluginState = {
+ refs: Set<NodePath<BabelTypes.Identifier>>
+ isPrerender: boolean
+ done: boolean
+}
function decorateSsgExport(
t: typeof B... | true |
Other | vercel | next.js | 04b2f0ebe1e7ac439ce183dc85a02a1882910238.json | Use Real Identifier for SSG Transform (#9656) | test/unit/babel-plugin-next-ssg-transform.test.js | @@ -308,5 +308,26 @@ describe('babel plugin (next-ssg-transform)', () => {
`"import keep_me from'hello';import{keep_me2}from'hello2';import*as keep_me3 from'hello3';import{but_not_me}from'bar';var leave_me_alone=1;function dont_bug_me_either(){}const __NEXT_COMP=function Test(){return __jsx(\\"div\\",null);};_... | true |
Other | vercel | next.js | a9c398854a4564a878d1353ecd5b705b776beedd.json | Add console.error before exit on uncaughtException (#6504) | packages/next/build/output/exit.ts | @@ -24,7 +24,8 @@ export function onExit(fn: Function) {
{
event: 'uncaughtException',
- handler: () => {
+ handler: (error: Error) => {
+ console.error('Got uncaughtException:', error)
exit()
process.exit(1)
}, | false |
Other | vercel | next.js | a169017c87f52fc6ddf0a59ae88f9d468cf50697.json | Add docs for named exports using dynamic (#6502) | packages/next/README.md | @@ -1066,7 +1066,7 @@ Since Next.js supports dynamic imports with SSR, you could do amazing things wit
Here are a few ways to use dynamic imports.
-#### 1. Basic Usage (Also does SSR)
+#### Basic Usage (Also does SSR)
```jsx
import dynamic from 'next/dynamic'
@@ -1086,7 +1086,36 @@ function Home() {
export de... | false |
Other | vercel | next.js | 8ae1cd35bd21222d5237f0ca5a676471a4e9c01e.json | Fix dynamic require breaking after updating to v8 (#6475)
* Fix dynamic require breaking after updating to v8
* Add test for dynamic require | packages/next/build/webpack-config.ts | @@ -93,7 +93,7 @@ export default function getBaseWebpackConfig (dir: string, {dev = false, isServe
return callback()
}
- resolve(request, { basedir: context, preserveSymlinks: true }, (err, res) => {
+ resolve(request, { basedir: dir, preserveSymlinks: true }, (err, res) => {
... | true |
Other | vercel | next.js | 8ae1cd35bd21222d5237f0ca5a676471a4e9c01e.json | Fix dynamic require breaking after updating to v8 (#6475)
* Fix dynamic require breaking after updating to v8
* Add test for dynamic require | test/integration/dynamic-require/locales/en.js | @@ -0,0 +1,3 @@
+(function en (props) {
+ // no-nop
+})() | true |
Other | vercel | next.js | 8ae1cd35bd21222d5237f0ca5a676471a4e9c01e.json | Fix dynamic require breaking after updating to v8 (#6475)
* Fix dynamic require breaking after updating to v8
* Add test for dynamic require | test/integration/dynamic-require/locales/ru.js | @@ -0,0 +1,3 @@
+(function en (props) {
+ // no-nop
+})() | true |
Other | vercel | next.js | 8ae1cd35bd21222d5237f0ca5a676471a4e9c01e.json | Fix dynamic require breaking after updating to v8 (#6475)
* Fix dynamic require breaking after updating to v8
* Add test for dynamic require | test/integration/dynamic-require/pages/index.js | @@ -0,0 +1,7 @@
+const locale = 'ru'
+
+console.log(require(`../locales/${locale}`))
+
+export default () => (
+ <p>If you can see this then we are good 👍</p>
+) | true |
Other | vercel | next.js | 8ae1cd35bd21222d5237f0ca5a676471a4e9c01e.json | Fix dynamic require breaking after updating to v8 (#6475)
* Fix dynamic require breaking after updating to v8
* Add test for dynamic require | test/integration/dynamic-require/test/index.test.js | @@ -0,0 +1,27 @@
+/* eslint-env jest */
+/* global jasmine */
+import { join } from 'path'
+import {
+ renderViaHTTP,
+ launchApp,
+ findPort,
+ killApp
+} from 'next-test-utils'
+
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 30
+
+let server
+let appPort
+
+describe('Dynamic require', () => {
+ beforeAll(async () =... | true |
Other | vercel | next.js | 23178db57564ada957a53e0b96094a324f29108b.json | Add styles to experimental-amp example (#6461)
After discussion added global styles to experimental-amp example | examples/experimental-amp/components/Layout.js | @@ -0,0 +1,10 @@
+export default function Layout ({ children }) {
+ return (
+ <>
+ {children}
+ <style jsx global>{`
+ body {font-family: Roboto, sans-serif; padding: 30px; color: #444;}
+ `}</style>
+ </>
+ )
+} | true |
Other | vercel | next.js | 23178db57564ada957a53e0b96094a324f29108b.json | Add styles to experimental-amp example (#6461)
After discussion added global styles to experimental-amp example | examples/experimental-amp/pages/index.js | @@ -1,12 +1,13 @@
import Head from 'next/head'
import { useAmp } from 'next/amp'
+import Layout from '../components/Layout'
import Byline from '../components/Byline'
export default () => {
const isAmp = useAmp()
return (
- <>
+ <Layout>
<Head>
<title>The Cat</title>
</Head>
@@... | true |
Other | vercel | next.js | 41eaa9cf5ade8f233439a80f7e846ccb00ef3f18.json | Run ncc on unistore to fix install warning (#6459)
ncc unistore to fix install warning | packages/next/build/output/index.ts | @@ -1,4 +1,4 @@
-import createStore from 'unistore'
+import createStore from 'next/dist/compiled/unistore'
import { store, OutputState } from './store'
import formatWebpackMessages from '../../client/dev-error-overlay/format-webpack-messages' | true |
Other | vercel | next.js | 41eaa9cf5ade8f233439a80f7e846ccb00ef3f18.json | Run ncc on unistore to fix install warning (#6459)
ncc unistore to fix install warning | packages/next/build/output/store.ts | @@ -1,5 +1,5 @@
import chalk from 'chalk'
-import createStore from 'unistore'
+import createStore from 'next/dist/compiled/unistore'
import readline from 'readline'
import { onExit } from './exit'
| true |
Other | vercel | next.js | 41eaa9cf5ade8f233439a80f7e846ccb00ef3f18.json | Run ncc on unistore to fix install warning (#6459)
ncc unistore to fix install warning | packages/next/package.json | @@ -83,7 +83,6 @@
"terser": "3.16.1",
"tty-aware-progress": "1.0.3",
"unfetch": "3.0.0",
- "unistore": "3.2.1",
"url": "0.11.0",
"webpack": "4.29.0",
"webpack-dev-middleware": "3.4.0",
@@ -117,7 +116,8 @@
"@types/rimraf": "2.0.2",
"@zeit/ncc": "0.15.2",
"taskr": "1.1.0",
... | true |
Other | vercel | next.js | 41eaa9cf5ade8f233439a80f7e846ccb00ef3f18.json | Run ncc on unistore to fix install warning (#6459)
ncc unistore to fix install warning | packages/next/taskfile-ncc.js | @@ -1,27 +1,71 @@
'use strict'
const ncc = require('@zeit/ncc')
-const basename = require('path').basename
-const dirname = require('path').dirname
-const join = require('path').join
+const { existsSync, copyFileSync } = require('fs')
+const { basename, dirname, extname, join, relative } = require('path')
module... | true |
Other | vercel | next.js | 41eaa9cf5ade8f233439a80f7e846ccb00ef3f18.json | Run ncc on unistore to fix install warning (#6459)
ncc unistore to fix install warning | packages/next/taskfile.js | @@ -1,4 +1,6 @@
const notifier = require('node-notifier')
+const relative = require('path').relative
+
const babelOpts = {
presets: [
['@babel/preset-env', {
@@ -18,6 +20,17 @@ const babelOpts = {
]
}
+export async function nccunistore (task, opts) {
+ await task
+ .source(opts.src || relative(__dir... | true |
Other | vercel | next.js | 3998805b2ef70e33c73d65049684eaf4e057525a.json | Use cacheable-response for ssr (#6393)
Hello,
I have been using next.js for a while in a bunch of projects, so first for all thanks for all the vibrant effort around the project 🖤.
Always I see the server side next.js approach as an advantage, but also a weakness for the extra resources you need to have, speci... | examples/ssr-caching/package.json | @@ -7,11 +7,11 @@
"start": "NODE_ENV=production node server.js"
},
"dependencies": {
+ "cacheable-response": "^1.1.0",
"express": "^4.14.0",
- "lru-cache": "^4.0.2",
"next": "latest",
"react": "^16.7.0",
"react-dom": "^16.7.0"
},
"license": "ISC"
-}
+}
\ No newline at end of f... | true |
Other | vercel | next.js | 3998805b2ef70e33c73d65049684eaf4e057525a.json | Use cacheable-response for ssr (#6393)
Hello,
I have been using next.js for a while in a bunch of projects, so first for all thanks for all the vibrant effort around the project 🖤.
Always I see the server side next.js approach as an advantage, but also a weakness for the extra resources you need to have, speci... | examples/ssr-caching/server.js | @@ -1,78 +1,36 @@
+const cacheableResponse = require('cacheable-response')
const express = require('express')
const next = require('next')
-const LRUCache = require('lru-cache')
const port = parseInt(process.env.PORT, 10) || 3000
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
+
cons... | true |
Other | vercel | next.js | aed7f643e2d60a3eb58ff23e038b029afe00241c.json | add extra info to authentication (#6435)
* add extra info to authentication
* Update auth.js | examples/with-cookie-auth/www/utils/auth.js | @@ -63,12 +63,18 @@ export const withAuthSync = WrappedComponent =>
export const auth = ctx => {
const { token } = nextCookie(ctx)
+ /*
+ * This happens on server only, ctx.req is available means it's being
+ * rendered on server. If we are on server and token is not available,
+ * means user is not logged... | false |
Other | vercel | next.js | 2fd397ff5aad0b30e9436c0c8725395b4d63881c.json | Add error for exporting when target is not server (#6455) | errors/next-export-serverless.md | @@ -0,0 +1,9 @@
+# Using `next export` with `target` not set to `server`
+
+#### Why This Error Occurred
+
+Next.js can only handle exporting when the `target` is set to `server` (this is the default value). A serverless build, for instance, has no handler for requests–this is usually implemented by a hosting provider.... | true |
Other | vercel | next.js | 2fd397ff5aad0b30e9436c0c8725395b4d63881c.json | Add error for exporting when target is not server (#6455) | packages/next/export/index.js | @@ -25,6 +25,8 @@ export default async function (dir, options, configuration) {
const threads = options.threads || Math.max(cpus().length - 1, 1)
const distDir = join(dir, nextConfig.distDir)
+ if (nextConfig.target !== 'server') throw new Error('Cannot export when target is not server. https://err.sh/zeit/nex... | true |
Other | vercel | next.js | 993cab89e52e3754f71f4baaf2175e12f18eca1c.json | Update Hapi example (#6429)
Since version 18 (released in January), Hapi's `request.url` returns the parsed URL, so `parse` is not needed.
Ref:
- https://hapijs.com/api#-requesturl
- https://github.com/hapijs/hapi/pull/3822 | examples/custom-server-hapi/next-wrapper.js | @@ -1,5 +1,3 @@
-const { parse } = require('url')
-
const nextHandlerWrapper = app => {
const handler = app.getRequestHandler()
return async ({ raw, url }, h) => {
@@ -8,7 +6,7 @@ const nextHandlerWrapper = app => {
}
}
const defaultHandlerWrapper = app => async ({ raw: { req, res }, url }) => {
- const { ... | true |
Other | vercel | next.js | 993cab89e52e3754f71f4baaf2175e12f18eca1c.json | Update Hapi example (#6429)
Since version 18 (released in January), Hapi's `request.url` returns the parsed URL, so `parse` is not needed.
Ref:
- https://hapijs.com/api#-requesturl
- https://github.com/hapijs/hapi/pull/3822 | examples/custom-server-hapi/package.json | @@ -7,7 +7,7 @@
"start": "NODE_ENV=production node server.js"
},
"dependencies": {
- "hapi": "^17.1.1",
+ "hapi": "^18.1.0",
"next": "latest",
"react": "^16.7.0",
"react-dom": "^16.7.0" | true |
Other | vercel | next.js | e60a7cf52921470c79b89c9922333e7a2b1b803a.json | Remove mkdirp-then in favor of promisify (#6408) | packages/next/export/index.js | @@ -2,12 +2,15 @@ import del from 'del'
import { cpus } from 'os'
import { fork } from 'child_process'
import cp from 'recursive-copy'
-import mkdirp from 'mkdirp-then'
+import mkdirpModule from 'mkdirp'
import { resolve, join } from 'path'
import { existsSync, readFileSync } from 'fs'
import loadConfig from 'nex... | true |
Other | vercel | next.js | e60a7cf52921470c79b89c9922333e7a2b1b803a.json | Remove mkdirp-then in favor of promisify (#6408) | packages/next/export/worker.js | @@ -1,15 +1,18 @@
+import mkdirpModule from 'mkdirp'
+import { promisify } from 'util'
+import { extname, join, dirname, sep } from 'path'
+import { renderToHTML } from 'next-server/dist/server/render'
+import { writeFile } from 'fs'
+import Sema from 'async-sema'
+import { loadComponents } from 'next-server/dist/serve... | true |
Other | vercel | next.js | e60a7cf52921470c79b89c9922333e7a2b1b803a.json | Remove mkdirp-then in favor of promisify (#6408) | packages/next/package.json | @@ -69,7 +69,7 @@
"hoist-non-react-statics": "3.2.0",
"launch-editor": "2.2.1",
"loader-utils": "1.1.0",
- "mkdirp-then": "1.2.0",
+ "mkdirp": "0.5.1",
"nanoid": "1.2.1",
"next-server": "8.0.3",
"prop-types": "15.6.2", | true |
Other | vercel | next.js | e60a7cf52921470c79b89c9922333e7a2b1b803a.json | Remove mkdirp-then in favor of promisify (#6408) | yarn.lock | @@ -2051,11 +2051,6 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1:
dependencies:
color-convert "^1.9.0"
-any-promise@^1.1.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f"
- integrity sha1-q8av7tzqUugJzcA3au0845Y10X8=
-
... | true |
Other | vercel | next.js | e05229be54d349d46710ee5a6fcc9ef49953cc28.json | Fix hot reloading in the yarn workspaces example (#6402)
* Fix hot reloading in the yarn workspaces example
* Update README links | examples/with-yarn-workspaces/README.md | @@ -51,4 +51,4 @@ In this example we have three workspaces:
* [Documentation](https://yarnpkg.com/en/docs/workspaces)
* [yarn workspaces](https://yarnpkg.com/lang/en/docs/cli/workspace)
* [yarn workspace](https://yarnpkg.com/lang/en/docs/cli/workspaces)
-* [next-plugin-transpile-modules](https://www.npmjs.com/packag... | true |
Other | vercel | next.js | e05229be54d349d46710ee5a6fcc9ef49953cc28.json | Fix hot reloading in the yarn workspaces example (#6402)
* Fix hot reloading in the yarn workspaces example
* Update README links | examples/with-yarn-workspaces/packages/web-app/next.config.js | @@ -1,7 +1,7 @@
-const withTM = require('next-plugin-transpile-modules')
+const withTM = require('next-transpile-modules')
// Tell webpack to compile the "bar" package
-// https://www.npmjs.com/package/next-plugin-transpile-modules
+// https://www.npmjs.com/package/next-transpile-modules
module.exports = withTM({
... | true |
Other | vercel | next.js | e05229be54d349d46710ee5a6fcc9ef49953cc28.json | Fix hot reloading in the yarn workspaces example (#6402)
* Fix hot reloading in the yarn workspaces example
* Update README links | examples/with-yarn-workspaces/packages/web-app/package.json | @@ -8,9 +8,9 @@
},
"dependencies": {
"next": "latest",
- "next-plugin-transpile-modules": "0.1.1",
- "react": "^16.7.0",
- "react-dom": "^16.7.0"
+ "next-transpile-modules": "^2.0.0",
+ "react": "^16.8.3",
+ "react-dom": "^16.8.3"
},
"license": "ISC"
} | true |
Other | vercel | next.js | 71ae456a7ca706ce8eaa006486d8bebf0beff7af.json | Fix invalid ping response throwing error in client (#6397) | packages/next/client/on-demand-entries-client.js | @@ -34,18 +34,20 @@ export default async ({ assetPrefix }) => {
}
evtSource.onmessage = event => {
- const payload = JSON.parse(event.data)
- if (payload.invalid) {
- // Payload can be invalid even if the page does not exist.
- // So, we need to make sure it exists before reloading.
... | true |
Other | vercel | next.js | 71ae456a7ca706ce8eaa006486d8bebf0beff7af.json | Fix invalid ping response throwing error in client (#6397) | packages/next/server/on-demand-entry-handler.js | @@ -303,6 +303,7 @@ export default function onDemandEntryHandler (devMiddleware, multiCompiler, {
const runPing = () => {
const data = handlePing(query.page)
+ if (!data) return
res.write('data: ' + JSON.stringify(data) + '\n\n')
}
const pingInterv... | true |
Other | vercel | next.js | e0896e5dbea450f155c45ef6cb3882085f83861c.json | Add an example using ESI cache (with React ESI) (#6225)
[React ESI](https://github.com/dunglas/react-esi) is a brand new cache library for vanilla React and Next.js applications, that can make highly dynamic applications as fast as static sites by leveraging the open Edge Server Include specification.
https://githu... | examples/ssr-caching/README.md | @@ -45,3 +45,5 @@ React Server Side rendering is very costly and takes a lot of server's CPU power
That's what this example demonstrate.
This app uses Next's [custom server and routing](https://github.com/zeit/next.js#custom-server-and-routing) mode. It also uses [express](https://expressjs.com/) to handle routing ... | true |
Other | vercel | next.js | e0896e5dbea450f155c45ef6cb3882085f83861c.json | Add an example using ESI cache (with React ESI) (#6225)
[React ESI](https://github.com/dunglas/react-esi) is a brand new cache library for vanilla React and Next.js applications, that can make highly dynamic applications as fast as static sites by leveraging the open Edge Server Include specification.
https://githu... | examples/with-react-esi/.babelrc | @@ -0,0 +1,5 @@
+{
+ "presets": [
+ "next/babel"
+ ]
+} | true |
Other | vercel | next.js | e0896e5dbea450f155c45ef6cb3882085f83861c.json | Add an example using ESI cache (with React ESI) (#6225)
[React ESI](https://github.com/dunglas/react-esi) is a brand new cache library for vanilla React and Next.js applications, that can make highly dynamic applications as fast as static sites by leveraging the open Edge Server Include specification.
https://githu... | examples/with-react-esi/.gitignore | @@ -0,0 +1,3 @@
+/node_modules
+/dist
+.next | true |
Other | vercel | next.js | e0896e5dbea450f155c45ef6cb3882085f83861c.json | Add an example using ESI cache (with React ESI) (#6225)
[React ESI](https://github.com/dunglas/react-esi) is a brand new cache library for vanilla React and Next.js applications, that can make highly dynamic applications as fast as static sites by leveraging the open Edge Server Include specification.
https://githu... | examples/with-react-esi/Dockerfile | @@ -0,0 +1,13 @@
+FROM cooptilleuls/varnish:6.0-alpine AS varnish
+
+COPY docker/varnish/default.vcl /usr/local/etc/varnish/default.vcl
+
+FROM node:11.5-alpine as node
+
+RUN mkdir -p /usr/src/app
+WORKDIR /usr/src/app
+
+COPY . ./
+RUN yarn install
+RUN yarn build
+CMD yarn start | true |
Other | vercel | next.js | e0896e5dbea450f155c45ef6cb3882085f83861c.json | Add an example using ESI cache (with React ESI) (#6225)
[React ESI](https://github.com/dunglas/react-esi) is a brand new cache library for vanilla React and Next.js applications, that can make highly dynamic applications as fast as static sites by leveraging the open Edge Server Include specification.
https://githu... | examples/with-react-esi/README.md | @@ -0,0 +1,42 @@
+[](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/with-react-esi)
+# React ESI example
+
+# Example app with prefetching pages
+
+## How to use
+
+### Using `create-next-app`
+
+Execute [`create-next-app`](https... | true |
Other | vercel | next.js | e0896e5dbea450f155c45ef6cb3882085f83861c.json | Add an example using ESI cache (with React ESI) (#6225)
[React ESI](https://github.com/dunglas/react-esi) is a brand new cache library for vanilla React and Next.js applications, that can make highly dynamic applications as fast as static sites by leveraging the open Edge Server Include specification.
https://githu... | examples/with-react-esi/docker-compose.yml | @@ -0,0 +1,22 @@
+version: '3.4'
+
+services:
+ node:
+ build:
+ context: .
+ target: node
+ ports:
+ - "8080:80" # To debug
+
+ varnish:
+ build:
+ context: .
+ target: varnish
+ depends_on:
+ - node
+ volumes:
+ - ./docker/varnish/:/usr/local/etc/varnish:ro
+ tmp... | true |
Other | vercel | next.js | e0896e5dbea450f155c45ef6cb3882085f83861c.json | Add an example using ESI cache (with React ESI) (#6225)
[React ESI](https://github.com/dunglas/react-esi) is a brand new cache library for vanilla React and Next.js applications, that can make highly dynamic applications as fast as static sites by leveraging the open Edge Server Include specification.
https://githu... | examples/with-react-esi/docker/varnish/default.vcl | @@ -0,0 +1,24 @@
+vcl 4.0;
+
+import std;
+
+backend node {
+ .host = "node";
+ .port = "80";
+}
+
+sub vcl_backend_response {
+ # Enable ESI support
+ if (beresp.http.Surrogate-Control ~ "ESI/1.0") {
+ unset beresp.http.Surrogate-Control;
+ set beresp.do_esi = true;
+ }
+}
+
+sub vcl_recv {
+ # Remove cook... | true |
Other | vercel | next.js | e0896e5dbea450f155c45ef6cb3882085f83861c.json | Add an example using ESI cache (with React ESI) (#6225)
[React ESI](https://github.com/dunglas/react-esi) is a brand new cache library for vanilla React and Next.js applications, that can make highly dynamic applications as fast as static sites by leveraging the open Edge Server Include specification.
https://githu... | examples/with-react-esi/package.json | @@ -0,0 +1,20 @@
+{
+ "name": "with-react-esi",
+ "author": "Kévin Dunglas <dunglas@gmail.com>",
+ "main": "dist/server.js",
+ "dependencies": {
+ "express": "^4.16.4",
+ "next": "^7.0.2",
+ "react": "^16.7.0",
+ "react-dom": "^16.7.0",
+ "react-esi": "^0.1"
+ },
+ "scripts": {
+ "build": "babel... | true |
Other | vercel | next.js | e0896e5dbea450f155c45ef6cb3882085f83861c.json | Add an example using ESI cache (with React ESI) (#6225)
[React ESI](https://github.com/dunglas/react-esi) is a brand new cache library for vanilla React and Next.js applications, that can make highly dynamic applications as fast as static sites by leveraging the open Edge Server Include specification.
https://githu... | examples/with-react-esi/src/components/BreakingNews.js | @@ -0,0 +1,50 @@
+import React from 'react'
+
+// functional component
+const BreakingNews = props => (
+ <section>
+ <h1>Breaking News</h1>
+ {props.news &&
+ props.news.map((breaking, i) => (
+ <article key={i}>
+ <h1>{breaking.title}</h1>
+ <p>{breaking.body}</p>
+ </artic... | true |
Other | vercel | next.js | e0896e5dbea450f155c45ef6cb3882085f83861c.json | Add an example using ESI cache (with React ESI) (#6225)
[React ESI](https://github.com/dunglas/react-esi) is a brand new cache library for vanilla React and Next.js applications, that can make highly dynamic applications as fast as static sites by leveraging the open Edge Server Include specification.
https://githu... | examples/with-react-esi/src/components/TopArticles.js | @@ -0,0 +1,55 @@
+import React from 'react'
+
+/**
+ * Return the top articles of the month. Can be cached 1 hour.
+ */
+export default class TopArticles extends React.Component {
+ static async getInitialProps ({ props, req, res }) {
+ if (res) {
+ // server side, cache this fragment for 1 hour
+ res.set... | true |
Other | vercel | next.js | e0896e5dbea450f155c45ef6cb3882085f83861c.json | Add an example using ESI cache (with React ESI) (#6225)
[React ESI](https://github.com/dunglas/react-esi) is a brand new cache library for vanilla React and Next.js applications, that can make highly dynamic applications as fast as static sites by leveraging the open Edge Server Include specification.
https://githu... | examples/with-react-esi/src/components/Weather.js | @@ -0,0 +1,37 @@
+import React from 'react'
+
+/**
+ * Return the weather. This component is not loaded on the homepage, to test that getInitialProps works client-side too.
+ */
+export default class TopArticles extends React.Component {
+ static async getInitialProps ({ props, req, res }) {
+ // Fetch the weather ... | true |
Other | vercel | next.js | e0896e5dbea450f155c45ef6cb3882085f83861c.json | Add an example using ESI cache (with React ESI) (#6225)
[React ESI](https://github.com/dunglas/react-esi) is a brand new cache library for vanilla React and Next.js applications, that can make highly dynamic applications as fast as static sites by leveraging the open Edge Server Include specification.
https://githu... | examples/with-react-esi/src/pages/article.js | @@ -0,0 +1,33 @@
+import withESI from 'react-esi'
+import React from 'react'
+import Link from 'next/link'
+import BreakingNews from '../components/BreakingNews'
+import TopArticles from '../components/TopArticles'
+import Weather from '../components/Weather'
+
+const BreakingNewsESI = withESI(BreakingNews, 'BreakingNe... | true |
Other | vercel | next.js | e0896e5dbea450f155c45ef6cb3882085f83861c.json | Add an example using ESI cache (with React ESI) (#6225)
[React ESI](https://github.com/dunglas/react-esi) is a brand new cache library for vanilla React and Next.js applications, that can make highly dynamic applications as fast as static sites by leveraging the open Edge Server Include specification.
https://githu... | examples/with-react-esi/src/pages/index.js | @@ -0,0 +1,31 @@
+import withESI from 'react-esi'
+import React from 'react'
+import Link from 'next/link'
+import BreakingNews from '../components/BreakingNews'
+import TopArticles from '../components/TopArticles'
+
+const BreakingNewsESI = withESI(BreakingNews, 'BreakingNews')
+const TopArticlesESI = withESI(TopArtic... | true |
Other | vercel | next.js | e0896e5dbea450f155c45ef6cb3882085f83861c.json | Add an example using ESI cache (with React ESI) (#6225)
[React ESI](https://github.com/dunglas/react-esi) is a brand new cache library for vanilla React and Next.js applications, that can make highly dynamic applications as fast as static sites by leveraging the open Edge Server Include specification.
https://githu... | examples/with-react-esi/src/server.js | @@ -0,0 +1,32 @@
+import express from 'express'
+import next from 'next'
+import { path, serveFragment } from 'react-esi/lib/server'
+
+const dev = process.env.NODE_ENV !== 'production'
+const port = parseInt(process.env.PORT, 10) || (dev ? 3000 : 80)
+const app = next({ dev, dir: dev ? 'src/' : 'dist/' })
+const handl... | true |
Other | vercel | next.js | d14d1704cb7f619ffe89c390c0898ae394c8a87a.json | Remove ansi-html dep (#6394)
It's not needed since we use react-error-overlay for webpack errors. | packages/next/build/webpack-config.ts | @@ -83,7 +83,7 @@ export default function getBaseWebpackConfig (dir: string, {dev = false, isServe
target: isServer ? 'node' : 'web',
externals: isServer && target !== 'serverless' ? [
(context, request, callback) => {
- const notExternalModules = ['next/app', 'next/document', 'next/link', 'next... | true |
Other | vercel | next.js | d14d1704cb7f619ffe89c390c0898ae394c8a87a.json | Remove ansi-html dep (#6394)
It's not needed since we use react-error-overlay for webpack errors. | packages/next/package.json | @@ -49,7 +49,6 @@
"@babel/runtime": "7.1.2",
"@babel/runtime-corejs2": "7.1.2",
"@babel/template": "7.1.2",
- "ansi-html": "0.0.7",
"arg": "3.0.0",
"async-sema": "2.1.4",
"autodll-webpack-plugin": "0.4.2", | true |
Other | vercel | next.js | d14d1704cb7f619ffe89c390c0898ae394c8a87a.json | Remove ansi-html dep (#6394)
It's not needed since we use react-error-overlay for webpack errors. | packages/next/server/error-debug.js | @@ -1,21 +1,14 @@
import React from 'react'
-import ansiHTML from 'ansi-html'
import Head from 'next-server/head'
-// This component is rendered through dev-error-overlay on the client side.
-// On the server side it's rendered directly
+// This component is only rendered on the server side.
export default functio... | true |
Other | vercel | next.js | d14d1704cb7f619ffe89c390c0898ae394c8a87a.json | Remove ansi-html dep (#6394)
It's not needed since we use react-error-overlay for webpack errors. | test/integration/basic/test/client-navigation.js | @@ -663,7 +663,7 @@ export default (context) => {
})
describe('runtime errors', () => {
- it('should show ErrorDebug when a client side error is thrown inside a component', async () => {
+ it('should show react-error-overlay when a client side error is thrown inside a component', async () => {
... | true |
Other | vercel | next.js | 9f5d1ef31bc8fa9db525db1d895472ab58f0192f.json | Add example using lingui.js (#6210) | examples/with-lingui/.babelrc | @@ -0,0 +1,8 @@
+{
+ "presets": [
+ "next/babel"
+ ],
+ "plugins": [
+ "macros"
+ ]
+}
\ No newline at end of file | true |
Other | vercel | next.js | 9f5d1ef31bc8fa9db525db1d895472ab58f0192f.json | Add example using lingui.js (#6210) | examples/with-lingui/.gitignore | @@ -0,0 +1,2 @@
+locale/_build
+locale/*/*.js
\ No newline at end of file | true |
Other | vercel | next.js | 9f5d1ef31bc8fa9db525db1d895472ab58f0192f.json | Add example using lingui.js (#6210) | examples/with-lingui/README.md | @@ -0,0 +1,56 @@
+[](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/with-lingui)
+
+# With Lingui example
+
+## How to use
+
+### Using `create-next-app`
+
+Execute [`create-next-app`](https://github.com/segmentio/create-next-app... | true |
Other | vercel | next.js | 9f5d1ef31bc8fa9db525db1d895472ab58f0192f.json | Add example using lingui.js (#6210) | examples/with-lingui/components/LangSwitcher.js | @@ -0,0 +1,32 @@
+import Router from 'next/router'
+import { I18n } from '@lingui/react'
+import { t, Trans } from '@lingui/macro'
+
+const availableLanguageNames = {
+ 'en': t`English`,
+ 'sv': t`Swedish`
+}
+const availableLanguages = Object.keys(availableLanguageNames)
+
+export default () => {
+ function onSubmi... | true |
Other | vercel | next.js | 9f5d1ef31bc8fa9db525db1d895472ab58f0192f.json | Add example using lingui.js (#6210) | examples/with-lingui/components/withLang.js | @@ -0,0 +1,28 @@
+import React from 'react'
+import { I18nProvider } from '@lingui/react'
+
+export default (Component, defaultLang = 'en') => class WithLang extends React.Component {
+ static async getInitialProps (ctx) {
+ const language = ctx.query.lang || defaultLang
+ const [props, catalog] = await Promise.... | true |
Other | vercel | next.js | 9f5d1ef31bc8fa9db525db1d895472ab58f0192f.json | Add example using lingui.js (#6210) | examples/with-lingui/locale/en/messages.po | @@ -0,0 +1,38 @@
+msgid ""
+msgstr ""
+"POT-Creation-Date: 2019-02-05 13:34+0100\n"
+"Mime-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: @lingui/cli\n"
+"Language: en\n"
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"PO-Revision-Date: \n"
+"Las... | true |
Other | vercel | next.js | 9f5d1ef31bc8fa9db525db1d895472ab58f0192f.json | Add example using lingui.js (#6210) | examples/with-lingui/locale/sv/messages.po | @@ -0,0 +1,39 @@
+msgid ""
+msgstr ""
+"POT-Creation-Date: 2019-02-05 13:38+0100\n"
+"Mime-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: @lingui/cli\n"
+"Language: sv\n"
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"PO-Revision-Date: \n"
+"Las... | true |
Other | vercel | next.js | 9f5d1ef31bc8fa9db525db1d895472ab58f0192f.json | Add example using lingui.js (#6210) | examples/with-lingui/next.config.js | @@ -0,0 +1,13 @@
+module.exports = {
+ webpack: (config, options) => {
+ config.module.rules.push({
+ test: /\.po/,
+ use: [
+ {
+ loader: '@lingui/loader'
+ }
+ ]
+ })
+ return config
+ }
+} | true |
Other | vercel | next.js | 9f5d1ef31bc8fa9db525db1d895472ab58f0192f.json | Add example using lingui.js (#6210) | examples/with-lingui/package.json | @@ -0,0 +1,33 @@
+{
+ "name": "with-lingui",
+ "version": "1.0.0",
+ "scripts": {
+ "dev": "next",
+ "build": "lingui compile && next build",
+ "start": "next start",
+ "add-locale": "lingui add-locale",
+ "extract": "lingui extract"
+ },
+ "dependencies": {
+ "@lingui/react": "latest",
+ "nex... | true |
Other | vercel | next.js | 9f5d1ef31bc8fa9db525db1d895472ab58f0192f.json | Add example using lingui.js (#6210) | examples/with-lingui/pages/index.js | @@ -0,0 +1,14 @@
+import Link from 'next/link'
+import { Trans } from '@lingui/macro'
+import withLang from '../components/withLang'
+import LangSwitcher from '../components/LangSwitcher'
+
+const Index = () =>
+ <div>
+ <Trans>Hello World.</Trans>
+ <Link href='/two'><a><Trans>Go to page 2</Trans></a></Link>
+ ... | true |
Other | vercel | next.js | 9f5d1ef31bc8fa9db525db1d895472ab58f0192f.json | Add example using lingui.js (#6210) | examples/with-lingui/pages/two.js | @@ -0,0 +1,12 @@
+import { Trans } from '@lingui/macro'
+import withLang from '../components/withLang'
+import LangSwitcher from '../components/LangSwitcher'
+
+const Two = () =>
+ <div>
+ <Trans>Page two. </Trans>
+ <br />
+ <LangSwitcher />
+ </div>
+
+export default withLang(Two) | true |
Other | vercel | next.js | 3ba18117f3abd8b12f3844a8c303dd18ab7da426.json | Pass all `<Html>` props to `<html>` (#6378)
* Pass along props to html
* Check for html props to be passed
* Switch ordering of html tag props
* Remove children from this.props | packages/next/pages/_document.js | @@ -50,7 +50,12 @@ export class Html extends Component {
render() {
const { amphtml } = this.context._documentProps
- return <html amp={amphtml ? '' : null}>{this.props.children}</html>
+ const { children, ...props } = this.props
+ return (
+ <html {...props} amp={amphtml ? '' : null}>
+ ... | true |
Other | vercel | next.js | 3ba18117f3abd8b12f3844a8c303dd18ab7da426.json | Pass all `<Html>` props to `<html>` (#6378)
* Pass along props to html
* Check for html props to be passed
* Switch ordering of html tag props
* Remove children from this.props | test/integration/app-document/pages/_document.js | @@ -1,5 +1,5 @@
import crypto from 'crypto'
-import Document, { Head, Main, NextScript } from 'next/document'
+import Document, { Html, Head, Main, NextScript } from 'next/document'
const cspHashOf = (text) => {
const hash = crypto.createHash('sha256')
@@ -43,7 +43,7 @@ export default class MyDocument extends Do... | true |
Other | vercel | next.js | 3ba18117f3abd8b12f3844a8c303dd18ab7da426.json | Pass all `<Html>` props to `<html>` (#6378)
* Pass along props to html
* Check for html props to be passed
* Switch ordering of html tag props
* Remove children from this.props | test/integration/app-document/test/rendering.js | @@ -10,6 +10,11 @@ export default function ({ app }, suiteName, render, fetch) {
describe(suiteName, () => {
describe('_document', () => {
+ test('It has a custom html class', async () => {
+ const $ = await get$('/')
+ expect($('html').hasClass('test-html-props'))
+ })
+
test('... | true |
Other | vercel | next.js | 9ae27b20b4f8fecce3289541e224e4adf017085c.json | upgrade styled-jsx to v3 (#4936)
Upgrade styled-jsx to v3 (major) | package.json | @@ -101,7 +101,7 @@
"send": "0.16.1",
"source-map": "0.5.7",
"strip-ansi": "3.0.1",
- "styled-jsx": "2.2.7",
+ "styled-jsx": "3.0.2",
"unfetch": "3.0.0",
"url": "0.11.0",
"uuid": "3.1.0", | false |
Other | vercel | next.js | 4d8e9cacdd5b3833ae4a52bfe1ae9ad0a6a3104d.json | Improve getDisplayName util (#4944)
- [x] Add unit test
- [x] Allow to get the display name of a native component (e.g.: `div`) without throwing
- [ ] Remove displayName in production mode | lib/utils.js | @@ -46,6 +46,10 @@ export function printAndExit (message, code = 1) {
}
export function getDisplayName (Component) {
+ if (typeof Component === 'string') {
+ return Component
+ }
+
return Component.displayName || Component.name || 'Unknown'
}
| true |
Other | vercel | next.js | 4d8e9cacdd5b3833ae4a52bfe1ae9ad0a6a3104d.json | Improve getDisplayName util (#4944)
- [x] Add unit test
- [x] Allow to get the display name of a native component (e.g.: `div`) without throwing
- [ ] Remove displayName in production mode | test/unit/getDisplayName.test.js | @@ -0,0 +1,30 @@
+/* global describe, it, expect */
+import { Component } from 'react'
+import { getDisplayName } from '../../dist/lib/utils'
+
+describe('getDisplayName', () => {
+ it('gets the proper display name of a component', () => {
+ class ComponentOne extends Component {
+ render () {
+ return ... | true |
Other | vercel | next.js | 9319c158a592b454928e6a4b51748d4fa8d6af94.json | Upgrade Babel to 7.0.0-rc.1 (major) (#4937)
Fixes #4691
Fixes #4614
This PR gives path to https://github.com/zeit/next-plugins/pull/242
I did not add or remove `^` near dependency versions in package.json files. However, I don't exclude that some changes can be made given that rc is more stable than beta. | build/babel/preset.js | @@ -39,7 +39,6 @@ module.exports = (context, opts = {}) => ({
require('@babel/plugin-proposal-object-rest-spread'),
[require('@babel/plugin-transform-runtime'), opts['transform-runtime'] || {
helpers: false,
- polyfill: false,
regenerator: true
}],
[require('styled-jsx/babel'), st... | true |
Other | vercel | next.js | 9319c158a592b454928e6a4b51748d4fa8d6af94.json | Upgrade Babel to 7.0.0-rc.1 (major) (#4937)
Fixes #4691
Fixes #4614
This PR gives path to https://github.com/zeit/next-plugins/pull/242
I did not add or remove `^` near dependency versions in package.json files. However, I don't exclude that some changes can be made given that rc is more stable than beta. | examples/custom-server-typescript/package.json | @@ -5,7 +5,7 @@
"start": "NODE_ENV=production node .next/production-server/index.js"
},
"dependencies": {
- "@babel/core": "^7.0.0-beta.48",
+ "@babel/core": "^7.0.0-rc.1",
"@zeit/next-typescript": "1.1.0",
"babel-loader": "^7.1.4",
"next": "latest", | true |
Other | vercel | next.js | 9319c158a592b454928e6a4b51748d4fa8d6af94.json | Upgrade Babel to 7.0.0-rc.1 (major) (#4937)
Fixes #4691
Fixes #4614
This PR gives path to https://github.com/zeit/next-plugins/pull/242
I did not add or remove `^` near dependency versions in package.json files. However, I don't exclude that some changes can be made given that rc is more stable than beta. | examples/with-configured-preset-env/.babelrc | @@ -16,8 +16,7 @@
},
"transform-runtime": {
"regenerator": false,
- "useBuiltIns": true,
- "polyfill": false
+ "useBuiltIns": true
}
}
] | true |
Other | vercel | next.js | 9319c158a592b454928e6a4b51748d4fa8d6af94.json | Upgrade Babel to 7.0.0-rc.1 (major) (#4937)
Fixes #4691
Fixes #4614
This PR gives path to https://github.com/zeit/next-plugins/pull/242
I did not add or remove `^` near dependency versions in package.json files. However, I don't exclude that some changes can be made given that rc is more stable than beta. | examples/with-custom-babel-config/package.json | @@ -16,6 +16,6 @@
"author": "",
"license": "ISC",
"devDependencies": {
- "@babel/plugin-proposal-do-expressions": "7.0.0-beta.56"
+ "@babel/plugin-proposal-do-expressions": "7.0.0-rc.1"
}
} | true |
Other | vercel | next.js | 9319c158a592b454928e6a4b51748d4fa8d6af94.json | Upgrade Babel to 7.0.0-rc.1 (major) (#4937)
Fixes #4691
Fixes #4614
This PR gives path to https://github.com/zeit/next-plugins/pull/242
I did not add or remove `^` near dependency versions in package.json files. However, I don't exclude that some changes can be made given that rc is more stable than beta. | examples/with-firebase-hosting/package.json | @@ -27,7 +27,7 @@
"react-dom": "^16.3.2"
},
"devDependencies": {
- "@babel/cli": "^7.0.0-beta.42",
+ "@babel/cli": "^7.0.0-rc.1",
"cpx": "1.5.0",
"firebase-tools": "3.18.4",
"prettier": "1.12.1", | true |
Other | vercel | next.js | 9319c158a592b454928e6a4b51748d4fa8d6af94.json | Upgrade Babel to 7.0.0-rc.1 (major) (#4937)
Fixes #4691
Fixes #4614
This PR gives path to https://github.com/zeit/next-plugins/pull/242
I did not add or remove `^` near dependency versions in package.json files. However, I don't exclude that some changes can be made given that rc is more stable than beta. | package.json | @@ -58,16 +58,16 @@
"bin/*": "standard"
},
"dependencies": {
- "@babel/core": "7.0.0-beta.42",
- "@babel/plugin-proposal-class-properties": "7.0.0-beta.42",
- "@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.42",
- "@babel/plugin-syntax-dynamic-import": "7.0.0-beta.42",
- "@babel/plugi... | true |
Other | vercel | next.js | 9319c158a592b454928e6a4b51748d4fa8d6af94.json | Upgrade Babel to 7.0.0-rc.1 (major) (#4937)
Fixes #4691
Fixes #4614
This PR gives path to https://github.com/zeit/next-plugins/pull/242
I did not add or remove `^` near dependency versions in package.json files. However, I don't exclude that some changes can be made given that rc is more stable than beta. | yarn.lock | @@ -2,68 +2,37 @@
# yarn lockfile v1
-"@babel/code-frame@7.0.0-beta.42":
- version "7.0.0-beta.42"
- resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.42.tgz#a9c83233fa7cd06b39dc77adbb908616ff4f1962"
- dependencies:
- "@babel/highlight" "7.0.0-beta.42"
-
"@babel/code-frame@7.0... | true |
Other | vercel | next.js | b990b29d2d64a7c12152752264fbd79e5371681b.json | Update Apollo links in examples (#4933) | examples/with-apollo-and-redux-saga/lib/withApollo.js | @@ -54,7 +54,7 @@ export default ComposedComponent => {
} catch (error) {
// Prevent Apollo Client GraphQL errors from crashing SSR.
// Handle them in components via the data.error prop:
- // http://dev.apollodata.com/react/api-queries.html#graphql-query-data-error
+ // ... | true |
Other | vercel | next.js | b990b29d2d64a7c12152752264fbd79e5371681b.json | Update Apollo links in examples (#4933) | examples/with-apollo-and-redux-saga/pages/about.js | @@ -7,13 +7,13 @@ export default () => (
<article>
<h1>The Idea Behind This Example</h1>
<p>
- <a href='http://dev.apollodata.com'>Apollo</a> 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 ana... | true |
Other | vercel | next.js | b990b29d2d64a7c12152752264fbd79e5371681b.json | Update Apollo links in examples (#4933) | examples/with-apollo-and-redux/lib/withApollo.js | @@ -54,7 +54,7 @@ export default ComposedComponent => {
} catch (error) {
// Prevent Apollo Client GraphQL errors from crashing SSR.
// Handle them in components via the data.error prop:
- // http://dev.apollodata.com/react/api-queries.html#graphql-query-data-error
+ // ... | true |
Other | vercel | next.js | b990b29d2d64a7c12152752264fbd79e5371681b.json | Update Apollo links in examples (#4933) | examples/with-apollo-auth/README.md | @@ -46,11 +46,11 @@ now
This is an extention of the _[with Apollo](https://github.com/zeit/next.js/tree/master/examples/with-apollo#the-idea-behind-the-example)_ example:
-> [Apollo](http://dev.apollodata.com) is a GraphQL client that allows you to easily query the exact data you need from a GraphQL server. In add... | true |
Other | vercel | next.js | b990b29d2d64a7c12152752264fbd79e5371681b.json | Update Apollo links in examples (#4933) | examples/with-apollo-auth/lib/withApollo.js | @@ -54,7 +54,7 @@ export default App => {
} catch (error) {
// Prevent Apollo Client GraphQL errors from crashing SSR.
// Handle them in components via the data.error prop:
- // http://dev.apollodata.com/react/api-queries.html#graphql-query-data-error
+ // https://www.apollographq... | true |
Other | vercel | next.js | b990b29d2d64a7c12152752264fbd79e5371681b.json | Update Apollo links in examples (#4933) | examples/with-apollo/README.md | @@ -44,10 +44,10 @@ now
## The idea behind the example
-[Apollo](http://dev.apollodata.com) 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 o... | true |
Other | vercel | next.js | b990b29d2d64a7c12152752264fbd79e5371681b.json | Update Apollo links in examples (#4933) | examples/with-apollo/lib/with-apollo-client.js | @@ -30,7 +30,7 @@ export default (App) => {
} catch (error) {
// Prevent Apollo Client GraphQL errors from crashing SSR.
// Handle them in components via the data.error prop:
- // http://dev.apollodata.com/react/api-queries.html#graphql-query-data-error
+ // https://www.... | true |
Other | vercel | next.js | b990b29d2d64a7c12152752264fbd79e5371681b.json | Update Apollo links in examples (#4933) | examples/with-apollo/pages/about.js | @@ -7,7 +7,7 @@ export default () => (
<article>
<h1>The Idea Behind This Example</h1>
<p>
- <a href='http://dev.apollodata.com'>Apollo</a> is a GraphQL client that
+ <a href='https://www.apollographql.com/client/'>Apollo</a> is a GraphQL client that
allows you to easily query ... | true |
Other | vercel | next.js | 6de99ebc4a2cbfbb4d6b6481239dfece7848047e.json | Set correct status for sigint (#4917)
Fixes #4916 | bin/next | @@ -75,7 +75,7 @@ const startProcess = () => {
process.exit(137)
}
console.log(`got signal ${signal}, exiting`)
- process.exit(1)
+ process.exit(signal === 'SIGINT' ? 0 : 1)
}
process.exit(0)
}) | false |
Other | vercel | next.js | 3286ecb3fca0f7df2ef88a00b6e51c041dc4f95c.json | Add slate.js example (#4899) | examples/with-slate/README.md | @@ -0,0 +1,41 @@
+[](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/with-slate)
+
+# slate.js example
+
+## How to use
+
+### Using `create-next-app`
+
+Download [`create-next-app`](https://github.com/segmentio/create-next-app) t... | true |
Other | vercel | next.js | 3286ecb3fca0f7df2ef88a00b6e51c041dc4f95c.json | Add slate.js example (#4899) | examples/with-slate/package.json | @@ -0,0 +1,18 @@
+{
+ "name": "with-slate",
+ "version": "1.0.0",
+ "scripts": {
+ "dev": "next",
+ "build": "next build",
+ "start": "next start"
+ },
+ "dependencies": {
+ "immutable": "^3.8.2",
+ "next": "6.1.1",
+ "react": "^16.4.2",
+ "react-dom": "^16.4.2",
+ "slate": "^0.37.0",
+ ... | true |
Other | vercel | next.js | 3286ecb3fca0f7df2ef88a00b6e51c041dc4f95c.json | Add slate.js example (#4899) | examples/with-slate/pages/index.js | @@ -0,0 +1,37 @@
+import React from 'react'
+import Plain from 'slate-plain-serializer'
+import { Editor } from 'slate-react'
+import { KeyUtils } from 'slate'
+
+class Index extends React.Component {
+ constructor (props) {
+ super(props)
+
+ // In order to allow ssr we need to reset the key
+ // generating ... | true |
Other | vercel | next.js | f3f939dde4c06eb7be88dfac671d015d3724e2be.json | Run method sorting codemod (#4909)
react-codemod recommended way of having methods defined | lib/app.js | @@ -5,19 +5,19 @@ import { execOnce, warn, loadGetInitialProps } from './utils'
import { makePublicRouterInstance } from './router'
export default class App extends Component {
+ static childContextTypes = {
+ _containerProps: PropTypes.any,
+ headManager: PropTypes.object,
+ router: PropTypes.object
+ }... | true |
Other | vercel | next.js | f3f939dde4c06eb7be88dfac671d015d3724e2be.json | Run method sorting codemod (#4909)
react-codemod recommended way of having methods defined | lib/link.js | @@ -19,11 +19,6 @@ function isLocal (href) {
const warnLink = execOnce(warn)
class Link extends Component {
- constructor (props, ...rest) {
- super(props, ...rest)
- this.formatUrls(props)
- }
-
static propTypes = exact({
href: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
... | true |
Other | vercel | next.js | f3f939dde4c06eb7be88dfac671d015d3724e2be.json | Run method sorting codemod (#4909)
react-codemod recommended way of having methods defined | lib/side-effect.js | @@ -34,13 +34,13 @@ export default function withSideEffect (reduceComponentsToState, handleStateChan
}
class SideEffect extends Component {
- // Try to use displayName of wrapped component
- static displayName = `SideEffect(${getDisplayName(WrappedComponent)})`
+ // Expose canUseDOM so tests ... | true |
Other | vercel | next.js | f3f939dde4c06eb7be88dfac671d015d3724e2be.json | Run method sorting codemod (#4909)
react-codemod recommended way of having methods defined | server/document.js | @@ -9,16 +9,16 @@ const Fragment = React.Fragment || function Fragment ({ children }) {
}
export default class Document extends Component {
+ static childContextTypes = {
+ _documentProps: PropTypes.any
+ }
+
static getInitialProps ({ renderPage }) {
const { html, head, errorHtml, buildManifest } = ren... | true |
Other | vercel | next.js | f3f939dde4c06eb7be88dfac671d015d3724e2be.json | Run method sorting codemod (#4909)
react-codemod recommended way of having methods defined | test/integration/basic/pages/dynamic/bundle.js | @@ -24,14 +24,14 @@ const HelloBundle = dynamic({
})
export default class Bundle extends React.Component {
- static getInitialProps ({ query }) {
- return { showMore: Boolean(query.showMore) }
- }
-
static childContextTypes = {
data: PropTypes.object
}
+ static getInitialProps ({ query }) {
+ ... | true |
Other | vercel | next.js | f3f939dde4c06eb7be88dfac671d015d3724e2be.json | Run method sorting codemod (#4909)
react-codemod recommended way of having methods defined | test/integration/basic/pages/nav/shallow-routing.js | @@ -16,17 +16,17 @@ export default class extends Component {
return { getInitialPropsRunCount }
}
+ getCurrentCounter () {
+ const { url } = this.props
+ return url.query.counter ? parseInt(url.query.counter) : 0
+ }
+
increase () {
const counter = this.getCurrentCounter()
const href = `/... | true |
Other | vercel | next.js | f3f939dde4c06eb7be88dfac671d015d3724e2be.json | Run method sorting codemod (#4909)
react-codemod recommended way of having methods defined | test/integration/production/pages/dynamic/bundle.js | @@ -23,14 +23,14 @@ const HelloBundle = dynamic({
})
export default class Bundle extends React.Component {
- static getInitialProps ({ query }) {
- return { showMore: Boolean(query.showMore) }
- }
-
static childContextTypes = {
data: PropTypes.object
}
+ static getInitialProps ({ query }) {
+ ... | true |
Other | vercel | next.js | f3f939dde4c06eb7be88dfac671d015d3724e2be.json | Run method sorting codemod (#4909)
react-codemod recommended way of having methods defined | test/integration/static/pages/dynamic.js | @@ -3,12 +3,12 @@ import React from 'react'
import Link from 'next/link'
export default class DynamicPage extends React.Component {
- state = {}
-
static getInitialProps ({ query }) {
return { text: query.text }
}
+ state = {}
+
componentDidMount () {
const [, hash] = location.href.split('#')... | true |
Other | vercel | next.js | f3f939dde4c06eb7be88dfac671d015d3724e2be.json | Run method sorting codemod (#4909)
react-codemod recommended way of having methods defined | test/integration/with-router/components/header-nav.js | @@ -30,9 +30,9 @@ class HeaderNav extends React.Component {
this.props.router.events.off('routeChangeComplete', this.handleRouteChange)
}
- handleRouteChangeTopLevelRouterDeprecatedBehavior = url => {
+ handleRouteChange = url => {
this.setState({
- activeURLTopLevelRouterDeprecatedBehavior: url
+... | true |
Other | vercel | next.js | e8aa78204aafe4b1cb97226d670b4474d536a683.json | Improve glamor example (#4893)
Changes:
- Use css prop on the element to style it
- Add webpack + babelrc configuration to remove otherwise needed import boilerplate [according to glamor docs](https://github.com/threepointone/glamor/blob/master/docs/createElement.md)
Rationale: The killer feature of glamor that m... | examples/with-glamor/.babelrc | @@ -0,0 +1,9 @@
+{
+ "presets": ["next/babel"],
+ "plugins": [
+ [
+ "transform-react-jsx",
+ { "pragma": "Glamor.createElement" }
+ ]
+ ]
+} | true |
Other | vercel | next.js | e8aa78204aafe4b1cb97226d670b4474d536a683.json | Improve glamor example (#4893)
Changes:
- Use css prop on the element to style it
- Add webpack + babelrc configuration to remove otherwise needed import boilerplate [according to glamor docs](https://github.com/threepointone/glamor/blob/master/docs/createElement.md)
Rationale: The killer feature of glamor that m... | examples/with-glamor/README.md | @@ -44,3 +44,5 @@ now
This example features how to use a different styling solution than [styled-jsx](https://github.com/zeit/styled-jsx) that also supports universal styles. That means we can serve the required styles for the first render within the HTML and then load the rest in the client. In this case we are using... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.