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 | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/components/hmr/dynamic.js | @@ -0,0 +1,12 @@
+export default () => {
+ return (
+ <div id="dynamic-component">
+ Dynamic Component
+ <style jsx>{`
+ div {
+ font-size: 100px;
+ }
+ `}</style>
+ </div>
+ )
+} | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/components/nested1.js | @@ -0,0 +1,10 @@
+import dynamic from 'next/dynamic'
+
+const Nested2 = dynamic(() => import('./nested2'))
+
+export default () => (
+ <div>
+ Nested 1
+ <Nested2 />
+ </div>
+) | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/components/nested2.js | @@ -0,0 +1,12 @@
+import dynamic from 'next/dynamic'
+
+const BrowserLoaded = dynamic(async () => () => <div>Browser hydrated</div>, {
+ ssr: false,
+})
+
+export default () => (
+ <div>
+ <div>Nested 2</div>
+ <BrowserLoaded />
+ </div>
+) | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/components/welcome.js | @@ -0,0 +1,17 @@
+import React from 'react'
+
+export default class Welcome extends React.Component {
+ state = { name: null }
+
+ componentDidMount() {
+ const { name } = this.props
+ this.setState({ name })
+ }
+
+ render() {
+ const { name } = this.state
+ if (!name) return null
+
+ return <p>Welc... | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/next.config.js | @@ -0,0 +1,9 @@
+module.exports = {
+ onDemandEntries: {
+ // Make sure entries are not getting disposed.
+ maxInactiveAge: 1000 * 60 * 60,
+ },
+ experimental: {
+ basePath: '/docs',
+ },
+} | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/pages/hello.js | @@ -0,0 +1,9 @@
+import Link from 'next/link'
+
+export default () => (
+ <Link href="/other-page">
+ <a id="other-page-link">
+ <h1>Hello World</h1>
+ </a>
+ </Link>
+) | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/pages/hmr/about.js | @@ -0,0 +1,7 @@
+export default () => {
+ return (
+ <div className="hmr-about-page">
+ <p>This is the about page.</p>
+ </div>
+ )
+} | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/pages/hmr/about1.js | @@ -0,0 +1,7 @@
+export default () => {
+ return (
+ <div className="hmr-about-page">
+ <p>This is the about page.</p>
+ </div>
+ )
+} | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/pages/hmr/about2.js | @@ -0,0 +1,7 @@
+export default () => {
+ return (
+ <div className="hmr-about-page">
+ <p>This is the about page.</p>
+ </div>
+ )
+} | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/pages/hmr/about3.js | @@ -0,0 +1,7 @@
+export default () => {
+ return (
+ <div className="hmr-about-page">
+ <p>This is the about page.</p>
+ </div>
+ )
+} | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/pages/hmr/about4.js | @@ -0,0 +1,7 @@
+export default () => {
+ return (
+ <div className="hmr-about-page">
+ <p>This is the about page.</p>
+ </div>
+ )
+} | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/pages/hmr/about5.js | @@ -0,0 +1,7 @@
+export default () => {
+ return (
+ <div className="hmr-about-page">
+ <p>This is the about page.</p>
+ </div>
+ )
+} | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/pages/hmr/about6.js | @@ -0,0 +1,7 @@
+export default () => {
+ return (
+ <div className="hmr-about-page">
+ <p>This is the about page.</p>
+ </div>
+ )
+} | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/pages/hmr/about7.js | @@ -0,0 +1,7 @@
+export default () => {
+ return (
+ <div className="hmr-about-page">
+ <p>This is the about page.</p>
+ </div>
+ )
+} | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/pages/hmr/contact.js | @@ -0,0 +1,5 @@
+export default () => (
+ <div className="hmr-contact-page">
+ <p>This is the contact page.</p>
+ </div>
+) | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/pages/hmr/counter.js | @@ -0,0 +1,19 @@
+import React from 'react'
+
+export default class Counter extends React.Component {
+ state = { count: 0 }
+
+ incr() {
+ const { count } = this.state
+ this.setState({ count: count + 1 })
+ }
+
+ render() {
+ return (
+ <div>
+ <p>COUNT: {this.state.count}</p>
+ <butto... | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/pages/hmr/error-in-gip.js | @@ -0,0 +1,11 @@
+import React from 'react'
+export default class extends React.Component {
+ static getInitialProps() {
+ const error = new Error('an-expected-error-in-gip')
+ throw error
+ }
+
+ render() {
+ return <div>Hello</div>
+ }
+} | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/pages/hmr/index.js | @@ -0,0 +1,9 @@
+import Link from 'next/link'
+
+export default () => (
+ <div>
+ <Link href="/hmr/error-in-gip">
+ <a id="error-in-gip-link">Bad Page</a>
+ </Link>
+ </div>
+) | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/pages/hmr/style-dynamic-component.js | @@ -0,0 +1,8 @@
+import React from 'react'
+import dynamic from 'next/dynamic'
+
+const HmrDynamic = dynamic(import('../../components/hmr/dynamic'))
+
+export default () => {
+ return <HmrDynamic />
+} | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/pages/hmr/style-stateful-component.js | @@ -0,0 +1,20 @@
+import React, { Component } from 'react'
+
+export default class StyleStateFul extends Component {
+ render() {
+ return (
+ <React.Fragment>
+ <div className="hmr-style-page">
+ <p>
+ This is the style page.
+ <style jsx>{`
+ p {
+ ... | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/pages/hmr/style.js | @@ -0,0 +1,17 @@
+import React from 'react'
+export default () => {
+ return (
+ <React.Fragment>
+ <div className="hmr-style-page">
+ <p>
+ This is the style page.
+ <style jsx>{`
+ p {
+ font-size: 100px;
+ }
+ `}</style>
+ </p>
+ ... | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/pages/other-page.js | @@ -0,0 +1 @@
+export default () => <h1 id="other-page-title">Hello Other</h1> | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/pages/ssr.js | @@ -0,0 +1,11 @@
+function SSRPage({ test }) {
+ return <h1>{test}</h1>
+}
+
+SSRPage.getInitialProps = () => {
+ return {
+ test: 'hello',
+ }
+}
+
+export default SSRPage | true |
Other | vercel | next.js | 86808bbce295e46b1ff36100de8215fcaac01a00.json | Add basePath support (#9872)
* Add basePath support
* Add tests including copy of HMR tests
* Add production tests
* Add tests for serverless target
* Add missing quotes | test/integration/basepath/test/index.test.js | @@ -0,0 +1,497 @@
+/* eslint-env jest */
+/* global jasmine */
+import webdriver from 'next-webdriver'
+import { join } from 'path'
+import {
+ nextServer,
+ launchApp,
+ findPort,
+ killApp,
+ nextBuild,
+ startApp,
+ stopApp,
+ waitFor,
+ check,
+ getBrowserBodyText,
+ renderViaHTTP,
+ File,
+ nextStart,... | true |
Other | vercel | next.js | 356e5caf0ee4d23498a3caab3d71eb2bbbf84e7a.json | Fix bug in data-fetching.md's example (#9868)
Add missing `await` keyword in the Static Generation example | docs/basic-features/data-fetching.md | @@ -34,7 +34,7 @@ import useSWR from 'swr'
const API_URL = 'https://api.github.com'
async function fetcher(path) {
- const res = fetch(API_URL + path)
+ const res = await fetch(API_URL + path)
const json = await res.json()
return json
} | false |
Other | vercel | next.js | be3b5b7c5fd442cfa29794fc9dc1251221981120.json | Register Created Bindings (#9864) | packages/next/build/babel/plugins/jsx-pragma.ts | @@ -51,17 +51,24 @@ export default function({
// if the React binding came from a require('react'),
// make sure that our usage comes after it.
+ let newPath
if (
existingBinding &&
t.isVariableDeclarator(existingBinding.path.... | false |
Other | vercel | next.js | edf63e597d17f1846d9b3ab06094009e04ad90de.json | Expose CSS Issuer When Error (#9850)
* Expose CSS Issuer When Error
This introduces a friendlier error for invalid CSS imports by telling you the offending file.
---
Fixes #9847
* fix test matches | packages/next/build/webpack/loaders/error-loader.ts | @@ -1,12 +1,29 @@
+import chalk from 'chalk'
import loaderUtils from 'loader-utils'
+import path from 'path'
import { loader } from 'webpack'
const ErrorLoader: loader.Loader = function() {
const options = loaderUtils.getOptions(this) || {}
const { reason = 'An unknown error has occurred' } = options
- ... | true |
Other | vercel | next.js | edf63e597d17f1846d9b3ab06094009e04ad90de.json | Expose CSS Issuer When Error (#9850)
* Expose CSS Issuer When Error
This introduces a friendlier error for invalid CSS imports by telling you the offending file.
---
Fixes #9847
* fix test matches | packages/next/taskfile.js | @@ -51,6 +51,7 @@ const babelServerOpts = {
],
plugins: [
'@babel/plugin-proposal-optional-chaining',
+ '@babel/plugin-proposal-nullish-coalescing-operator',
'babel-plugin-dynamic-import-node',
['@babel/plugin-proposal-class-properties', { loose: true }],
], | true |
Other | vercel | next.js | edf63e597d17f1846d9b3ab06094009e04ad90de.json | Expose CSS Issuer When Error (#9850)
* Expose CSS Issuer When Error
This introduces a friendlier error for invalid CSS imports by telling you the offending file.
---
Fixes #9847
* fix test matches | test/integration/css-modules/test/index.test.js | @@ -178,6 +178,7 @@ describe('Invalid CSS Module Usage in node_modules', () => {
expect(stderr).toMatch(
/CSS Modules.*cannot.*be imported from within.*node_modules/
)
+ expect(stderr).toMatch(/Location:.*node_modules[\\/]example[\\/]index\.mjs/)
})
})
@@ -197,6 +198,7 @@ describe('Invalid CSS... | true |
Other | vercel | next.js | edf63e597d17f1846d9b3ab06094009e04ad90de.json | Expose CSS Issuer When Error (#9850)
* Expose CSS Issuer When Error
This introduces a friendlier error for invalid CSS imports by telling you the offending file.
---
Fixes #9847
* fix test matches | test/integration/css/test/index.test.js | @@ -221,6 +221,7 @@ describe('CSS Support', () => {
expect(stderr).toMatch(
/Please move all global CSS imports.*?pages(\/|\\)_app/
)
+ expect(stderr).toMatch(/Location:.*pages[\\/]index\.js/)
})
})
@@ -240,6 +241,7 @@ describe('CSS Support', () => {
expect(stderr).toMatch(
... | true |
Other | vercel | next.js | 6b50b1322b0ea4a5fc6bf91caed5169dd211fafc.json | Allow Boolean API Response (#9842) | packages/next/next-server/server/api-utils.ts | @@ -204,7 +204,11 @@ export function sendData(res: NextApiResponse, body: any) {
let str = body
// Stringify JSON body
- if (typeof body === 'object' || typeof body === 'number') {
+ if (
+ typeof body === 'object' ||
+ typeof body === 'number' ||
+ typeof body === 'boolean'
+ ) {
str = JSON.st... | true |
Other | vercel | next.js | 6b50b1322b0ea4a5fc6bf91caed5169dd211fafc.json | Allow Boolean API Response (#9842) | test/integration/api-support/pages/api/bool.js | @@ -0,0 +1,3 @@
+export default (req, res) => {
+ res.json(true)
+} | true |
Other | vercel | next.js | 6b50b1322b0ea4a5fc6bf91caed5169dd211fafc.json | Allow Boolean API Response (#9842) | test/integration/api-support/test/index.test.js | @@ -86,6 +86,16 @@ function runTests(dev = false) {
expect(data).toEqual({})
})
+ it('should support boolean for JSON in api page', async () => {
+ const res = await fetchViaHTTP(appPort, '/api/bool', null, {})
+ const body = res.ok ? await res.json() : null
+ expect(res.status).toBe(200)
+ expec... | true |
Other | vercel | next.js | ec440d4b7b203f72f44df2933bdb91a329128d0d.json | Allow Empty API Body (#9838) | packages/next/next-server/server/api-utils.ts | @@ -104,6 +104,11 @@ export async function parseBody(req: NextApiRequest, limit: string | number) {
* @param str `JSON` string
*/
function parseJson(str: string) {
+ if (str.length === 0) {
+ // special-case empty json body, as it's a common client-side mistake
+ return {}
+ }
+
try {
return JSON.p... | true |
Other | vercel | next.js | ec440d4b7b203f72f44df2933bdb91a329128d0d.json | Allow Empty API Body (#9838) | test/integration/api-support/test/index.test.js | @@ -75,6 +75,17 @@ function runTests(dev = false) {
expect(data).toEqual([{ title: 'Nextjs' }])
})
+ it('should special-case empty JSON body', async () => {
+ const data = await fetchViaHTTP(appPort, '/api/parse', null, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json;... | true |
Other | vercel | next.js | 69a34dd7787dc44bd4731c9f9816ee428dbaccd3.json | Fix IE11 Prefetching (#9823) | packages/next/client/page-loader.js | @@ -1,19 +1,20 @@
import mitt from '../next-server/lib/mitt'
-function hasPrefetch(link) {
+function hasRel(rel, link) {
try {
link = document.createElement('link')
- return link.relList.supports('prefetch')
+ return link.relList.supports(rel)
} catch {}
}
-const relPrefetch = hasPrefetch()
- ? ... | false |
Other | vercel | next.js | 5c3f9ba7457da84b6d601f1fc4c119953cd16d3e.json | Add Specific Error for Function in PostCSS Config (#9815) | packages/next/build/webpack/config/blocks/css/plugins.ts | @@ -99,6 +99,12 @@ export async function getPostCssPlugins(
config = { plugins: getDefaultPlugins() }
}
+ if (typeof config === 'function') {
+ throw new Error(
+ `Your custom PostCSS configuration may not export a function. Please export a plain object instead.`
+ )
+ }
+
// Warn user about c... | true |
Other | vercel | next.js | 5c3f9ba7457da84b6d601f1fc4c119953cd16d3e.json | Add Specific Error for Function in PostCSS Config (#9815) | test/integration/css-customization/test/index.test.js | @@ -305,3 +305,20 @@ describe('Bad CSS Customization Array (7)', () => {
expect(stderr).toMatch(/Build error occurred/)
})
})
+
+describe('Bad CSS Customization Function', () => {
+ const appDir = join(fixturesDir, 'bad-custom-configuration-func')
+
+ beforeAll(async () => {
+ await remove(join(appDir, '.... | true |
Other | vercel | next.js | 5c3f9ba7457da84b6d601f1fc4c119953cd16d3e.json | Add Specific Error for Function in PostCSS Config (#9815) | test/integration/css-fixtures/bad-custom-configuration-func/pages/_app.js | @@ -0,0 +1,12 @@
+import React from 'react'
+import App from 'next/app'
+import '../styles/global.css'
+
+class MyApp extends App {
+ render() {
+ const { Component, pageProps } = this.props
+ return <Component {...pageProps} />
+ }
+}
+
+export default MyApp | true |
Other | vercel | next.js | 5c3f9ba7457da84b6d601f1fc4c119953cd16d3e.json | Add Specific Error for Function in PostCSS Config (#9815) | test/integration/css-fixtures/bad-custom-configuration-func/pages/index.js | @@ -0,0 +1,3 @@
+export default function Home() {
+ return <div />
+} | true |
Other | vercel | next.js | 5c3f9ba7457da84b6d601f1fc4c119953cd16d3e.json | Add Specific Error for Function in PostCSS Config (#9815) | test/integration/css-fixtures/bad-custom-configuration-func/postcss.config.js | @@ -0,0 +1,3 @@
+module.exports = function() {
+ return { plugins: [] }
+} | true |
Other | vercel | next.js | 5c3f9ba7457da84b6d601f1fc4c119953cd16d3e.json | Add Specific Error for Function in PostCSS Config (#9815) | test/integration/css-fixtures/bad-custom-configuration-func/styles/global.css | @@ -0,0 +1,4 @@
+/* this should be transformed to width/height */
+.video {
+ max-size: 400px 300px;
+} | true |
Other | vercel | next.js | b95228ed89fa163056945210f4ebd3554165f390.json | chore: fix typo of Unkown to Unknown (#9809) | examples/with-context-api/components/Counter.js | @@ -12,7 +12,7 @@ const reducer = (state, action) => {
case 'INCREASE_BY':
return state + action.payload
default:
- throw new Error(`Unkown action: ${action.type}`)
+ throw new Error(`Unknown action: ${action.type}`)
}
}
| false |
Other | vercel | next.js | fd1636ae4dc2183018c6464d092eba0ee7fd69f2.json | Update prerender test for Windows (#9800) | test/integration/prerender/pages/something.js | @@ -9,16 +9,18 @@ export async function unstable_getStaticProps({ params }) {
world: 'world',
params: params || {},
time: new Date().getTime(),
+ random: Math.random(),
},
revalidate: false,
}
}
-export default ({ world, time, params }) => {
+export default ({ world, time, para... | true |
Other | vercel | next.js | fd1636ae4dc2183018c6464d092eba0ee7fd69f2.json | Update prerender test for Windows (#9800) | test/integration/prerender/test/index.test.js | @@ -322,6 +322,17 @@ const runTests = (dev = false) => {
)
const escapedBuildId = buildId.replace(/[|\\{}()[\]^$+*?.-]/g, '\\$&')
+ Object.keys(manifest.dynamicRoutes).forEach(key => {
+ const item = manifest.dynamicRoutes[key]
+
+ if (item.dataRouteRegex) {
+ item.dataRouteR... | true |
Other | vercel | next.js | fd1636ae4dc2183018c6464d092eba0ee7fd69f2.json | Update prerender test for Windows (#9800) | test/lib/next-test-utils.js | @@ -401,5 +401,5 @@ export function getBrowserBodyText(browser) {
}
export function normalizeRegEx(src) {
- return new RegExp(src).source
+ return new RegExp(src).source.replace(/\^\//g, '^\\/')
} | true |
Other | vercel | next.js | 163f607160132dd1a4a535ae956bd1c21c2912f8.json | Add parsing of route source during checking (#9787)
* Add parsing of route during checking
* Update err.sh | errors/invalid-route-source.md | @@ -0,0 +1,32 @@
+# Invalid Custom Route `source`
+
+#### Why This Error Occurred
+
+When defining custom routes a route was added that causes an error during parsing. This can be due to trying to use normal `RegExp` syntax like negative lookaheads (`?!exclude`) without following `path-to-regexp`'s syntax for it.
+
+##... | true |
Other | vercel | next.js | 163f607160132dd1a4a535ae956bd1c21c2912f8.json | Add parsing of route source during checking (#9787)
* Add parsing of route during checking
* Update err.sh | packages/next/lib/check-custom-routes.ts | @@ -1,3 +1,5 @@
+import { match as regexpMatch } from 'path-to-regexp'
+
export type Rewrite = {
source: string
destination: string
@@ -56,6 +58,17 @@ export default function checkCustomRoutes(
}
}
+ try {
+ // Make sure we can parse the source properly
+ regexpMatch(route.source)
+ ... | true |
Other | vercel | next.js | 163f607160132dd1a4a535ae956bd1c21c2912f8.json | Add parsing of route source during checking (#9787)
* Add parsing of route during checking
* Update err.sh | test/integration/invalid-custom-routes/test/index.test.js | @@ -97,6 +97,10 @@ const invalidRewrites = [
source: '/hello',
destination: 'another',
},
+ {
+ source: '/feedback/(?!general)',
+ destination: '/feedback/general',
+ },
]
const invalidRewriteAssertions = (stderr = '') => {
@@ -120,6 +124,10 @@ const invalidRewriteAssertions = (stderr = '') => ... | true |
Other | vercel | next.js | a6e069d4f9601e1cbe6436080ecb2a1adcb33d16.json | Add property to list of deduped tags (#2439) | lib/head.js | @@ -42,7 +42,7 @@ function onStateChange (head) {
}
}
-const METATYPES = ['name', 'httpEquiv', 'charSet', 'itemProp']
+const METATYPES = ['name', 'httpEquiv', 'charSet', 'itemProp', 'property']
// returns a function for filtering head child elements
// which shouldn't be duplicated, like <title/>. | false |
Other | vercel | next.js | 36dc0574afda6f70fb38d7612a2485d5686705ac.json | Add issue template (#2443)
* Add issue template
* Add checkbox for duplicate issues | .github/issue_template.md | @@ -0,0 +1,35 @@
+<!--- Provide a general summary of the issue in the Title above -->
+
+<!--
+ Thank you very much for contributing to Next.js by creating an issue! ❤️
+ To avoid duplicate issues we ask you to check off the following list
+-->
+
+<!-- Checked checkbox should look like this: [x] -->
+- [ ] I have... | false |
Other | vercel | next.js | cb752e7ab9e981f4fad9eb04cc60335fa50d6642.json | chore(package): update babel-jest to version 20.0.3 (#2430)
Closes #1992 | package.json | @@ -108,7 +108,7 @@
"@taskr/esnext": "1.0.0",
"@taskr/watch": "1.0.6",
"babel-eslint": "7.2.3",
- "babel-jest": "20.0.2",
+ "babel-jest": "20.0.3",
"babel-plugin-istanbul": "4.1.3",
"babel-plugin-transform-remove-strict-mode": "0.0.2",
"babel-preset-es2015": "6.24.1", | false |
Other | vercel | next.js | a07c7c448b5278b080846961309a06290aeb7101.json | Prevent flooding when an error occurs (#2351) | client/next-dev.js | @@ -42,8 +42,10 @@ ReactReconciler.mountComponent = function (...args) {
try {
return originalMountComponent(...args)
} catch (err) {
- next.renderError(err)
- err.abort = true
+ if (!err.abort) {
+ next.renderError(err)
+ err.abort = true
+ }
throw err
}
} | false |
Other | vercel | next.js | 304225d9ea754323b19a17dc3d1e541e79f134e8.json | Optimize the bundle size of Next.js core (#2422)
* Try to the slim the webpack output.
* Remove react-hot-loader completely from production. | lib/app.js | @@ -1,12 +1,8 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
-import { AppContainer } from 'react-hot-loader'
import shallowEquals from './shallow-equals'
import { warn } from './utils'
-const ErrorDebug = process.env.NODE_ENV === 'production'
- ? null : require('./error-debug').d... | true |
Other | vercel | next.js | 304225d9ea754323b19a17dc3d1e541e79f134e8.json | Optimize the bundle size of Next.js core (#2422)
* Try to the slim the webpack output.
* Remove react-hot-loader completely from production. | server/build/webpack.js | @@ -107,7 +107,7 @@ export default async function createCompiler (dir, { dev = false, quiet = false,
// used in all of the pages. Otherwise, move modules used in at-least
// 1/2 of the total pages into commons.
if (totalPages <= 2) {
- return count === totalPages
+ return co... | true |
Other | vercel | next.js | 1ecba3b84d43d3c41f11cec5f03f10aea1d95ed2.json | Use right next.js version for with-dynamic-import (#2423) | examples/with-dynamic-import/package.json | @@ -10,7 +10,7 @@
},
"dependencies": {
"async-reactor": "^1.1.1",
- "next": "^3.0.0-beta13",
+ "next": "^3.0.1-beta.5",
"react": "^15.4.2",
"react-dom": "^15.4.2"
}, | false |
Other | vercel | next.js | 03cad7cba56a9bc924052492d4bbb68485f15a93.json | Fix some errors in README. | readme.md | @@ -236,8 +236,10 @@ For the initial page load, `getInitialProps` will execute on the server only. `g
_Note: `getInitialProps` can **not** be used in children components. Only in `pages`._
<br/>
+
> If you are using some server only modules inside `getInitialProps`, make sure to [import them properly](https://arun... | false |
Other | vercel | next.js | 5a650d74df7453b6f76256740058f2e517159037.json | Add a note about importing server only modules. | readme.md | @@ -235,6 +235,11 @@ For the initial page load, `getInitialProps` will execute on the server only. `g
_Note: `getInitialProps` can **not** be used in children components. Only in `pages`._
+<br/>
+> If you are using some server only modules inside `getInitialProps`, make sure to [import them properly](https://arun... | false |
Other | vercel | next.js | 247dd98cf377f4c663b137632244a974cdc7c500.json | Add a better filename to the dynamic import chunk. (#2397)
With this we can see the import name in the filename.
This helps a lot in debugging and analyzing the webpack
bundle. | server/build/babel/plugins/handle-import.js | @@ -45,8 +45,10 @@ export default () => ({
visitor: {
CallExpression (path) {
if (path.node.callee.type === TYPE_IMPORT) {
+ const moduleName = path.node.arguments[0].value
+ const name = `${moduleName.replace(/[^\w]/g, '-')}-${UUID.v4()}`
const newImport = buildImport({
- ... | false |
Other | vercel | next.js | c39e555353d68756da28c7cc305f632e59ac539c.json | Improve Fela example (#2330)
* Improve Fela example
- add webPreset
- cleaner code
- add key for style
- demonstrate Fela composition
* Fix standard lint | examples/with-fela/fela-renderer.js | @@ -0,0 +1,8 @@
+import { createRenderer } from 'fela'
+import webPreset from 'fela-preset-web'
+
+const felaRenderer = createRenderer({
+ plugins: [...webPreset]
+})
+
+export default felaRenderer | true |
Other | vercel | next.js | c39e555353d68756da28c7cc305f632e59ac539c.json | Improve Fela example (#2330)
* Improve Fela example
- add webPreset
- cleaner code
- add key for style
- demonstrate Fela composition
* Fix standard lint | examples/with-fela/fela.js | @@ -1,8 +0,0 @@
-import { createRenderer } from 'fela'
-
-// add your renderer configuration here
-const renderer = createRenderer()
-
-export default function getRenderer () {
- return renderer
-} | true |
Other | vercel | next.js | c39e555353d68756da28c7cc305f632e59ac539c.json | Improve Fela example (#2330)
* Improve Fela example
- add webPreset
- cleaner code
- add key for style
- demonstrate Fela composition
* Fix standard lint | examples/with-fela/layout.js | @@ -1,8 +1,7 @@
import { Provider } from 'react-fela'
-import getRenderer from './fela'
+import felaRenderer from './fela-renderer'
-export default ({ children }) => (
- <Provider renderer={getRenderer()}>
+export default ({ children }) =>
+ <Provider renderer={felaRenderer}>
{children}
</Provider>
-) | true |
Other | vercel | next.js | c39e555353d68756da28c7cc305f632e59ac539c.json | Improve Fela example (#2330)
* Improve Fela example
- add webPreset
- cleaner code
- add key for style
- demonstrate Fela composition
* Fix standard lint | examples/with-fela/package.json | @@ -9,6 +9,7 @@
"dependencies": {
"fela": "^5.0.1",
"fela-dom": "5.0.2",
+ "fela-preset-web": "^5.0.2",
"next": "latest",
"react": "^15.4.2",
"react-dom": "^15.4.2", | true |
Other | vercel | next.js | c39e555353d68756da28c7cc305f632e59ac539c.json | Improve Fela example (#2330)
* Improve Fela example
- add webPreset
- cleaner code
- add key for style
- demonstrate Fela composition
* Fix standard lint | examples/with-fela/pages/_document.js | @@ -1,14 +1,12 @@
import Document, { Head, Main, NextScript } from 'next/document'
import { renderToSheetList } from 'fela-dom'
-import getRenderer from '../fela'
+import felaRenderer from '../fela-renderer'
export default class MyDocument extends Document {
static getInitialProps ({ renderPage }) {
const ... | true |
Other | vercel | next.js | c39e555353d68756da28c7cc305f632e59ac539c.json | Improve Fela example (#2330)
* Improve Fela example
- add webPreset
- cleaner code
- add key for style
- demonstrate Fela composition
* Fix standard lint | examples/with-fela/pages/index.js | @@ -1,16 +1,32 @@
import { createComponent } from 'react-fela'
import Page from '../layout'
-const title = ({ size }) => ({
- fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
- fontSize: size + 'px',
- color: 'red'
-})
+const Container = createComponent(()... | true |
Other | vercel | next.js | 3be175b4663da23c08596428f99857fff869a8d8.json | Apollo Example: Fix duplicate head tags (#2362) | examples/with-apollo-and-redux/lib/withData.js | @@ -1,6 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import { ApolloProvider, getDataFromTree } from 'react-apollo'
+import Head from 'next/head'
import initApollo from './initApollo'
import initRedux from './initRedux'
@@ -37,6 +38,9 @@ export default ComposedComponent => {
</... | true |
Other | vercel | next.js | 3be175b4663da23c08596428f99857fff869a8d8.json | Apollo Example: Fix duplicate head tags (#2362) | examples/with-apollo/lib/withData.js | @@ -1,6 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import { ApolloProvider, getDataFromTree } from 'react-apollo'
+import Head from 'next/head'
import initApollo from './initApollo'
export default ComposedComponent => {
@@ -33,6 +34,9 @@ export default ComposedComponent => {
... | true |
Other | vercel | next.js | 048ebdf15af6169c7e85184b3510b81ab27da6aa.json | fix(package): update touch to version 2.0.2 (#2378)
Closes #2377 | package.json | @@ -89,7 +89,7 @@
"source-map-support": "0.4.15",
"strip-ansi": "3.0.1",
"styled-jsx": "1.0.6",
- "touch": "1.0.0",
+ "touch": "2.0.2",
"uglifyjs-webpack-plugin": "0.4.6",
"unfetch": "3.0.0",
"url": "0.11.0", | false |
Other | vercel | next.js | f8b822b7f6bcdaea05a16e157a3c80974a29cbe4.json | Include dynamic.js in published files (#2386)
closes #2385 | package.json | @@ -12,6 +12,7 @@
"css.js",
"head.js",
"document.js",
+ "dynamic.js",
"prefetch.js",
"router.js",
"error.js" | false |
Other | vercel | next.js | 4c33c6b9fc5a9442a8ca2ce9bc991b581a87c2af.json | lint: use const instead of let (#2270) | lib/link.js | @@ -41,7 +41,7 @@ export default class Link extends Component {
return
}
- let { shallow } = this.props
+ const { shallow } = this.props
let { href, as } = this
if (!isLocal(href)) { | false |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/basic-css/package.json | @@ -11,6 +11,5 @@
"react": "^15.4.2",
"react-dom": "^15.4.2"
},
- "author": "",
"license": "ISC"
} | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/custom-server-express/package.json | @@ -1,4 +1,6 @@
{
+ "name": "custom-server-express",
+ "version": "1.0.0",
"scripts": {
"dev": "node server.js",
"build": "next build", | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/custom-server-hapi/package.json | @@ -1,4 +1,6 @@
{
+ "name": "custom-server-hapi",
+ "version": "1.0.0",
"scripts": {
"dev": "node server.js",
"build": "next build", | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/custom-server-koa/package.json | @@ -1,5 +1,6 @@
{
"name": "custom-server-koa",
+ "version": "1.0.0",
"scripts": {
"dev": "node server.js",
"build": "next build", | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/custom-server/package.json | @@ -1,4 +1,6 @@
{
+ "name": "custom-server",
+ "version": "1.0.0",
"scripts": {
"dev": "node server.js",
"build": "next build", | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/data-fetch/package.json | @@ -12,6 +12,5 @@
"react": "^15.4.2",
"react-dom": "^15.4.2"
},
- "author": "",
"license": "ISC"
} | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/head-elements/package.json | @@ -7,10 +7,9 @@
"start": "next start"
},
"dependencies": {
- "next": "*",
+ "next": "latest",
"react": "^15.4.2",
"react-dom": "^15.4.2"
},
- "author": "",
"license": "ISC"
} | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/hello-world/package.json | @@ -7,10 +7,9 @@
"start": "next start"
},
"dependencies": {
- "next": "*",
+ "next": "latest",
"react": "^15.4.2",
"react-dom": "^15.4.2"
},
- "author": "",
"license": "ISC"
} | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/layout-component/package.json | @@ -1,16 +1,15 @@
{
- "name": "hello-world",
+ "name": "layout-component",
"version": "1.0.0",
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
},
"dependencies": {
- "next": "*",
+ "next": "latest",
"react": "^15.4.2",
"react-dom": "^15.4.2"
},
-... | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/nested-components/package.json | @@ -7,10 +7,9 @@
"start": "next start"
},
"dependencies": {
- "next": "*",
+ "next": "latest",
"react": "^15.4.2",
"react-dom": "^15.4.2"
},
- "author": "",
"license": "ISC"
} | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/parameterized-routing/package.json | @@ -1,4 +1,6 @@
{
+ "name": "parameterized-routing",
+ "version": "1.0.0",
"scripts": {
"dev": "node server.js",
"build": "next build", | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/progressive-render/package.json | @@ -1,5 +1,6 @@
{
"name": "progressive-render",
+ "version": "1.0.0",
"scripts": {
"dev": "next",
"build": "next build", | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/root-static-files/package.json | @@ -1,4 +1,6 @@
{
+ "name": "root-static-files",
+ "version": "1.0.0",
"scripts": {
"dev": "node server.js",
"build": "next build", | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/shared-modules/package.json | @@ -1,18 +1,15 @@
{
"name": "shared-modules",
"version": "1.0.0",
- "description": "This example features:",
- "main": "index.js",
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
},
"dependencies": {
- "next": "*",
+ "next": "latest",
"react": "^15.4.... | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/ssr-caching/package.json | @@ -1,4 +1,6 @@
{
+ "name": "ssr-caching",
+ "version": "1.0.0",
"scripts": {
"dev": "node server.js",
"build": "next build", | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/using-inferno/package.json | @@ -13,6 +13,5 @@
"module-alias": "^2.0.0",
"next": "latest"
},
- "author": "",
"license": "MIT"
} | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/using-preact/package.json | @@ -12,6 +12,5 @@
"preact": "^7.2.0",
"preact-compat": "^3.14.0"
},
- "author": "",
"license": "ISC"
} | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/using-router/package.json | @@ -1,8 +1,6 @@
{
- "name": "shared-modules",
+ "name": "using-router",
"version": "1.0.0",
- "description": "This example features:",
- "main": "index.js",
"scripts": {
"dev": "next",
"build": "next build",
@@ -13,6 +11,5 @@
"react": "^15.4.2",
"react-dom": "^15.4.2"
},
- "author": "... | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/with-amp/package.json | @@ -1,5 +1,5 @@
{
- "name": "amp",
+ "name": "with-amp",
"version": "1.0.0",
"scripts": {
"dev": "next",
@@ -11,6 +11,5 @@
"react": "^15.4.2",
"react-dom": "^15.4.2"
},
- "author": "",
"license": "ISC"
} | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/with-ant-design/package.json | @@ -13,6 +13,5 @@
"react": "^15.5.4",
"react-dom": "^15.5.4"
},
- "author": "",
"license": "ISC"
} | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/with-antd-mobile/package.json | @@ -1,4 +1,6 @@
{
+ "name": "with-antd-mobile",
+ "version": "1.0.0",
"dependencies": {
"antd-mobile": "^1.1.2",
"babel-plugin-import": "^1.1.1", | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/with-firebase/package.json | @@ -1,4 +1,6 @@
{
+ "name": "with-firebase",
+ "version": "1.0.0",
"scripts": {
"dev": "node server.js",
"build": "next build", | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/with-glamor/package.json | @@ -12,6 +12,5 @@
"react": "^15.4.2",
"react-dom": "^15.4.2"
},
- "author": "",
"license": "ISC"
} | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/with-glamorous/package.json | @@ -13,6 +13,5 @@
"react": "^15.4.2",
"react-dom": "^15.4.2"
},
- "author": "",
"license": "ISC"
} | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/with-global-stylesheet/package.json | @@ -1,7 +1,6 @@
{
- "name": "next.js-css-global-style-test",
+ "name": "with-global-stylesheet",
"version": "1.0.0",
- "description": "",
"scripts": {
"dev": "next dev",
"build": "next build", | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/with-higher-order-component/package.json | @@ -11,6 +11,5 @@
"react": "^15.4.2",
"react-dom": "^15.4.2"
},
- "author": "",
"license": "ISC"
} | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/with-i18next/package.json | @@ -9,11 +9,10 @@
"dependencies": {
"i18next": "^7.1.3",
"isomorphic-fetch": "^2.2.1",
- "next": "*",
+ "next": "latest",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-i18next": "^2.2.1"
},
- "author": "",
"license": "ISC"
} | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/with-jest/package.json | @@ -1,5 +1,6 @@
{
"name": "with-jest",
+ "version": "1.0.0",
"dependencies": {
"next": "latest",
"react": "^15.5.4", | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/with-loading/package.json | @@ -14,6 +14,5 @@
"react": "^15.4.2",
"react-dom": "^15.4.2"
},
- "author": "",
"license": "ISC"
} | true |
Other | vercel | next.js | f14297dc80346fcb6e77c7ed5279f1df47ec0388.json | Normalize example package.json files (#2350) | examples/with-material-ui-next/package.json | @@ -1,4 +1,6 @@
{
+ "name": "with-material-ui-next",
+ "version": "1.0.0",
"dependencies": {
"material-ui": "next",
"next": "latest", | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.