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
7b193f1aa7b926b63296d5c7f5bb4c3f33494d76.json
Add basic test setup
package.json
@@ -105,6 +105,7 @@ "chromedriver": "2.29.0", "coveralls": "2.13.1", "cross-env": "4.0.0", + "express": "4.15.2", "fly": "2.0.6", "fly-babel": "2.1.1", "fly-clear": "1.0.1",
true
Other
vercel
next.js
7b193f1aa7b926b63296d5c7f5bb4c3f33494d76.json
Add basic test setup
test/integration/static/test/index.test.js
@@ -0,0 +1,45 @@ +/* global jasmine, describe, it, expect, beforeAll, afterAll */ + +import { join } from 'path' +import { + nextBuild, + nextExport, + renderViaHTTP, + startStaticServer, + stopApp +} from 'next-test-utils' +import webdriver from 'next-webdriver' + +jasmine.DEFAULT_TIMEOUT_INTERVAL = 40000 +const ...
true
Other
vercel
next.js
7b193f1aa7b926b63296d5c7f5bb4c3f33494d76.json
Add basic test setup
test/lib/next-test-utils.js
@@ -1,13 +1,16 @@ import fetch from 'node-fetch' import qs from 'querystring' import http from 'http' +import express from 'express' import server from '../../dist/server/next' import build from '../../dist/server/build' +import _export from '../../dist/server/export' import _pkg from '../../package.json' ex...
true
Other
vercel
next.js
7b193f1aa7b926b63296d5c7f5bb4c3f33494d76.json
Add basic test setup
yarn.lock
@@ -10,6 +10,13 @@ abbrev@1: version "1.1.0" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f" +accepts@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.3.tgz#c3ca7434938648c3e0d9c1e328dd68b622c284ca" + dependenc...
true
Other
vercel
next.js
7c8d0246e2f9eccd43138ef48b7f8a20a772a57a.json
Add rehydration to example/aphrodite (#1858) * Add rehydration to example/aphrodite * linting * replaced yarn.lock
examples/with-aphrodite/pages/_document.js
@@ -4,15 +4,31 @@ import { StyleSheetServer } from 'aphrodite' export default class MyDocument extends Document { static async getInitialProps ({ renderPage }) { const { html, css } = StyleSheetServer.renderStatic(() => renderPage()) - return { ...html, css } + const ids = css.renderedClassNames + ret...
true
Other
vercel
next.js
7c8d0246e2f9eccd43138ef48b7f8a20a772a57a.json
Add rehydration to example/aphrodite (#1858) * Add rehydration to example/aphrodite * linting * replaced yarn.lock
examples/with-aphrodite/pages/index.js
@@ -1,6 +1,13 @@ import React from 'react' import { StyleSheet, css } from 'aphrodite' +if (typeof window !== 'undefined') { + /* StyleSheet.rehydrate takes an array of rendered classnames, + and ensures that the client side render doesn't generate + duplicate style definitions in the <style data-aphrodite> tag ...
true
Other
vercel
next.js
7c8d0246e2f9eccd43138ef48b7f8a20a772a57a.json
Add rehydration to example/aphrodite (#1858) * Add rehydration to example/aphrodite * linting * replaced yarn.lock
yarn.lock
@@ -49,8 +49,8 @@ ajv-keywords@^1.0.0, ajv-keywords@^1.1.1: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" ajv@^4.7.0, ajv@^4.9.1: - version "4.11.7" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.7.tgz#8655a5d86d0824985cc471a1d913...
true
Other
vercel
next.js
9f194677ec0f0b5fbe103d667016a3d05ae76dbd.json
Upgrade jest and simplify .babelrc (#1913) * Upgrade jest and simplify .babelrc * Fix linter
examples/with-jest/.babelrc
@@ -1,15 +1,16 @@ { "env": { "development": { - "presets": ["next/babel"] + "presets": "next/babel" }, "production": { - "presets": ["next/babel"] + "presets": "next/babel" }, "test": { - // next/babel does not transpile import/export syntax. - // So, using es2...
true
Other
vercel
next.js
9f194677ec0f0b5fbe103d667016a3d05ae76dbd.json
Upgrade jest and simplify .babelrc (#1913) * Upgrade jest and simplify .babelrc * Fix linter
examples/with-jest/__tests__/__snapshots__/index.test.js.snap
@@ -1,8 +1,12 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + exports[`With Snapshot Testing App shows "Hello world!" 1`] = ` <div - data-jsx={2648947580}> + data-jsx={2648947580} +> <p - data-jsx={2648947580}> + data-jsx={2648947580} + > Hello World! </p> </div>
true
Other
vercel
next.js
9f194677ec0f0b5fbe103d667016a3d05ae76dbd.json
Upgrade jest and simplify .babelrc (#1913) * Upgrade jest and simplify .babelrc * Fix linter
examples/with-jest/__tests__/index.test.js
@@ -1,15 +1,14 @@ -/* global it, expect, describe */ +/* eslint-env jest */ -import React from 'react' import { shallow } from 'enzyme' +import React from 'react' import renderer from 'react-test-renderer' + import App from '../pages/index.js' describe('With Enzyme', () => { it('App shows "Hello world!"', ()...
true
Other
vercel
next.js
9f194677ec0f0b5fbe103d667016a3d05ae76dbd.json
Upgrade jest and simplify .babelrc (#1913) * Upgrade jest and simplify .babelrc * Fix linter
examples/with-jest/package.json
@@ -2,20 +2,19 @@ "name": "with-jest", "dependencies": { "next": "latest", - "react": "^15.4.2", - "react-dom": "^15.4.2" + "react": "^15.5.4", + "react-dom": "^15.5.4" + }, + "devDependencies": { + "enzyme": "^2.8.2", + "jest": "^20.0.0", + "react-addons-test-utils": "^15.5.1", + "...
true
Other
vercel
next.js
42f1d2efda28d8fa62455db0acbb5091eaae36ed.json
Add a way to customize the output directory.
bin/next-export
@@ -10,11 +10,13 @@ process.env.NODE_ENV = process.env.NODE_ENV || 'production' const argv = parseArgs(process.argv.slice(2), { alias: { h: 'help', - v: 'verbose' + v: 'verbose', + o: 'outdir' }, boolean: ['h'], default: { - v: false + v: false, + o: null } }) @@ -24,11 +26,16 ...
true
Other
vercel
next.js
42f1d2efda28d8fa62455db0acbb5091eaae36ed.json
Add a way to customize the output directory.
server/export.js
@@ -9,7 +9,7 @@ import { printAndExit } from '../lib/utils' export default async function (dir, options) { dir = resolve(dir) - const outDir = join(dir, '.out') + const outDir = options.outdir const nextDir = join(dir, '.next') if (!existsSync(nextDir)) {
true
Other
vercel
next.js
71296cceb3b8ee60994332e1d569858b5c59ff42.json
Add the verbose mode.
bin/next-export
@@ -9,9 +9,13 @@ process.env.NODE_ENV = process.env.NODE_ENV || 'production' const argv = parseArgs(process.argv.slice(2), { alias: { - h: 'help' + h: 'help', + v: 'verbose' }, - boolean: ['h'] + boolean: ['h'], + default: { + v: false + } }) if (argv.help) { @@ -44,7 +48,7 @@ if (!existsSy...
true
Other
vercel
next.js
71296cceb3b8ee60994332e1d569858b5c59ff42.json
Add the verbose mode.
server/export.js
@@ -7,7 +7,7 @@ import getConfig from './config' import { renderToHTML } from './render' import { printAndExit } from '../lib/utils' -export default async function (dir) { +export default async function (dir, options) { dir = resolve(dir) const outDir = join(dir, '.out') const nextDir = join(dir, '.next') ...
true
Other
vercel
next.js
dcc32284293047803ba6fd1808b56ee6cc2861ec.json
Allow next export to build html pages.
server/document.js
@@ -71,7 +71,7 @@ export class Head extends Component { return <head> <link rel='preload' href={`${assetPrefix}/_next/${buildId}/page${realPathname}`} as='script' /> - <link rel='preload' href={`${assetPrefix}/_next/${buildId}/page/_error`} as='script' /> + <link rel='preload' href={`${assetPref...
true
Other
vercel
next.js
dcc32284293047803ba6fd1808b56ee6cc2861ec.json
Allow next export to build html pages.
server/export.js
@@ -1,18 +1,23 @@ import del from 'del' import cp from 'recursive-copy' import mkdirp from 'mkdirp-then' -import { resolve, join } from 'path' -import { existsSync, readFileSync } from 'fs' +import { resolve, join, dirname, sep } from 'path' +import { existsSync, readFileSync, writeFileSync } from 'fs' +import getCo...
true
Other
vercel
next.js
f602f6dc1ede93c97e841743198752923f7a7eb5.json
Copy all the static assests to .out
bin/next
@@ -22,6 +22,7 @@ const commands = new Set([ 'init', 'build', 'start', + 'export', defaultCommand ])
true
Other
vercel
next.js
f602f6dc1ede93c97e841743198752923f7a7eb5.json
Copy all the static assests to .out
bin/next-export
@@ -0,0 +1,51 @@ +#!/usr/bin/env node +import { resolve, join } from 'path' +import { existsSync } from 'fs' +import parseArgs from 'minimist' +import exportApp from '../server/export' +import { printAndExit } from '../lib/utils' + +process.env.NODE_ENV = process.env.NODE_ENV || 'production' + +const argv = parseArgs(p...
true
Other
vercel
next.js
f602f6dc1ede93c97e841743198752923f7a7eb5.json
Copy all the static assests to .out
package.json
@@ -118,6 +118,7 @@ "nyc": "10.3.0", "react": "15.5.3", "react-dom": "15.5.3", + "recursive-copy": "^2.0.6", "standard": "9.0.2", "wd": "1.2.0" },
true
Other
vercel
next.js
f602f6dc1ede93c97e841743198752923f7a7eb5.json
Copy all the static assests to .out
server/export.js
@@ -0,0 +1,34 @@ +import del from 'del' +import cp from 'recursive-copy' +import mkdirp from 'mkdirp-then' +import { resolve, join } from 'path' +import { existsSync, readFileSync } from 'fs' + +export default async function (dir) { + const outDir = resolve(dir, '.out') + const nextDir = resolve(dir, '.next') + + if...
true
Other
vercel
next.js
f602f6dc1ede93c97e841743198752923f7a7eb5.json
Copy all the static assests to .out
yarn.lock
@@ -166,6 +166,10 @@ arr-flatten@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.3.tgz#a274ed85ac08849b6bd7847c4580745dc51adfb1" +array-differ@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33b...
true
Other
vercel
next.js
3813f73ece6d5e541dd59d751d430a0963a5970c.json
Fix error fonts (#826) * add "consolas" font for windows * fix too small font size in non-retina display
lib/error-debug.js
@@ -40,8 +40,8 @@ const styles = { }, message: { - fontFamily: '"SF Mono", "Roboto Mono", "Fira Mono", menlo-regular, monospace', - fontSize: '10px', + fontFamily: '"SF Mono", "Roboto Mono", "Fira Mono", consolas, menlo-regular, monospace', + fontSize: '14px', color: '#fbe7f1', margin: 0, ...
false
Other
vercel
next.js
318f110a8edfe012ada3b0a018ccd8b921776b5d.json
chore(package): update babel-generator to version 6.22.0 (#833)
package.json
@@ -44,7 +44,7 @@ "accepts": "1.3.3", "ansi-html": "0.0.7", "babel-core": "6.22.1", - "babel-generator": "6.21.0", + "babel-generator": "6.22.0", "babel-loader": "6.2.10", "babel-plugin-module-resolver": "2.4.0", "babel-plugin-react-require": "^3.0.0",
false
Other
vercel
next.js
21a22b97918c0df114eab1fa99c67a48a46d9b98.json
chore(package): update babel-runtime to version 6.22.0 (#840)
package.json
@@ -54,7 +54,7 @@ "babel-plugin-transform-runtime": "6.15.0", "babel-preset-es2015": "6.18.0", "babel-preset-react": "6.16.0", - "babel-runtime": "6.20.0", + "babel-runtime": "6.22.0", "case-sensitive-paths-webpack-plugin": "1.1.4", "cross-spawn": "5.0.1", "del": "2.2.2",
false
Other
vercel
next.js
cfb1c0fbd5c3489980a49ffaecd15428e5cfe7cc.json
chore(package): update babel-core to version 6.22.1 (#842)
package.json
@@ -43,7 +43,7 @@ "dependencies": { "accepts": "1.3.3", "ansi-html": "0.0.7", - "babel-core": "6.21.0", + "babel-core": "6.22.1", "babel-generator": "6.21.0", "babel-loader": "6.2.10", "babel-plugin-module-resolver": "2.4.0",
false
Other
vercel
next.js
0627378bc20017d21c30eb00c783569267480a60.json
chore(package): update glamor to version 2.20.22 (#804)
package.json
@@ -59,7 +59,7 @@ "cross-spawn": "5.0.1", "del": "2.2.2", "friendly-errors-webpack-plugin": "1.1.3", - "glamor": "2.20.20", + "glamor": "2.20.22", "glob-promise": "3.1.0", "htmlescape": "1.1.1", "is-windows-bash": "1.0.3",
false
Other
vercel
next.js
ffeeb682af082edb0067a775e485176b43fc33a0.json
Remove useless config override (#790)
examples/custom-server-express/server.js
@@ -2,7 +2,7 @@ const express = require('express') const next = require('next') const dev = process.env.NODE_ENV !== 'production' -const app = next({ dir: '.', dev }) +const app = next({ dev }) const handle = app.getRequestHandler() app.prepare()
false
Other
vercel
next.js
8fa630d85574c47151c797947d035f1fc4e79d9c.json
Add dynamic routing keyword (#788) I was looking for "dynamic routing" in the examples and didn't find it because that keyword isn't used.
examples/parameterized-routing/README.md
@@ -1,5 +1,5 @@ -# Parametrized routes example +# Parametrized routes example (dynamic routing) ## How to use
false
Other
vercel
next.js
789edb87b77db836717e357d632e05e6d06927ed.json
Fix typo in README (#787)
README.md
@@ -271,7 +271,7 @@ Here's a list of supported events: > Here `url` is the URL shown in the browser. If you call `Router.push(url, as)` (or similar), then the value of `url` will be `as`. -Here's how to property listen to the router event `routeChangeStart`: +Here's how to properly listen to the router event `rout...
false
Other
vercel
next.js
6f117ecf77236857032e0ca3cc13d15f4ed1e119.json
Set default NODE_ENV value. (#768)
bin/next-build
@@ -1,11 +1,12 @@ #!/usr/bin/env node - import { resolve, join } from 'path' import { existsSync } from 'fs' import parseArgs from 'minimist' import build from '../server/build' import { printAndExit } from '../lib/utils' +process.env.NODE_ENV = process.env.NODE_ENV || 'production' + const argv = parseArgs(pro...
true
Other
vercel
next.js
6f117ecf77236857032e0ca3cc13d15f4ed1e119.json
Set default NODE_ENV value. (#768)
bin/next-dev
@@ -6,6 +6,8 @@ import { existsSync } from 'fs' import Server from '../server' import { printAndExit } from '../lib/utils' +process.env.NODE_ENV = process.env.NODE_ENV || 'development' + const argv = parseArgs(process.argv.slice(2), { alias: { h: 'help',
true
Other
vercel
next.js
6f117ecf77236857032e0ca3cc13d15f4ed1e119.json
Set default NODE_ENV value. (#768)
bin/next-start
@@ -5,6 +5,8 @@ import parseArgs from 'minimist' import Server from '../server' import { existsSync } from 'fs' +process.env.NODE_ENV = process.env.NODE_ENV || 'production' + const argv = parseArgs(process.argv.slice(2), { alias: { h: 'help',
true
Other
vercel
next.js
8318f5b8dead742dea7b4db1968a1379a5332497.json
Add cross browser stacktrace (#776) * Add cross browser stacktrace * Remove unused stack variable
lib/error-debug.js
@@ -2,7 +2,7 @@ import React from 'react' import ansiHTML from 'ansi-html' import Head from './head' -export default ({ err: { name, message, stack, module } }) => ( +export default ({ err, err: { name, message, module } }) => ( <div style={styles.errorDebug}> <Head> <meta name='viewport' content='wi...
false
Other
vercel
next.js
cebed460142ed77166f08f709fed33170f006831.json
chore(package): update mime-types to version 2.1.14 (#772)
package.json
@@ -65,7 +65,7 @@ "is-windows-bash": "1.0.3", "json-loader": "0.5.4", "loader-utils": "0.2.16", - "mime-types": "2.1.13", + "mime-types": "2.1.14", "minimist": "1.2.0", "mkdirp-then": "1.2.0", "mz": "2.6.0",
false
Other
vercel
next.js
60918eeb36451f00d5b564ba92f702ad8623044c.json
Fix typo for --help messages in /bin (#770)
bin/next-dev
@@ -30,7 +30,7 @@ if (argv.help) { Options --port, -p A port number on which to start the application - --help, -p Displays this message + --help, -h Displays this message `) process.exit(0) }
true
Other
vercel
next.js
60918eeb36451f00d5b564ba92f702ad8623044c.json
Fix typo for --help messages in /bin (#770)
bin/next-init
@@ -22,7 +22,7 @@ if (argv.help) { If no directory is provided the current directory will be used. Options - --help, -p Displays this message + --help, -h Displays this message `) process.exit(0)
true
Other
vercel
next.js
60918eeb36451f00d5b564ba92f702ad8623044c.json
Fix typo for --help messages in /bin (#770)
bin/next-start
@@ -31,7 +31,7 @@ if (argv.help) { Options --port, -p A port number on which to start the application - --help, -p Displays this message + --help, -h Displays this message `) process.exit(0) }
true
Other
vercel
next.js
4c32dd96b7f910a1640390c35be6e60997afb9eb.json
remove unused module alias
server/build/babel/preset.js
@@ -27,8 +27,7 @@ module.exports = { 'next/head': require.resolve('../../../lib/head'), 'next/document': require.resolve('../../../server/document'), 'next/router': require.resolve('../../../lib/router'), - 'styled-jsx/style': require.resolve('styled-jsx/style'), - 'an...
false
Other
vercel
next.js
c19b82dfe23972ed03194fb969d7e4076a7bbb5d.json
Fix title of README (#720)
examples/data-fetch/README.md
@@ -1,5 +1,5 @@ -# Styled components example +# Data fetch example ## How to use
false
Other
vercel
next.js
f3ee901fa66c6116777a97b8eb18903ba8f106c6.json
Use next.js beta for example (#710)
examples/basic-css/package.json
@@ -7,7 +7,7 @@ "start": "next start" }, "dependencies": { - "next": "*" + "next": "^2.0.0-beta" }, "author": "", "license": "ISC"
false
Other
vercel
next.js
409f20a9cad9a08c85b352f192278804e9c0cf68.json
Fix AMP HTML content emit (#9468) * Add failing test * Escape dollar signs in AMP HTML * Update to not use replace for updating AMP_RENDER_TARGET
packages/next/next-server/lib/constants.ts
@@ -15,6 +15,7 @@ export const BLOCKED_PAGES = ['/_document', '/_app'] export const CLIENT_PUBLIC_FILES_PATH = 'public' export const CLIENT_STATIC_FILES_PATH = 'static' export const CLIENT_STATIC_FILES_RUNTIME = 'runtime' +export const AMP_RENDER_TARGET = '__NEXT_AMP_RENDER_TARGET__' export const CLIENT_STATIC_FILE...
true
Other
vercel
next.js
409f20a9cad9a08c85b352f192278804e9c0cf68.json
Fix AMP HTML content emit (#9468) * Add failing test * Escape dollar signs in AMP HTML * Update to not use replace for updating AMP_RENDER_TARGET
packages/next/next-server/server/render.tsx
@@ -31,6 +31,7 @@ import { isInAmpMode } from '../lib/amp' import { PageConfig } from 'next/types' import { isDynamicRoute } from '../lib/router/utils/is-dynamic' import { SPR_GET_INITIAL_PROPS_CONFLICT } from '../../lib/constants' +import { AMP_RENDER_TARGET } from '../lib/constants' export type ManifestItem = {...
true
Other
vercel
next.js
409f20a9cad9a08c85b352f192278804e9c0cf68.json
Fix AMP HTML content emit (#9468) * Add failing test * Escape dollar signs in AMP HTML * Update to not use replace for updating AMP_RENDER_TARGET
packages/next/pages/_document.tsx
@@ -5,6 +5,7 @@ import flush from 'styled-jsx/server' import { CLIENT_STATIC_FILES_RUNTIME_AMP, CLIENT_STATIC_FILES_RUNTIME_WEBPACK, + AMP_RENDER_TARGET, } from '../next-server/lib/constants' import { DocumentContext as DocumentComponentContext } from '../next-server/lib/document-context' import { @@ -530,7 ...
true
Other
vercel
next.js
409f20a9cad9a08c85b352f192278804e9c0cf68.json
Fix AMP HTML content emit (#9468) * Add failing test * Escape dollar signs in AMP HTML * Update to not use replace for updating AMP_RENDER_TARGET
test/integration/amphtml/pages/special-chars.js
@@ -0,0 +1,7 @@ +export const config = { amp: true } + +export default () => ( + <div data-amp-bind-text="fields_maxPrice_live < 801 ? '$' + round(fields_maxPrice_live) : '$800+'"> + $800+ + </div> +)
true
Other
vercel
next.js
409f20a9cad9a08c85b352f192278804e9c0cf68.json
Fix AMP HTML content emit (#9468) * Add failing test * Escape dollar signs in AMP HTML * Update to not use replace for updating AMP_RENDER_TARGET
test/integration/amphtml/test/index.test.js
@@ -58,6 +58,12 @@ describe('AMP Usage', () => { expect($('.abc').length === 1) }) + it('should render the page without leaving render target', async () => { + const html = await renderViaHTTP(appPort, '/special-chars') + await validateAMP(html) + expect(html).not.toContain('__NEXT_AMP_R...
true
Other
vercel
next.js
2cbe4d3560061fb17f3dab5bfc7375601394f9f6.json
Remove Broken Example (`with-apollo-auth`) (#9516)
examples/with-apollo-auth/README.md
@@ -1,70 +0,0 @@ -# Apollo With Authentication Example - -## How to use - -### Using `create-next-app` - -Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) with [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) or [npx](https://github.com/zkat/npx#readme) to bootstrap ...
true
Other
vercel
next.js
2cbe4d3560061fb17f3dab5bfc7375601394f9f6.json
Remove Broken Example (`with-apollo-auth`) (#9516)
examples/with-apollo-auth/components/RegisterBox.js
@@ -1,79 +0,0 @@ -import { useRef } from 'react' -import { useMutation, useApolloClient } from '@apollo/react-hooks' -import gql from 'graphql-tag' -import cookie from 'cookie' -import redirect from '../lib/redirect' - -const CREATE_USER = gql` - mutation Create($name: String!, $email: String!, $password: String!) { -...
true
Other
vercel
next.js
2cbe4d3560061fb17f3dab5bfc7375601394f9f6.json
Remove Broken Example (`with-apollo-auth`) (#9516)
examples/with-apollo-auth/components/SigninBox.js
@@ -1,76 +0,0 @@ -import { useRef } from 'react' -import { useMutation, useApolloClient } from '@apollo/react-hooks' -import gql from 'graphql-tag' -import cookie from 'cookie' -import redirect from '../lib/redirect' - -const SIGN_IN = gql` - mutation Signin($email: String!, $password: String!) { - signinUser(email...
true
Other
vercel
next.js
2cbe4d3560061fb17f3dab5bfc7375601394f9f6.json
Remove Broken Example (`with-apollo-auth`) (#9516)
examples/with-apollo-auth/lib/apollo.js
@@ -1,186 +0,0 @@ -import React from 'react' -import PropTypes from 'prop-types' -import cookie from 'cookie' -import Head from 'next/head' -import { ApolloClient } from 'apollo-client' -import { InMemoryCache } from 'apollo-cache-inmemory' -import { HttpLink } from 'apollo-link-http' -import { setContext } from 'apoll...
true
Other
vercel
next.js
2cbe4d3560061fb17f3dab5bfc7375601394f9f6.json
Remove Broken Example (`with-apollo-auth`) (#9516)
examples/with-apollo-auth/lib/checkLoggedIn.js
@@ -1,21 +0,0 @@ -import gql from 'graphql-tag' - -export default apolloClient => - apolloClient - .query({ - query: gql` - query getUser { - user { - id - name - } - } - `, - }) - .then(({ data }) => { - return { loggedInUser: data } - }...
true
Other
vercel
next.js
2cbe4d3560061fb17f3dab5bfc7375601394f9f6.json
Remove Broken Example (`with-apollo-auth`) (#9516)
examples/with-apollo-auth/lib/redirect.js
@@ -1,13 +0,0 @@ -import Router from 'next/router' - -export default (context, target) => { - if (context.res) { - // server - // 303: "See other" - context.res.writeHead(303, { Location: target }) - context.res.end() - } else { - // In the browser, we just pretend like this never even happened ;) - ...
true
Other
vercel
next.js
2cbe4d3560061fb17f3dab5bfc7375601394f9f6.json
Remove Broken Example (`with-apollo-auth`) (#9516)
examples/with-apollo-auth/package.json
@@ -1,28 +0,0 @@ -{ - "name": "with-apollo-auth", - "version": "0.0.0", - "author": "", - "license": "ISC", - "scripts": { - "dev": "next", - "build": "next build", - "start": "next start" - }, - "dependencies": { - "@apollo/react-hooks": "^3.0.1", - "@apollo/react-ssr": "^3.0.1", - "apollo-cac...
true
Other
vercel
next.js
2cbe4d3560061fb17f3dab5bfc7375601394f9f6.json
Remove Broken Example (`with-apollo-auth`) (#9516)
examples/with-apollo-auth/pages/create-account.js
@@ -1,32 +0,0 @@ -import React from 'react' -import Link from 'next/link' -import { withApollo } from '../lib/apollo' -import redirect from '../lib/redirect' -import checkLoggedIn from '../lib/checkLoggedIn' -import RegisterBox from '../components/RegisterBox' - -const CreateAccountPage = () => ( - <> - {/* Registe...
true
Other
vercel
next.js
2cbe4d3560061fb17f3dab5bfc7375601394f9f6.json
Remove Broken Example (`with-apollo-auth`) (#9516)
examples/with-apollo-auth/pages/index.js
@@ -1,43 +0,0 @@ -import React from 'react' -import cookie from 'cookie' -import { useApolloClient } from '@apollo/react-hooks' -import { withApollo } from '../lib/apollo' -import redirect from '../lib/redirect' -import checkLoggedIn from '../lib/checkLoggedIn' - -const IndexPage = ({ loggedInUser }) => { - const apol...
true
Other
vercel
next.js
2cbe4d3560061fb17f3dab5bfc7375601394f9f6.json
Remove Broken Example (`with-apollo-auth`) (#9516)
examples/with-apollo-auth/pages/signin.js
@@ -1,32 +0,0 @@ -import React from 'react' -import Link from 'next/link' -import { withApollo } from '../lib/apollo' -import redirect from '../lib/redirect' -import checkLoggedIn from '../lib/checkLoggedIn' -import SigninBox from '../components/SigninBox' - -const SigninPage = () => ( - <> - {/* SigninBox handles ...
true
Other
vercel
next.js
2cbe4d3560061fb17f3dab5bfc7375601394f9f6.json
Remove Broken Example (`with-apollo-auth`) (#9516)
examples/with-apollo-auth/project.graphcool
@@ -1,22 +0,0 @@ -# projectId: cj3h80ffbllm20162alevpcby -# version: 3 - -type File implements Node { - contentType: String! - createdAt: DateTime! - id: ID! @isUnique - name: String! - secret: String! @isUnique - size: Int! - updatedAt: DateTime! - url: String! @isUnique -} - -type User implements Node { - cr...
true
Other
vercel
next.js
caa5347873a7162079e4c66ad0d198df8ac670f3.json
Remove Legacy Code (#9515) The `sprStatus` module state is no longer used (and shouldn't be!). We can safely remove this code. I also renamed the drop bundle identifier while I was here.
packages/next/build/babel/plugins/next-page-config.ts
@@ -3,15 +3,13 @@ import * as BabelTypes from '@babel/types' import { PageConfig } from '../../../types' -export const dropBundleIdentifier = '__NEXT_DROP_CLIENT_FILE__' -export const sprStatus = { used: false } - const configKeys = new Set(['amp']) const pageComponentVar = '__NEXT_COMP' // this value can't be ...
false
Other
vercel
next.js
b058427b7634e2edf0a45504a625f4d7a1d2a28c.json
Update CI/test set up (#9499) * Disable concurrency for tests * Add browser instance sharing * Bump concurrency and install chromedriver smoother * Fix config typo * Fix local test * Limit azure concurrency again * Add delay for empty-object-test * Make sure to use open port for chromedriver * Move browser clo...
.circleci/config.yml
@@ -38,9 +38,11 @@ commands: command: yarn install --frozen-lockfile --check-files - run: name: Install correct Chrome Driver version - command: yarn add chromedriver@76 -W && git checkout yarn.lock package.json + command: node node_modules/chromedriver/install.js + ...
true
Other
vercel
next.js
b058427b7634e2edf0a45504a625f4d7a1d2a28c.json
Update CI/test set up (#9499) * Disable concurrency for tests * Add browser instance sharing * Bump concurrency and install chromedriver smoother * Fix config typo * Fix local test * Limit azure concurrency again * Add delay for empty-object-test * Make sure to use open port for chromedriver * Move browser clo...
azure-pipelines.yml
@@ -39,9 +39,9 @@ steps: displayName: 'Install dependencies' - script: | - yarn add chromedriver@76 -W + node node_modules/chromedriver/install.js displayName: 'Install correct Chrome Driver version' - script: | - node run-tests.js -c 2 -g $(group) + node run-tests.js -g $(group)...
true
Other
vercel
next.js
b058427b7634e2edf0a45504a625f4d7a1d2a28c.json
Update CI/test set up (#9499) * Disable concurrency for tests * Add browser instance sharing * Bump concurrency and install chromedriver smoother * Fix config typo * Fix local test * Limit azure concurrency again * Add delay for empty-object-test * Make sure to use open port for chromedriver * Move browser clo...
package.json
@@ -8,8 +8,8 @@ "lerna": "lerna", "dev": "lerna run build --stream --parallel", "dev2": "while true; do yarn --check-files && yarn dev; done", - "testonly": "jest", - "testall": "yarn run testonly -- --ci --reporters=default --reporters=jest-junit --forceExit --runInBand", + "testonly": "jest --...
true
Other
vercel
next.js
b058427b7634e2edf0a45504a625f4d7a1d2a28c.json
Update CI/test set up (#9499) * Disable concurrency for tests * Add browser instance sharing * Bump concurrency and install chromedriver smoother * Fix config typo * Fix local test * Limit azure concurrency again * Add delay for empty-object-test * Make sure to use open port for chromedriver * Move browser clo...
test/integration/empty-object-getInitialProps/test/index.test.js
@@ -49,6 +49,7 @@ describe('Empty Project', () => { it('should show empty object warning during client transition', async () => { const browser = await webdriver(appPort, '/static') + await waitFor(1000) await browser.eval(`(function() { window.gotWarn = false const origWarn = console.wa...
true
Other
vercel
next.js
b058427b7634e2edf0a45504a625f4d7a1d2a28c.json
Update CI/test set up (#9499) * Disable concurrency for tests * Add browser instance sharing * Bump concurrency and install chromedriver smoother * Fix config typo * Fix local test * Limit azure concurrency again * Add delay for empty-object-test * Make sure to use open port for chromedriver * Move browser clo...
test/integration/future/test/index.test.js
@@ -36,7 +36,9 @@ describe('future.excludeDefaultMomentLocales', () => { const browser = await webdriver(appPort, '/') await waitFor(5000) expect(await browser.elementByCss('h1').text()).toMatch(/current time/i) - expect(await browser.eval('moment.locales()')).toStrictEqual(['en']) + const locales ...
true
Other
vercel
next.js
b058427b7634e2edf0a45504a625f4d7a1d2a28c.json
Update CI/test set up (#9499) * Disable concurrency for tests * Add browser instance sharing * Bump concurrency and install chromedriver smoother * Fix config typo * Fix local test * Limit azure concurrency again * Add delay for empty-object-test * Make sure to use open port for chromedriver * Move browser clo...
test/jest-environment.js
@@ -4,6 +4,8 @@ const os = require('os') const http = require('http') const fetch = require('node-fetch') const getPort = require('get-port') +const waitPort = require('wait-port') +const chromedriver = require('chromedriver') const NodeEnvironment = require('jest-environment-node') const { BROWSER_NAME, @@ -16...
true
Other
vercel
next.js
b058427b7634e2edf0a45504a625f4d7a1d2a28c.json
Update CI/test set up (#9499) * Disable concurrency for tests * Add browser instance sharing * Bump concurrency and install chromedriver smoother * Fix config typo * Fix local test * Limit azure concurrency again * Add delay for empty-object-test * Make sure to use open port for chromedriver * Move browser clo...
test/jest-global-setup.js
@@ -1,4 +1,4 @@ -let globalSetup +let globalSetup = () => {} if (process.env.BROWSERSTACK) { const { Local } = require('browserstack-local') @@ -18,19 +18,6 @@ if (process.env.BROWSERSTACK) { }) }) } -} else { - const chromedriver = require('chromedriver') - const waitPort = require('wait-port') ...
true
Other
vercel
next.js
b058427b7634e2edf0a45504a625f4d7a1d2a28c.json
Update CI/test set up (#9499) * Disable concurrency for tests * Add browser instance sharing * Bump concurrency and install chromedriver smoother * Fix config typo * Fix local test * Limit azure concurrency again * Add delay for empty-object-test * Make sure to use open port for chromedriver * Move browser clo...
test/jest-global-teardown.js
@@ -1,24 +1,9 @@ let globalTeardown = () => {} -const browser = global.bsBrowser if (process.env.BROWSERSTACK) { globalTeardown = () => global.browserStackLocal.killAllProcesses(() => {}) } module.exports = async () => { - if (browser) { - // Close all remaining browser windows - try { - const wi...
true
Other
vercel
next.js
b058427b7634e2edf0a45504a625f4d7a1d2a28c.json
Update CI/test set up (#9499) * Disable concurrency for tests * Add browser instance sharing * Bump concurrency and install chromedriver smoother * Fix config typo * Fix local test * Limit azure concurrency again * Add delay for empty-object-test * Make sure to use open port for chromedriver * Move browser clo...
test/lib/next-webdriver.js
@@ -1,97 +1 @@ -import wd from 'wd' -import getPort from 'get-port' -import waitPort from 'wait-port' - -const doHeadless = process.env.HEADLESS !== 'false' -let driverPort = 9515 - -let webdriver = async function(appPort, pathname) { - if (typeof appPort === 'undefined') { - throw new Error('appPort is undefined')...
true
Other
vercel
next.js
b80d4d6893235d3919ef6dfa00b4b9b786357395.json
Drop Re-Exported iSSG Imports (#9512) * Drop Re-Exported iSSG Imports This pull request adds loader support for the following export form: ```js export { getStaticParams as unstable_getStaticParams } from '../../lib/docs/page'; export { getStaticProps as unstable_getStaticProps } from '../../lib/docs/page'; ``` This ...
packages/next/build/babel/plugins/next-page-config.ts
@@ -56,9 +56,43 @@ export default function nextPageConfig({ path: NodePath<BabelTypes.ExportNamedDeclaration>, state: any ) { - if (state.bundleDropped || !path.node.declaration) { + if ( + state.bundleDropped || + ...
true
Other
vercel
next.js
b80d4d6893235d3919ef6dfa00b4b9b786357395.json
Drop Re-Exported iSSG Imports (#9512) * Drop Re-Exported iSSG Imports This pull request adds loader support for the following export form: ```js export { getStaticParams as unstable_getStaticParams } from '../../lib/docs/page'; export { getStaticProps as unstable_getStaticProps } from '../../lib/docs/page'; ``` This ...
test/unit/babel-plugin-next-page-config.test.js
@@ -0,0 +1,111 @@ +/* eslint-env jest */ +import { transform } from '@babel/core' + +const trim = s => + s + .join('\n') + .trim() + .replace(/^\s+/gm, '') + +// avoid generating __source annotations in JSX during testing: +const NODE_ENV = process.env.NODE_ENV +process.env.NODE_ENV = 'production' +const plug...
true
Other
vercel
next.js
ff2d28c4ff0a2cc1ce408817f2714eebf1cf72c2.json
Add err.sh for invalid multi-match usage (#9498) * Adds err.sh for multi-match error * Fix missing apostrophe * Update regex to catch other param names * Add test for multi-match error * Update test/integration/invalid-multi-match/test/index.test.js
errors/invalid-multi-match.md
@@ -0,0 +1,27 @@ +# Invalid Multi-match + +#### Why This Error Occurred + +In one of your custom-routes you specified a multi-match `/:path*` and used it in your `destination` without adding the `*` in your `destination` e.g. `destination: '/another/:path'` + +#### Possible Ways to Fix It + +Add `*` to your usage of th...
true
Other
vercel
next.js
ff2d28c4ff0a2cc1ce408817f2714eebf1cf72c2.json
Add err.sh for invalid multi-match usage (#9498) * Adds err.sh for multi-match error * Fix missing apostrophe * Update regex to catch other param names * Add test for multi-match error * Update test/integration/invalid-multi-match/test/index.test.js
packages/next/next-server/server/next-server.ts
@@ -412,7 +412,20 @@ export default class Server { name: `${route.type} ${route.source} route`, fn: async (_req, res, params, _parsedUrl) => { let destinationCompiler = pathToRegexp.compile(route.destination) - let newUrl = destinationCompiler(params) + ...
true
Other
vercel
next.js
ff2d28c4ff0a2cc1ce408817f2714eebf1cf72c2.json
Add err.sh for invalid multi-match usage (#9498) * Adds err.sh for multi-match error * Fix missing apostrophe * Update regex to catch other param names * Add test for multi-match error * Update test/integration/invalid-multi-match/test/index.test.js
test/integration/invalid-multi-match/next.config.js
@@ -0,0 +1,12 @@ +module.exports = { + experimental: { + rewrites() { + return [ + { + source: '/:hello*', + destination: '/:hello', + }, + ] + }, + }, +}
true
Other
vercel
next.js
ff2d28c4ff0a2cc1ce408817f2714eebf1cf72c2.json
Add err.sh for invalid multi-match usage (#9498) * Adds err.sh for multi-match error * Fix missing apostrophe * Update regex to catch other param names * Add test for multi-match error * Update test/integration/invalid-multi-match/test/index.test.js
test/integration/invalid-multi-match/pages/hello.js
@@ -0,0 +1,15 @@ +import { useRouter } from 'next/router' + +console.log('hello from hello.js') + +const Page = () => { + const { query } = useRouter() + return ( + <> + <h3>hello world</h3> + <span>{JSON.stringify(query)}</span> + </> + ) +} + +export default Page
true
Other
vercel
next.js
ff2d28c4ff0a2cc1ce408817f2714eebf1cf72c2.json
Add err.sh for invalid multi-match usage (#9498) * Adds err.sh for multi-match error * Fix missing apostrophe * Update regex to catch other param names * Add test for multi-match error * Update test/integration/invalid-multi-match/test/index.test.js
test/integration/invalid-multi-match/test/index.test.js
@@ -0,0 +1,57 @@ +/* eslint-env jest */ +/* global jasmine */ +import { join } from 'path' +import { + launchApp, + killApp, + findPort, + nextBuild, + nextStart, + renderViaHTTP, +} from 'next-test-utils' + +jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 2 + +let appDir = join(__dirname, '..') +let stderr = '' +...
true
Other
vercel
next.js
61f4e7013563d202a97e64079ad1b1e5fb089538.json
Upgrade Babel Dependencies (#9478) * Upgrade Babel Dependencies * Update test for new size
package.json
@@ -29,9 +29,9 @@ }, "pre-commit": "lint-staged", "devDependencies": { - "@babel/plugin-proposal-object-rest-spread": "7.4.4", + "@babel/plugin-proposal-object-rest-spread": "7.6.2", "@babel/preset-flow": "7.0.0", - "@babel/preset-react": "7.0.0", + "@babel/preset-react": "7.7.0", "@mdx-j...
true
Other
vercel
next.js
61f4e7013563d202a97e64079ad1b1e5fb089538.json
Upgrade Babel Dependencies (#9478) * Upgrade Babel Dependencies * Update test for new size
packages/next/build/babel/plugins/amp-attributes.ts
@@ -1,5 +1,4 @@ -import { PluginObj } from '@babel/core' -import { NodePath } from '@babel/traverse' +import { NodePath, PluginObj } from '@babel/core' import { JSXOpeningElement } from '@babel/types' export default function AmpAttributePatcher(...args: any): PluginObj {
true
Other
vercel
next.js
61f4e7013563d202a97e64079ad1b1e5fb089538.json
Upgrade Babel Dependencies (#9478) * Upgrade Babel Dependencies * Update test for new size
packages/next/build/babel/plugins/commonjs.ts
@@ -1,7 +1,7 @@ -import { PluginObj } from '@babel/core' -import { NodePath } from '@babel/traverse' -import { Program } from '@babel/types' +import { NodePath, PluginObj } from '@babel/core' import commonjsPlugin from '@babel/plugin-transform-modules-commonjs' +import { Program } from '@babel/types' + // Rewrite imp...
true
Other
vercel
next.js
61f4e7013563d202a97e64079ad1b1e5fb089538.json
Upgrade Babel Dependencies (#9478) * Upgrade Babel Dependencies * Update test for new size
packages/next/build/babel/plugins/jsx-pragma.ts
@@ -1,5 +1,4 @@ -import { PluginObj } from '@babel/core' -import { NodePath } from '@babel/traverse' +import { NodePath, PluginObj } from '@babel/core' import * as BabelTypes from '@babel/types' export default function({
true
Other
vercel
next.js
61f4e7013563d202a97e64079ad1b1e5fb089538.json
Upgrade Babel Dependencies (#9478) * Upgrade Babel Dependencies * Update test for new size
packages/next/build/babel/plugins/next-data.ts
@@ -1,5 +1,4 @@ -import { PluginObj } from '@babel/core' -import { NodePath } from '@babel/traverse' +import { NodePath, PluginObj } from '@babel/core' import * as BabelTypes from '@babel/types' export default function({
true
Other
vercel
next.js
61f4e7013563d202a97e64079ad1b1e5fb089538.json
Upgrade Babel Dependencies (#9478) * Upgrade Babel Dependencies * Update test for new size
packages/next/build/babel/plugins/next-page-config.ts
@@ -1,6 +1,6 @@ -import { PluginObj } from '@babel/core' -import { NodePath } from '@babel/traverse' +import { NodePath, PluginObj } from '@babel/core' import * as BabelTypes from '@babel/types' + import { PageConfig } from '../../../types' export const dropBundleIdentifier = '__NEXT_DROP_CLIENT_FILE__'
true
Other
vercel
next.js
61f4e7013563d202a97e64079ad1b1e5fb089538.json
Upgrade Babel Dependencies (#9478) * Upgrade Babel Dependencies * Update test for new size
packages/next/build/babel/plugins/optimize-hook-destructuring.ts
@@ -1,5 +1,4 @@ -import { PluginObj } from '@babel/core' -import { NodePath } from '@babel/traverse' +import { NodePath, PluginObj } from '@babel/core' import * as BabelTypes from '@babel/types' // matches any hook-like (the default)
true
Other
vercel
next.js
61f4e7013563d202a97e64079ad1b1e5fb089538.json
Upgrade Babel Dependencies (#9478) * Upgrade Babel Dependencies * Update test for new size
packages/next/build/babel/plugins/react-loadable-plugin.ts
@@ -23,8 +23,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWAR // Modified to put `webpack` and `modules` under `loadableGenerated` to be backwards compatible with next/dynamic which has a `modules` key // Modified to support `dynamic(import('something'))` and `dynamic(import('something'), options) ...
true
Other
vercel
next.js
61f4e7013563d202a97e64079ad1b1e5fb089538.json
Upgrade Babel Dependencies (#9478) * Upgrade Babel Dependencies * Update test for new size
packages/next/package.json
@@ -58,25 +58,25 @@ }, "dependencies": { "@ampproject/toolbox-optimizer": "1.1.1", - "@babel/core": "7.6.4", - "@babel/plugin-proposal-class-properties": "7.5.5", + "@babel/core": "7.7.2", + "@babel/plugin-proposal-class-properties": "7.7.0", "@babel/plugin-proposal-object-rest-spread": "7.6...
true
Other
vercel
next.js
61f4e7013563d202a97e64079ad1b1e5fb089538.json
Upgrade Babel Dependencies (#9478) * Upgrade Babel Dependencies * Update test for new size
test/integration/size-limit/test/index.test.js
@@ -99,6 +99,6 @@ describe('Production response size', () => { ) // These numbers are without gzip compression! - expect(responseSizeKilobytes).toBeLessThanOrEqual(200) // Kilobytes + expect(responseSizeKilobytes).toBeLessThanOrEqual(204) // Kilobytes }) })
true
Other
vercel
next.js
61f4e7013563d202a97e64079ad1b1e5fb089538.json
Upgrade Babel Dependencies (#9478) * Upgrade Babel Dependencies * Update test for new size
yarn.lock
@@ -47,19 +47,19 @@ dependencies: "@babel/highlight" "^7.0.0" -"@babel/core@7.6.4": - version "7.6.4" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.6.4.tgz#6ebd9fe00925f6c3e177bb726a188b5f578088ff" - integrity sha512-Rm0HGw101GY8FTzpWSyRbki/jzq+/PkNQJ+nSulrdY6gFGOsNseCqD6KHRYe2E+EdzuBdr2pxC...
true
Other
vercel
next.js
625190d06df36f5c40d2a3d682238c5b32ac53f5.json
Update purgecss search path (#9432) * Update purgecss search string to include typescript files - closes #9415 * fix minor formatting issue
examples/with-tailwindcss/postcss.config.js
@@ -3,7 +3,10 @@ module.exports = { require('postcss-easy-import'), require('tailwindcss'), require('@fullhuman/postcss-purgecss')({ - content: ['./pages/**/*.js', './components/**/*.js'], + content: [ + './pages/**/*.{js,jsx,ts,tsx}', + './components/**/*.{js,jsx,ts,tsx}', + ...
false
Other
vercel
next.js
792f2f8ce3486ade7992479f1baa76991dcf739e.json
Add test for forward nav after reload (#9452)
test/integration/client-navigation/test/index.test.js
@@ -78,14 +78,29 @@ describe('Client Navigation', () => { const browser = await webdriver(context.appPort, '/nav') await browser.elementByCss('#about-link').click() await browser.waitForElementByCss('.nav-about') - await browser.eval(`window.location.href = window.location.href`) - await ...
false
Other
vercel
next.js
57fa38a39de1324bb40ee9c8a62e674ef55b0a9a.json
Remove re-exports of default when they don't exist (#9450)
packages/next/amp.d.ts
@@ -1,2 +1 @@ export * from './dist/next-server/lib/amp' -export { default } from './dist/next-server/lib/amp'
true
Other
vercel
next.js
57fa38a39de1324bb40ee9c8a62e674ef55b0a9a.json
Remove re-exports of default when they don't exist (#9450)
packages/next/babel.d.ts
@@ -1,2 +1 @@ export * from './dist/build/babel/preset' -export { default } from './dist/build/babel/preset'
true
Other
vercel
next.js
57fa38a39de1324bb40ee9c8a62e674ef55b0a9a.json
Remove re-exports of default when they don't exist (#9450)
packages/next/data.d.ts
@@ -1,2 +1 @@ export * from './dist/lib/data' -export { default } from './dist/lib/data'
true
Other
vercel
next.js
09cab2df5e854951aaeae46a7de65f9bd7457f6d.json
Fix typo in serverless loader (#9431) * Fix typo in serverless loader * Add test for top level error in API route * Fix type error
packages/next/build/webpack/loaders/next-serverless-loader.ts
@@ -68,10 +68,10 @@ const nextServerlessLoader: loader.Loader = function() { : `{}` } const resolver = require('${absolutePagePath}') - apiResolver(req, res, params, resolver) - } catch (error) { - await onError(err) + apiResolver(req, res, params, ...
true
Other
vercel
next.js
09cab2df5e854951aaeae46a7de65f9bd7457f6d.json
Fix typo in serverless loader (#9431) * Fix typo in serverless loader * Add test for top level error in API route * Fix type error
packages/next/next-server/server/api-utils.ts
@@ -14,7 +14,8 @@ export async function apiResolver( req: NextApiRequest, res: NextApiResponse, params: any, - resolverModule: any + resolverModule: any, + onError?: ({ err }: { err: any }) => Promise<void> ) { try { let config: PageConfig = {} @@ -51,11 +52,12 @@ export async function apiResolver(...
true
Other
vercel
next.js
09cab2df5e854951aaeae46a7de65f9bd7457f6d.json
Fix typo in serverless loader (#9431) * Fix typo in serverless loader * Add test for top level error in API route * Fix type error
packages/next/next-server/server/next-server.ts
@@ -100,7 +100,7 @@ export default class Server { dev?: boolean } private compression?: Middleware - private onErrorMiddleware?: ({ err }: { err: Error }) => void + private onErrorMiddleware?: ({ err }: { err: Error }) => Promise<void> router: Router protected dynamicRoutes?: Array<{ page: string; ma...
true
Other
vercel
next.js
09cab2df5e854951aaeae46a7de65f9bd7457f6d.json
Fix typo in serverless loader (#9431) * Fix typo in serverless loader * Add test for top level error in API route * Fix type error
test/integration/serverless/pages/api/top-level-error.js
@@ -0,0 +1,6 @@ +throw new Error('top-level-oops') + +// eslint-disable-next-line +export default (req, res) => { + res.end('hi') +}
true
Other
vercel
next.js
09cab2df5e854951aaeae46a7de65f9bd7457f6d.json
Fix typo in serverless loader (#9431) * Fix typo in serverless loader * Add test for top level error in API route * Fix type error
test/integration/serverless/test/index.test.js
@@ -6,6 +6,7 @@ import cheerio from 'cheerio' import { existsSync, readdirSync, readFileSync } from 'fs' import { killApp, + waitFor, findPort, nextBuild, nextStart, @@ -20,6 +21,7 @@ const appDir = join(__dirname, '../') const serverlessDir = join(appDir, '.next/serverless/pages') const chunksDir = jo...
true
Other
vercel
next.js
8e2097997e75d8867a9111c861b624e35e14f811.json
Remove getInitialProps from the faunadb example (#9427) * Remove the global fetch * Update API methods * Remove getInitialProps from the page * Add client side fetching
examples/with-graphql-faunadb/components/Hero.js
@@ -1,10 +1,11 @@ -import React, { useState } from 'react' -import { createGuestbookEntry } from '../graphql/api' +import { useState, useEffect } from 'react' +import { useGuestbookEntries, createGuestbookEntry } from '../graphql/api' import Header from './Header' import GuestbookEntry from './GuestbookEntry' import...
true
Other
vercel
next.js
8e2097997e75d8867a9111c861b624e35e14f811.json
Remove getInitialProps from the faunadb example (#9427) * Remove the global fetch * Update API methods * Remove getInitialProps from the page * Add client side fetching
examples/with-graphql-faunadb/fetch/browser.js
@@ -1,3 +0,0 @@ -import fetch from 'unfetch' - -export default fetch
true
Other
vercel
next.js
8e2097997e75d8867a9111c861b624e35e14f811.json
Remove getInitialProps from the faunadb example (#9427) * Remove the global fetch * Update API methods * Remove getInitialProps from the page * Add client side fetching
examples/with-graphql-faunadb/fetch/package.json
@@ -1,4 +0,0 @@ -{ - "browser": "./browser.js", - "main": "./server.js" -}
true
Other
vercel
next.js
8e2097997e75d8867a9111c861b624e35e14f811.json
Remove getInitialProps from the faunadb example (#9427) * Remove the global fetch * Update API methods * Remove getInitialProps from the page * Add client side fetching
examples/with-graphql-faunadb/fetch/server.js
@@ -1,3 +0,0 @@ -import fetch from 'node-fetch' - -export default fetch
true
Other
vercel
next.js
8e2097997e75d8867a9111c861b624e35e14f811.json
Remove getInitialProps from the faunadb example (#9427) * Remove the global fetch * Update API methods * Remove getInitialProps from the page * Add client side fetching
examples/with-graphql-faunadb/graphql/api.js
@@ -1,4 +1,17 @@ -import fetch from '../fetch' +import useFetch from '../lib/useFetch' + +function getData(data) { + if (!data || data.errors) return null + return data.data +} + +function getErrorMessage(error, data) { + if (error) return error.message + if (data && data.errors) { + return data.errors[0].messag...
true