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
3f691eaa45e8f802f9977ff050f66ac64f016e74.json
Remove ts-ignore where possible (#10541) * Remove ts-ignore where possible And replace by typecasts * More accurate types * bend cliententries in a correct shape earlier on * comment becomes unnecessary * add webpack overload to allow for the next.js use case * Avoid changing public interface Co-authored-by: Jo...
packages/next/lib/resolve-request.ts
@@ -5,7 +5,6 @@ export function resolveRequest(req: string, issuer: string) { // The `resolve` package is prebuilt through ncc, which prevents // PnP from being able to inject itself into it. To circumvent // this, we simply use PnP directly when available. - // @ts-ignore if (process.versions.pnp) { ...
true
Other
vercel
next.js
3f691eaa45e8f802f9977ff050f66ac64f016e74.json
Remove ts-ignore where possible (#10541) * Remove ts-ignore where possible And replace by typecasts * More accurate types * bend cliententries in a correct shape earlier on * comment becomes unnecessary * add webpack overload to allow for the next.js use case * Avoid changing public interface Co-authored-by: Jo...
packages/next/lib/verifyTypeScriptSetup.ts
@@ -123,7 +123,6 @@ export async function verifyTypeScriptSetup( } const tsPath = await checkDependencies({ dir, isYarn }) - // @ts-ignore const ts = (await import(tsPath)) as typeof import('typescript') const compilerOptions: any = {
true
Other
vercel
next.js
3f691eaa45e8f802f9977ff050f66ac64f016e74.json
Remove ts-ignore where possible (#10541) * Remove ts-ignore where possible And replace by typecasts * More accurate types * bend cliententries in a correct shape earlier on * comment becomes unnecessary * add webpack overload to allow for the next.js use case * Avoid changing public interface Co-authored-by: Jo...
packages/next/next-server/lib/loadable-context.ts
@@ -2,7 +2,4 @@ import * as React from 'react' type CaptureFn = (moduleName: string) => void -// @ts-ignore for some reason the React types don't like this, but it's correct. -export const LoadableContext: React.Context<CaptureFn | null> = React.createContext( - null -) +export const LoadableContext = React.creat...
true
Other
vercel
next.js
3f691eaa45e8f802f9977ff050f66ac64f016e74.json
Remove ts-ignore where possible (#10541) * Remove ts-ignore where possible And replace by typecasts * More accurate types * bend cliententries in a correct shape earlier on * comment becomes unnecessary * add webpack overload to allow for the next.js use case * Avoid changing public interface Co-authored-by: Jo...
packages/next/next-server/lib/router/router.ts
@@ -17,8 +17,8 @@ import { getRouteMatcher } from './utils/route-matcher' import { getRouteRegex } from './utils/route-regex' function addBasePath(path: string): string { - // @ts-ignore variable is always a string - const p: string = process.env.__NEXT_ROUTER_BASEPATH + // variable is always a string + const p...
true
Other
vercel
next.js
3f691eaa45e8f802f9977ff050f66ac64f016e74.json
Remove ts-ignore where possible (#10541) * Remove ts-ignore where possible And replace by typecasts * More accurate types * bend cliententries in a correct shape earlier on * comment becomes unnecessary * add webpack overload to allow for the next.js use case * Avoid changing public interface Co-authored-by: Jo...
packages/next/next-server/server/lib/path-match.ts
@@ -49,8 +49,7 @@ function decodeParam(param: string) { try { return decodeURIComponent(param) } catch (_) { - const err = new Error('failed to decode param') - // @ts-ignore DECODE_FAILED is handled + const err: Error & { code?: string } = new Error('failed to decode param') err.code = 'DECODE...
true
Other
vercel
next.js
3f691eaa45e8f802f9977ff050f66ac64f016e74.json
Remove ts-ignore where possible (#10541) * Remove ts-ignore where possible And replace by typecasts * More accurate types * bend cliententries in a correct shape earlier on * comment becomes unnecessary * add webpack overload to allow for the next.js use case * Avoid changing public interface Co-authored-by: Jo...
packages/next/next-server/server/render.tsx
@@ -400,8 +400,8 @@ export async function renderToHTML( await Loadable.preloadAll() // Make sure all dynamic imports are loaded - // @ts-ignore url will always be set - const asPath: string = req.url + // url will always be set + const asPath = req.url as string const router = new ServerRouter(pathname, q...
true
Other
vercel
next.js
3f691eaa45e8f802f9977ff050f66ac64f016e74.json
Remove ts-ignore where possible (#10541) * Remove ts-ignore where possible And replace by typecasts * More accurate types * bend cliententries in a correct shape earlier on * comment becomes unnecessary * add webpack overload to allow for the next.js use case * Avoid changing public interface Co-authored-by: Jo...
packages/next/types/misc.d.ts
@@ -91,7 +91,28 @@ declare module 'autodll-webpack-plugin' { export = AutoDllPlugin } +declare module 'pnp-webpack-plugin' { + import webpack from 'webpack' + import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin' + + class PnpWebpackPlugin extends webpack.Plugin { + static forkTsCheckerOpt...
true
Other
vercel
next.js
3f691eaa45e8f802f9977ff050f66ac64f016e74.json
Remove ts-ignore where possible (#10541) * Remove ts-ignore where possible And replace by typecasts * More accurate types * bend cliententries in a correct shape earlier on * comment becomes unnecessary * add webpack overload to allow for the next.js use case * Avoid changing public interface Co-authored-by: Jo...
packages/next/types/webpack.d.ts
@@ -56,6 +56,10 @@ declare module 'webpack' { ): webpack.MultiWatching | webpack.MultiCompiler function webpack(options: webpack.Configuration[]): webpack.MultiCompiler + function webpack( + options: webpack.Configuration | webpack.Configuration[] + ): webpack.Compiler | webpack.MultiCompiler + namespac...
true
Other
vercel
next.js
41e24a516ae33913c63aea45d44c062955087d92.json
Speculate Navigations for Client-Side JS (#10560) * Speculate Navigations for Client-Side JS * add tests * avoid desctructure
packages/next/client/link.tsx
@@ -1,13 +1,14 @@ declare const __NEXT_DATA__: any -import { resolve, parse, UrlObject } from 'url' -import React, { Component, Children } from 'react' -import Router from './router' +import React, { Children, Component } from 'react' +import { parse, resolve, UrlObject } from 'url' +import { PrefetchOptions } from ...
true
Other
vercel
next.js
41e24a516ae33913c63aea45d44c062955087d92.json
Speculate Navigations for Client-Side JS (#10560) * Speculate Navigations for Client-Side JS * add tests * avoid desctructure
packages/next/next-server/lib/router/router.ts
@@ -3,7 +3,6 @@ import { ParsedUrlQuery } from 'querystring' import { ComponentType } from 'react' import { parse, UrlObject } from 'url' - import mitt, { MittEmitter } from '../mitt' import { AppContextType, @@ -52,6 +51,10 @@ export type NextRouter = BaseRouter & | 'isFallback' > +export type Prefet...
true
Other
vercel
next.js
41e24a516ae33913c63aea45d44c062955087d92.json
Speculate Navigations for Client-Side JS (#10560) * Speculate Navigations for Client-Side JS * add tests * avoid desctructure
test/integration/preload-viewport/pages/index.js
@@ -22,7 +22,7 @@ export default () => { /> <p id="scroll-to-me">Hi 👋</p> <Link href="/another"> - <a>to /another</a> + <a id="link-another">to /another</a> </Link> </div> )
true
Other
vercel
next.js
41e24a516ae33913c63aea45d44c062955087d92.json
Speculate Navigations for Client-Side JS (#10560) * Speculate Navigations for Client-Side JS * add tests * avoid desctructure
test/integration/preload-viewport/test/index.test.js
@@ -1,14 +1,14 @@ /* eslint-env jest */ /* global jasmine */ -import webdriver from 'next-webdriver' -import { join } from 'path' import { nextServer, runNextCommand, startApp, stopApp, waitFor, } from 'next-test-utils' +import webdriver from 'next-webdriver' +import { join } from 'path' jasmine.D...
true
Other
vercel
next.js
1c247b5cf1dd29009362495fe4f30755fecaaa53.json
Check next.config.js settings (#10425) * Check next.config.js settings * Add tests * test package.json case too
packages/next/build/index.ts
@@ -50,8 +50,8 @@ import { normalizePagePath } from '../next-server/server/normalize-page-path' import { eventBuildCompleted, eventBuildOptimize, + eventCliSession, eventNextPlugins, - eventVersion, } from '../telemetry/events' import { Telemetry } from '../telemetry/storage' import { CompilerResult, run...
true
Other
vercel
next.js
1c247b5cf1dd29009362495fe4f30755fecaaa53.json
Check next.config.js settings (#10425) * Check next.config.js settings * Add tests * test package.json case too
packages/next/export/index.ts
@@ -31,7 +31,7 @@ import { import loadConfig, { isTargetLikeServerless, } from '../next-server/server/config' -import { eventVersion } from '../telemetry/events' +import { eventCliSession } from '../telemetry/events' import { Telemetry } from '../telemetry/storage' import { normalizePagePath } from '../next-serv...
true
Other
vercel
next.js
1c247b5cf1dd29009362495fe4f30755fecaaa53.json
Check next.config.js settings (#10425) * Check next.config.js settings * Add tests * test package.json case too
packages/next/next-server/server/config.ts
@@ -198,7 +198,7 @@ function assignDefaults(userConfig: { [key: string]: any }) { return result } -function normalizeConfig(phase: string, config: any) { +export function normalizeConfig(phase: string, config: any) { if (typeof config === 'function') { config = config(phase, { defaultConfig })
true
Other
vercel
next.js
1c247b5cf1dd29009362495fe4f30755fecaaa53.json
Check next.config.js settings (#10425) * Check next.config.js settings * Add tests * test package.json case too
packages/next/server/next-dev-server.ts
@@ -25,7 +25,7 @@ import { __ApiPreviewProps } from '../next-server/server/api-utils' import Server, { ServerConstructor } from '../next-server/server/next-server' import { normalizePagePath } from '../next-server/server/normalize-page-path' import Router, { Params, route } from '../next-server/server/router' -impor...
true
Other
vercel
next.js
1c247b5cf1dd29009362495fe4f30755fecaaa53.json
Check next.config.js settings (#10425) * Check next.config.js settings * Add tests * test package.json case too
packages/next/telemetry/events/version.ts
@@ -1,3 +1,13 @@ +import findUp from 'find-up' +import path from 'path' +import { + CONFIG_FILE, + PHASE_DEVELOPMENT_SERVER, + PHASE_EXPORT, + PHASE_PRODUCTION_BUILD, +} from '../../next-server/lib/constants' +import { normalizeConfig } from '../../next-server/server/config' + const EVENT_VERSION = 'NEXT_CLI_SESSI...
true
Other
vercel
next.js
1c247b5cf1dd29009362495fe4f30755fecaaa53.json
Check next.config.js settings (#10425) * Check next.config.js settings * Add tests * test package.json case too
test/integration/telemetry/.babelrc.default
@@ -0,0 +1,3 @@ +{ + "presets": ["next/babel"] +}
true
Other
vercel
next.js
1c247b5cf1dd29009362495fe4f30755fecaaa53.json
Check next.config.js settings (#10425) * Check next.config.js settings * Add tests * test package.json case too
test/integration/telemetry/.babelrc.plugin
@@ -0,0 +1,4 @@ +{ + "presets": ["next/babel"], + "plugins": ["@babel/plugin-proposal-object-rest-spread"] +}
true
Other
vercel
next.js
1c247b5cf1dd29009362495fe4f30755fecaaa53.json
Check next.config.js settings (#10425) * Check next.config.js settings * Add tests * test package.json case too
test/integration/telemetry/.babelrc.preset
@@ -0,0 +1,3 @@ +{ + "presets": ["next/babel", "@babel/preset-flow"] +}
true
Other
vercel
next.js
1c247b5cf1dd29009362495fe4f30755fecaaa53.json
Check next.config.js settings (#10425) * Check next.config.js settings * Add tests * test package.json case too
test/integration/telemetry/next.config.target
@@ -0,0 +1,10 @@ +const { PHASE_PRODUCTION_BUILD } = require('next/constants') + +module.exports = phase => { + if (phase === PHASE_PRODUCTION_BUILD) { + return { + target: 'experimental-serverless-trace', + } + } + return {} +}
true
Other
vercel
next.js
1c247b5cf1dd29009362495fe4f30755fecaaa53.json
Check next.config.js settings (#10425) * Check next.config.js settings * Add tests * test package.json case too
test/integration/telemetry/next.config.webpack
@@ -0,0 +1,5 @@ +module.exports = { + webpack(config) { + return config + }, +}
true
Other
vercel
next.js
1c247b5cf1dd29009362495fe4f30755fecaaa53.json
Check next.config.js settings (#10425) * Check next.config.js settings * Add tests * test package.json case too
test/integration/telemetry/package.babel
@@ -0,0 +1,10 @@ +{ + "babel": { + "presets": [ + "next/babel" + ], + "plugins": [ + "@babel/plugin-proposal-object-rest-spread" + ] + } +}
true
Other
vercel
next.js
1c247b5cf1dd29009362495fe4f30755fecaaa53.json
Check next.config.js settings (#10425) * Check next.config.js settings * Add tests * test package.json case too
test/integration/telemetry/test/index.test.js
@@ -138,6 +138,182 @@ describe('Telemetry CLI', () => { expect(event2).toMatch(/hasTestPages.*?true/) }) + it('detects correct cli session defaults', async () => { + const { stderr } = await runNextCommand(['build', appDir], { + stderr: true, + env: { + NEXT_TELEMETRY_DEBUG: 1, + }, ...
true
Other
vercel
next.js
1a50d99fbd3278aa09f749bf33e1d801bedc5826.json
Update withApollo example (#10451) * Make withApollo work with _app.js components * Support wrapping functional _App * Add apolloClient to NextPageContext & NextPageContext * Propertly call App.getInitialProps if used in NextAppContext * Add Automatic Static Optimization warning * Update deps * Reduc...
examples/with-apollo/apolloClient.js
@@ -0,0 +1,18 @@ +import { ApolloClient } from 'apollo-client' +import { InMemoryCache } from 'apollo-cache-inmemory' +import { HttpLink } from 'apollo-link-http' +import fetch from 'isomorphic-unfetch' + +export default function createApolloClient(initialState, ctx) { + // The `ctx` (NextPageContext) will only be pre...
true
Other
vercel
next.js
1a50d99fbd3278aa09f749bf33e1d801bedc5826.json
Update withApollo example (#10451) * Make withApollo work with _app.js components * Support wrapping functional _App * Add apolloClient to NextPageContext & NextPageContext * Propertly call App.getInitialProps if used in NextAppContext * Add Automatic Static Optimization warning * Update deps * Reduc...
examples/with-apollo/lib/apollo.js
@@ -1,22 +1,94 @@ import React from 'react' import App from 'next/app' -import Head from 'next/head' import { ApolloProvider } from '@apollo/react-hooks' -import { ApolloClient } from 'apollo-client' -import { InMemoryCache } from 'apollo-cache-inmemory' -import { HttpLink } from 'apollo-link-http' -import fetch fro...
true
Other
vercel
next.js
1a50d99fbd3278aa09f749bf33e1d801bedc5826.json
Update withApollo example (#10451) * Make withApollo work with _app.js components * Support wrapping functional _App * Add apolloClient to NextPageContext & NextPageContext * Propertly call App.getInitialProps if used in NextAppContext * Add Automatic Static Optimization warning * Update deps * Reduc...
examples/with-apollo/package.json
@@ -7,13 +7,13 @@ "start": "next start" }, "dependencies": { - "@apollo/react-hooks": "3.0.0", - "@apollo/react-ssr": "3.0.0", - "apollo-cache-inmemory": "1.6.3", - "apollo-client": "2.6.4", - "apollo-link-http": "1.5.15", + "@apollo/react-hooks": "3.1.3", + "@apollo/react-ssr": "3.1.3",...
true
Other
vercel
next.js
1a50d99fbd3278aa09f749bf33e1d801bedc5826.json
Update withApollo example (#10451) * Make withApollo work with _app.js components * Support wrapping functional _App * Add apolloClient to NextPageContext & NextPageContext * Propertly call App.getInitialProps if used in NextAppContext * Add Automatic Static Optimization warning * Update deps * Reduc...
examples/with-apollo/pages/about.js
@@ -1,7 +1,7 @@ import App from '../components/App' import Header from '../components/Header' -export default () => ( +const AboutPage = () => ( <App> <Header /> <article> @@ -41,3 +41,5 @@ export default () => ( </article> </App> ) + +export default AboutPage
true
Other
vercel
next.js
1a50d99fbd3278aa09f749bf33e1d801bedc5826.json
Update withApollo example (#10451) * Make withApollo work with _app.js components * Support wrapping functional _App * Add apolloClient to NextPageContext & NextPageContext * Propertly call App.getInitialProps if used in NextAppContext * Add Automatic Static Optimization warning * Update deps * Reduc...
examples/with-apollo/pages/client-only.js
@@ -26,5 +26,4 @@ const ClientOnlyPage = props => ( </App> ) -// Disable apollo ssr fetching in favour of automatic static optimization -export default withApollo({ ssr: false })(ClientOnlyPage) +export default withApollo()(ClientOnlyPage)
true
Other
vercel
next.js
1a50d99fbd3278aa09f749bf33e1d801bedc5826.json
Update withApollo example (#10451) * Make withApollo work with _app.js components * Support wrapping functional _App * Add apolloClient to NextPageContext & NextPageContext * Propertly call App.getInitialProps if used in NextAppContext * Add Automatic Static Optimization warning * Update deps * Reduc...
examples/with-apollo/pages/index.js
@@ -5,7 +5,7 @@ import Submit from '../components/Submit' import PostList from '../components/PostList' import { withApollo } from '../lib/apollo' -const IndexPage = props => ( +const IndexPage = () => ( <App> <Header /> <InfoBox> @@ -26,4 +26,4 @@ const IndexPage = props => ( </App> ) -export de...
true
Other
vercel
next.js
0b12e2e8595c67fdb8ffdd36c189916b59df5ce7.json
Improve error for invalid page configurations (#10441) * Remove any type and fix edge cases Removed the "as any" and use the @babel/types typeguards instead. This revealed some edge cases that would just error. * Remove ts-ignore Co-authored-by: Joe Haddad <timer150@gmail.com>
packages/next/build/babel/plugins/next-page-config.ts
@@ -2,7 +2,6 @@ import { NodePath, PluginObj } from '@babel/core' import * as BabelTypes from '@babel/types' import { PageConfig } from 'next/types' -const configKeys = new Set(['amp']) const STRING_LITERAL_DROP_BUNDLE = '__NEXT_DROP_CLIENT_FILE__' // replace program path with just a variable with the drop iden...
true
Other
vercel
next.js
0b12e2e8595c67fdb8ffdd36c189916b59df5ce7.json
Improve error for invalid page configurations (#10441) * Remove any type and fix edge cases Removed the "as any" and use the @babel/types typeguards instead. This revealed some edge cases that would just error. * Remove ts-ignore Co-authored-by: Joe Haddad <timer150@gmail.com>
test/integration/page-config/pages/index.js
@@ -1,8 +1,6 @@ import { config as hello } from '../something' import { config as world } from '../config' -// export const config = 'hello world' - export default () => ( <p> {hello} {world}
true
Other
vercel
next.js
0b12e2e8595c67fdb8ffdd36c189916b59df5ce7.json
Improve error for invalid page configurations (#10441) * Remove any type and fix edge cases Removed the "as any" and use the @babel/types typeguards instead. This revealed some edge cases that would just error. * Remove ts-ignore Co-authored-by: Joe Haddad <timer150@gmail.com>
test/integration/page-config/pages/invalid/invalid-property.js
@@ -0,0 +1,3 @@ +// export const config = { amp() {} } + +export default () => <p>hello world</p>
true
Other
vercel
next.js
0b12e2e8595c67fdb8ffdd36c189916b59df5ce7.json
Improve error for invalid page configurations (#10441) * Remove any type and fix edge cases Removed the "as any" and use the @babel/types typeguards instead. This revealed some edge cases that would just error. * Remove ts-ignore Co-authored-by: Joe Haddad <timer150@gmail.com>
test/integration/page-config/pages/invalid/invalid-value.js
@@ -0,0 +1,5 @@ +const amp = 'hybrid' + +// export const config = { amp } + +export default () => <p>hello ${amp}</p>
true
Other
vercel
next.js
0b12e2e8595c67fdb8ffdd36c189916b59df5ce7.json
Improve error for invalid page configurations (#10441) * Remove any type and fix edge cases Removed the "as any" and use the @babel/types typeguards instead. This revealed some edge cases that would just error. * Remove ts-ignore Co-authored-by: Joe Haddad <timer150@gmail.com>
test/integration/page-config/pages/invalid/no-init.js
@@ -0,0 +1,3 @@ +// export let config + +export default () => <p>hello world</p>
true
Other
vercel
next.js
0b12e2e8595c67fdb8ffdd36c189916b59df5ce7.json
Improve error for invalid page configurations (#10441) * Remove any type and fix edge cases Removed the "as any" and use the @babel/types typeguards instead. This revealed some edge cases that would just error. * Remove ts-ignore Co-authored-by: Joe Haddad <timer150@gmail.com>
test/integration/page-config/pages/invalid/spread-config.js
@@ -0,0 +1,5 @@ +const props = { amp: true } + +// export const config = { ...props } + +export default () => <p>{props}</p>
true
Other
vercel
next.js
0b12e2e8595c67fdb8ffdd36c189916b59df5ce7.json
Improve error for invalid page configurations (#10441) * Remove any type and fix edge cases Removed the "as any" and use the @babel/types typeguards instead. This revealed some edge cases that would just error. * Remove ts-ignore Co-authored-by: Joe Haddad <timer150@gmail.com>
test/integration/page-config/pages/invalid/string-config.js
@@ -0,0 +1,3 @@ +// export const config = 'hello world' + +export default () => <p>hello world</p>
true
Other
vercel
next.js
0b12e2e8595c67fdb8ffdd36c189916b59df5ce7.json
Improve error for invalid page configurations (#10441) * Remove any type and fix edge cases Removed the "as any" and use the @babel/types typeguards instead. This revealed some edge cases that would just error. * Remove ts-ignore Co-authored-by: Joe Haddad <timer150@gmail.com>
test/integration/page-config/test/index.test.js
@@ -5,28 +5,87 @@ import { join } from 'path' import { nextBuild } from 'next-test-utils' const appDir = join(__dirname, '..') -const indexPage = join(appDir, 'pages/index.js') jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 2 +async function uncommentExport(page) { + const pagePath = join(appDir, 'pages', pag...
true
Other
vercel
next.js
e38e3dd55a7012e8f7644303d7c1af09dbc6a367.json
Adjust SSG Loading Behavior (#10510) * Adjust SSG Loading Behavior * Update expected preview behavior * Rename two corrections * Only use skeleton in production for now * Fix "should SSR SPR page correctly" test * fix tests * fix trailing comment letter * disable test for now
packages/next/build/index.ts
@@ -657,15 +657,18 @@ export default async function build(dir: string, conf = null): Promise<void> { // n.b. we cannot handle this above in combinedPages because the dynamic // page must be in the `pages` array, but not in the mapping. exportPathMap: (defaultMap: any) => { - // Generate fall...
true
Other
vercel
next.js
e38e3dd55a7012e8f7644303d7c1af09dbc6a367.json
Adjust SSG Loading Behavior (#10510) * Adjust SSG Loading Behavior * Update expected preview behavior * Rename two corrections * Only use skeleton in production for now * Fix "should SSR SPR page correctly" test * fix tests * fix trailing comment letter * disable test for now
packages/next/client/index.js
@@ -97,9 +97,10 @@ class Container extends React.Component { }) } - // If page was exported and has a querystring - // If it's a dynamic route or has a querystring - // if it's a fallback page + // We need to replace the router state if: + // - the page was (auto) exported and has a query...
true
Other
vercel
next.js
e38e3dd55a7012e8f7644303d7c1af09dbc6a367.json
Adjust SSG Loading Behavior (#10510) * Adjust SSG Loading Behavior * Update expected preview behavior * Rename two corrections * Only use skeleton in production for now * Fix "should SSR SPR page correctly" test * fix tests * fix trailing comment letter * disable test for now
packages/next/next-server/lib/router/router.ts
@@ -64,11 +64,12 @@ type BeforePopStateCallback = (state: any) => boolean type ComponentLoadCancel = (() => void) | null -const fetchNextData = ( +function fetchNextData( pathname: string, query: ParsedUrlQuery | null, + isServerRender: boolean, cb?: (...args: any) => any -) => { +) { return fetch( ...
true
Other
vercel
next.js
e38e3dd55a7012e8f7644303d7c1af09dbc6a367.json
Adjust SSG Loading Behavior (#10510) * Adjust SSG Loading Behavior * Update expected preview behavior * Rename two corrections * Only use skeleton in production for now * Fix "should SSR SPR page correctly" test * fix tests * fix trailing comment letter * disable test for now
packages/next/next-server/server/next-server.ts
@@ -992,22 +992,42 @@ export default class Server { return { html, pageData, sprRevalidate } }) - // render fallback if for a preview path or a non-seeded dynamic path + const isProduction = !this.renderOpts.dev const isDynamicPathname = isDynamicRoute(pathname) + const didRespond = isResSen...
true
Other
vercel
next.js
e38e3dd55a7012e8f7644303d7c1af09dbc6a367.json
Adjust SSG Loading Behavior (#10510) * Adjust SSG Loading Behavior * Update expected preview behavior * Rename two corrections * Only use skeleton in production for now * Fix "should SSR SPR page correctly" test * fix tests * fix trailing comment letter * disable test for now
test/integration/dynamic-routing/test/index.test.js
@@ -275,15 +275,15 @@ function runTests(dev) { }) }) - it('[predefined ssg: prerendered catch all] should pass param in getInitialProps during SSR', async () => { + it('[predefined ssg: prerendered catch all] should pass param in getStaticProps during SSR', async () => { const data = await renderViaHTT...
true
Other
vercel
next.js
e38e3dd55a7012e8f7644303d7c1af09dbc6a367.json
Adjust SSG Loading Behavior (#10510) * Adjust SSG Loading Behavior * Update expected preview behavior * Rename two corrections * Only use skeleton in production for now * Fix "should SSR SPR page correctly" test * fix tests * fix trailing comment letter * disable test for now
test/integration/prerender-preview/test/index.test.js
@@ -81,7 +81,7 @@ function runTests() { cookie.serialize('__next_preview_data', cookies[1].__next_preview_data) }) - it('should return fallback page on preview request', async () => { + it('should not return fallback page on preview request', async () => { const res = await fetchViaHTTP( appPo...
true
Other
vercel
next.js
e38e3dd55a7012e8f7644303d7c1af09dbc6a367.json
Adjust SSG Loading Behavior (#10510) * Adjust SSG Loading Behavior * Update expected preview behavior * Rename two corrections * Only use skeleton in production for now * Fix "should SSR SPR page correctly" test * fix tests * fix trailing comment letter * disable test for now
test/integration/prerender/test/index.test.js
@@ -254,12 +254,9 @@ const runTests = (dev = false) => { it('should SSR SPR page correctly', async () => { const html = await renderViaHTTP(appPort, '/blog/post-1') - if (dev) { - const $ = cheerio.load(html) - expect(JSON.parse($('#__NEXT_DATA__').text()).isFallback).toBe(true) - } else { - ...
true
Other
vercel
next.js
04d5bbcc50fb532de1d0cff3f04791fcd52b309c.json
Fix typo in ignoring-typescript-errors.md (#10499)
docs/api-reference/next.config.js/ignoring-typescript-errors.md
@@ -24,7 +24,7 @@ If you'd like Next.js to dangerously produce production code even when your appl > Be sure you are running type checks as part of your build or deploy process, otherwise this can be very dangerous. -Open `next.config.js` and enable the `ignoreDevErrors` option in the `typescript` config: +Open `n...
false
Other
vercel
next.js
2ff0913864790a456a38445b9ccfe4af1bbfd7c1.json
Use filter for create-next-app template (#10496)
packages/create-next-app/templates/default/pages/index.js
@@ -37,7 +37,7 @@ const Home = () => ( </a> <a - href="https://zeit.co/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" + href="https://zeit.co/new?filter=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next...
false
Other
vercel
next.js
a33e365c8ff294efede7719dcf37f4cad2c61432.json
get the http2 example to work (#10470) * copy only the necessary files during stage 2 in multi-stage. * update readme * adds compress:false to prevent the server from crashing while running http2 * moving the config to next.config * link to the issue * fix grammatical error * Update examples/with-http2/next.con...
examples/with-http2/next.config.js
@@ -0,0 +1,6 @@ +module.exports = { + /* this needs to be set to false until a bug in the compression npm module gets fixed. +reference: https://github.com/expressjs/compression/issues/122 + */ + compress: false, +}
false
Other
vercel
next.js
e382997ea7df4ee9ec736535c1ec1dcab947ec62.json
Upgrade koa router in example (#10469) * Upgrade koa router * Change koa import
examples/custom-server-koa/package.json
@@ -9,7 +9,7 @@ "dependencies": { "cross-env": "^5.2.0", "koa": "^2.0.1", - "koa-router": "^7.1.0", + "@koa/router": "^8.0.7", "next": "latest", "react": "^16.7.0", "react-dom": "^16.7.0"
true
Other
vercel
next.js
e382997ea7df4ee9ec736535c1ec1dcab947ec62.json
Upgrade koa router in example (#10469) * Upgrade koa router * Change koa import
examples/custom-server-koa/server.js
@@ -1,6 +1,6 @@ const Koa = require('koa') const next = require('next') -const Router = require('koa-router') +const Router = require('@koa/router') const port = parseInt(process.env.PORT, 10) || 3000 const dev = process.env.NODE_ENV !== 'production'
true
Other
vercel
next.js
f6e7a38101e9de98cdbc569264e105c4c5f474bd.json
Add paths field for unstable_getStaticPaths (#10454) * Add paths field for unstable_getStaticPaths * Make sure to specify page in getStaticPaths errors
packages/next/build/utils.ts
@@ -15,6 +15,7 @@ import { recursiveReadDir } from '../lib/recursive-readdir' import { getRouteMatcher, getRouteRegex } from '../next-server/lib/router/utils' import { isDynamicRoute } from '../next-server/lib/router/utils/is-dynamic' import { findPageFile } from '../server/lib/find-page-file' +import { Unstable_get...
true
Other
vercel
next.js
f6e7a38101e9de98cdbc569264e105c4c5f474bd.json
Add paths field for unstable_getStaticPaths (#10454) * Add paths field for unstable_getStaticPaths * Make sure to specify page in getStaticPaths errors
packages/next/next-server/server/load-components.ts
@@ -32,7 +32,9 @@ type Unstable_getStaticProps = (params: { revalidate?: number | boolean }> -type Unstable_getStaticPaths = () => Promise<Array<string | ParsedUrlQuery>> +export type Unstable_getStaticPaths = () => Promise<{ + paths: Array<string | { params: ParsedUrlQuery }> +}> type Unstable_getServerProps...
true
Other
vercel
next.js
f6e7a38101e9de98cdbc569264e105c4c5f474bd.json
Add paths field for unstable_getStaticPaths (#10454) * Add paths field for unstable_getStaticPaths * Make sure to specify page in getStaticPaths errors
test/integration/catches-missing-getStaticProps/pages/[slug].js
@@ -1,5 +1,5 @@ export async function unstable_getStaticPaths() { - return ['/hello', '/world'] + return { paths: ['/hello', '/world'] } } export default () => <p>something is missing 🤔</p>
true
Other
vercel
next.js
f6e7a38101e9de98cdbc569264e105c4c5f474bd.json
Add paths field for unstable_getStaticPaths (#10454) * Add paths field for unstable_getStaticPaths * Make sure to specify page in getStaticPaths errors
test/integration/dynamic-routing/pages/p1/p2/predefined-ssg/[...rest].js
@@ -7,10 +7,12 @@ export function unstable_getStaticProps({ params }) { } export function unstable_getStaticPaths() { - return [ - `/p1/p2/predefined-ssg/one-level`, - `/p1/p2/predefined-ssg/1st-level/2nd-level`, - ] + return { + paths: [ + `/p1/p2/predefined-ssg/one-level`, + `/p1/p2/predefin...
true
Other
vercel
next.js
f6e7a38101e9de98cdbc569264e105c4c5f474bd.json
Add paths field for unstable_getStaticPaths (#10454) * Add paths field for unstable_getStaticPaths * Make sure to specify page in getStaticPaths errors
test/integration/prerender-invalid-catchall-params/pages/[...slug].js
@@ -2,7 +2,7 @@ import React from 'react' // eslint-disable-next-line camelcase export async function unstable_getStaticPaths() { - return [{ params: { slug: 'hello' } }] + return { paths: [{ params: { slug: 'hello' } }] } } // eslint-disable-next-line camelcase
true
Other
vercel
next.js
f6e7a38101e9de98cdbc569264e105c4c5f474bd.json
Add paths field for unstable_getStaticPaths (#10454) * Add paths field for unstable_getStaticPaths * Make sure to specify page in getStaticPaths errors
test/integration/prerender-invalid-paths/pages/[foo]/[post].js
@@ -2,7 +2,7 @@ import React from 'react' // eslint-disable-next-line camelcase export async function unstable_getStaticPaths() { - return [{ foo: 'bad', baz: 'herro' }] + return { paths: [{ foo: 'bad', baz: 'herro' }] } } // eslint-disable-next-line camelcase
true
Other
vercel
next.js
f6e7a38101e9de98cdbc569264e105c4c5f474bd.json
Add paths field for unstable_getStaticPaths (#10454) * Add paths field for unstable_getStaticPaths * Make sure to specify page in getStaticPaths errors
test/integration/prerender/pages/blog/[post]/[comment].js
@@ -3,10 +3,12 @@ import Link from 'next/link' // eslint-disable-next-line camelcase export async function unstable_getStaticPaths() { - return [ - '/blog/post-1/comment-1', - { params: { post: 'post-2', comment: 'comment-2' } }, - ] + return { + paths: [ + '/blog/post-1/comment-1', + { params...
true
Other
vercel
next.js
f6e7a38101e9de98cdbc569264e105c4c5f474bd.json
Add paths field for unstable_getStaticPaths (#10454) * Add paths field for unstable_getStaticPaths * Make sure to specify page in getStaticPaths errors
test/integration/prerender/pages/blog/[post]/index.js
@@ -4,14 +4,16 @@ import { useRouter } from 'next/router' // eslint-disable-next-line camelcase export async function unstable_getStaticPaths() { - return [ - '/blog/post-1', - { params: { post: 'post-2' } }, - '/blog/[post3]', - '/blog/post-4', - '/blog/post.1', - '/blog/post.1', // handle dupli...
true
Other
vercel
next.js
f6e7a38101e9de98cdbc569264e105c4c5f474bd.json
Add paths field for unstable_getStaticPaths (#10454) * Add paths field for unstable_getStaticPaths * Make sure to specify page in getStaticPaths errors
test/integration/prerender/pages/catchall/[...slug].js
@@ -8,12 +8,14 @@ export async function unstable_getStaticProps({ params: { slug } }) { } export async function unstable_getStaticPaths() { - return [ - { params: { slug: ['first'] } }, - '/catchall/second', - { params: { slug: ['another', 'value'] } }, - '/catchall/hello/another', - ] + return { + ...
true
Other
vercel
next.js
f6e7a38101e9de98cdbc569264e105c4c5f474bd.json
Add paths field for unstable_getStaticPaths (#10454) * Add paths field for unstable_getStaticPaths * Make sure to specify page in getStaticPaths errors
test/integration/prerender/pages/user/[user]/profile.js
@@ -3,7 +3,7 @@ import Link from 'next/link' // eslint-disable-next-line camelcase export async function unstable_getStaticPaths() { - return [] + return { paths: [] } } // eslint-disable-next-line camelcase
true
Other
vercel
next.js
20d88231f4815ed79e3640509f9e11b242762ecb.json
Make withApollo work with _app.js components (#8801) * Make withApollo work with _app.js components * Support wrapping functional _App * Add apolloClient to NextPageContext & NextPageContext * Propertly call App.getInitialProps if used in NextAppContext * Add Automatic Static Optimization warning
examples/with-apollo/lib/apollo.js
@@ -1,4 +1,5 @@ import React from 'react' +import App from 'next/app' import Head from 'next/head' import { ApolloProvider } from '@apollo/react-hooks' import { ApolloClient } from 'apollo-client' @@ -28,25 +29,44 @@ export const withApollo = ({ ssr = true } = {}) => PageComponent => { const displayName = ...
false
Other
vercel
next.js
3099f0881ae50881f2638ec2adb4c5dd2ee59ef7.json
Add initial SSG fallback handling (#10424) * Add initial SSG fallback handling * Remove extra changes and update fallback handling * Remove extra timeout for testing * Update SSG tests in dynamic-routing suite * Add racing to decide between rendering fallback and data * Update size-limit test * Updat...
packages/next/build/index.ts
@@ -88,7 +88,7 @@ export type SsgRoute = { export type DynamicSsgRoute = { routeRegex: string - + fallback: string dataRoute: string dataRouteRegex: string } @@ -639,15 +639,16 @@ export default async function build(dir: string, conf = null): Promise<void> { // n.b. we cannot handle this above in c...
true
Other
vercel
next.js
3099f0881ae50881f2638ec2adb4c5dd2ee59ef7.json
Add initial SSG fallback handling (#10424) * Add initial SSG fallback handling * Remove extra changes and update fallback handling * Remove extra timeout for testing * Update SSG tests in dynamic-routing suite * Add racing to decide between rendering fallback and data * Update size-limit test * Updat...
packages/next/build/webpack/loaders/next-serverless-loader.ts
@@ -308,7 +308,9 @@ const nextServerlessLoader: loader.Loader = function() { // if provided from worker or params if we're parsing them here renderOpts.params = _params || params - let result = await renderToHTML(req, res, "${page}", Object.assign({}, unstable_getStaticProps ? {} : parsedUrl....
true
Other
vercel
next.js
3099f0881ae50881f2638ec2adb4c5dd2ee59ef7.json
Add initial SSG fallback handling (#10424) * Add initial SSG fallback handling * Remove extra changes and update fallback handling * Remove extra timeout for testing * Update SSG tests in dynamic-routing suite * Add racing to decide between rendering fallback and data * Update size-limit test * Updat...
packages/next/client/index.js
@@ -44,6 +44,7 @@ const { assetPrefix, runtimeConfig, dynamicIds, + isFallback, } = data const prefix = assetPrefix || '' @@ -98,10 +99,12 @@ class Container extends React.Component { // If page was exported and has a querystring // If it's a dynamic route or has a querystring + // if it's ...
true
Other
vercel
next.js
3099f0881ae50881f2638ec2adb4c5dd2ee59ef7.json
Add initial SSG fallback handling (#10424) * Add initial SSG fallback handling * Remove extra changes and update fallback handling * Remove extra timeout for testing * Update SSG tests in dynamic-routing suite * Add racing to decide between rendering fallback and data * Update size-limit test * Updat...
packages/next/next-server/lib/router/router.ts
@@ -78,17 +78,15 @@ const fetchNextData = ( ) .then(res => { if (!res.ok) { - throw new Error(`Failed to load static props`) + const error = new Error(`Failed to load static props`) + ;(error as any).statusCode = res.status + throw error } return res.json() ...
true
Other
vercel
next.js
3099f0881ae50881f2638ec2adb4c5dd2ee59ef7.json
Add initial SSG fallback handling (#10424) * Add initial SSG fallback handling * Remove extra changes and update fallback handling * Remove extra timeout for testing * Update SSG tests in dynamic-routing suite * Add racing to decide between rendering fallback and data * Update size-limit test * Updat...
packages/next/next-server/lib/utils.ts
@@ -76,6 +76,7 @@ export type NEXT_DATA = { runtimeConfig?: { [key: string]: any } nextExport?: boolean autoExport?: boolean + isFallback?: boolean dynamicIds?: string[] err?: Error & { statusCode?: number } }
true
Other
vercel
next.js
3099f0881ae50881f2638ec2adb4c5dd2ee59ef7.json
Add initial SSG fallback handling (#10424) * Add initial SSG fallback handling * Remove extra changes and update fallback handling * Remove extra timeout for testing * Update SSG tests in dynamic-routing suite * Add racing to decide between rendering fallback and data * Update size-limit test * Updat...
packages/next/next-server/server/next-server.ts
@@ -43,7 +43,12 @@ import Router, { } from './router' import { sendHTML } from './send-html' import { serveStatic } from './serve-static' -import { getSprCache, initializeSprCache, setSprCache } from './spr-cache' +import { + getSprCache, + initializeSprCache, + setSprCache, + getFallback, +} from './spr-cache' ...
true
Other
vercel
next.js
3099f0881ae50881f2638ec2adb4c5dd2ee59ef7.json
Add initial SSG fallback handling (#10424) * Add initial SSG fallback handling * Remove extra changes and update fallback handling * Remove extra timeout for testing * Update SSG tests in dynamic-routing suite * Add racing to decide between rendering fallback and data * Update size-limit test * Updat...
packages/next/next-server/server/render.tsx
@@ -152,6 +152,7 @@ function renderDocument( runtimeConfig, nextExport, autoExport, + isFallback, dynamicImportsIds, dangerousAsPath, hasCssMode, @@ -187,6 +188,7 @@ function renderDocument( htmlProps: any bodyTags: any headTags: any + isFallback?: boolean } ): str...
true
Other
vercel
next.js
3099f0881ae50881f2638ec2adb4c5dd2ee59ef7.json
Add initial SSG fallback handling (#10424) * Add initial SSG fallback handling * Remove extra changes and update fallback handling * Remove extra timeout for testing * Update SSG tests in dynamic-routing suite * Add racing to decide between rendering fallback and data * Update size-limit test * Updat...
packages/next/next-server/server/spr-cache.ts
@@ -92,6 +92,11 @@ export function initializeSprCache({ }) } +export async function getFallback(page: string): Promise<string> { + page = normalizePagePath(page) + return readFile(getSeedPath(page, 'html'), 'utf8') +} + // get data from SPR cache if available export async function getSprCache( pathname: st...
true
Other
vercel
next.js
3099f0881ae50881f2638ec2adb4c5dd2ee59ef7.json
Add initial SSG fallback handling (#10424) * Add initial SSG fallback handling * Remove extra changes and update fallback handling * Remove extra timeout for testing * Update SSG tests in dynamic-routing suite * Add racing to decide between rendering fallback and data * Update size-limit test * Updat...
test/integration/dynamic-routing/test/index.test.js
@@ -239,48 +239,58 @@ function runTests(dev) { } }) - it('[ssg: catch all] should pass param in getInitialProps during SSR', async () => { - const html = await renderViaHTTP(appPort, '/p1/p2/all-ssg/test1') - const $ = cheerio.load(html) - expect($('#all-ssg-content').text()).toBe('{"rest":["test1"]...
true
Other
vercel
next.js
3099f0881ae50881f2638ec2adb4c5dd2ee59ef7.json
Add initial SSG fallback handling (#10424) * Add initial SSG fallback handling * Remove extra changes and update fallback handling * Remove extra timeout for testing * Update SSG tests in dynamic-routing suite * Add racing to decide between rendering fallback and data * Update size-limit test * Updat...
test/integration/prerender/pages/blog/[post]/[comment].js
@@ -22,6 +22,11 @@ export async function unstable_getStaticProps({ params }) { } export default ({ post, comment, time }) => { + // we're in a loading state + if (!post) { + return <p>loading...</p> + } + return ( <> <p>Post: {post}</p>
true
Other
vercel
next.js
3099f0881ae50881f2638ec2adb4c5dd2ee59ef7.json
Add initial SSG fallback handling (#10424) * Add initial SSG fallback handling * Remove extra changes and update fallback handling * Remove extra timeout for testing * Update SSG tests in dynamic-routing suite * Add racing to decide between rendering fallback and data * Update size-limit test * Updat...
test/integration/prerender/pages/catchall/[...slug].js
@@ -16,4 +16,4 @@ export async function unstable_getStaticPaths() { ] } -export default ({ slug }) => <p id="catchall">Hi {slug.join('/')}</p> +export default ({ slug }) => <p id="catchall">Hi {slug?.join('/')}</p>
true
Other
vercel
next.js
3099f0881ae50881f2638ec2adb4c5dd2ee59ef7.json
Add initial SSG fallback handling (#10424) * Add initial SSG fallback handling * Remove extra changes and update fallback handling * Remove extra timeout for testing * Update SSG tests in dynamic-routing suite * Add racing to decide between rendering fallback and data * Update size-limit test * Updat...
test/integration/prerender/test/index.test.js
@@ -253,7 +253,13 @@ const runTests = (dev = false) => { it('should SSR SPR page correctly', async () => { const html = await renderViaHTTP(appPort, '/blog/post-1') - expect(html).toMatch(/Post:.*?post-1/) + + if (dev) { + const $ = cheerio.load(html) + expect(JSON.parse($('#__NEXT_DATA__').te...
true
Other
vercel
next.js
5e4850ceee3408eb8ab331749c29b7baccbd4043.json
Remove unused dependency @types/babel-types (#10448) `@types/babel-types` doesn't seem to be in use anymore. `babel-types` is not used anywhere and `@babel/types` has its own typings included.
packages/next/package.json
@@ -159,7 +159,6 @@ "@taskr/esnext": "1.1.0", "@taskr/watch": "1.1.0", "@types/amphtml-validator": "1.0.0", - "@types/babel-types": "7.0.7", "@types/babel__core": "7.1.3", "@types/babel__generator": "7.6.0", "@types/babel__template": "7.0.2",
true
Other
vercel
next.js
5e4850ceee3408eb8ab331749c29b7baccbd4043.json
Remove unused dependency @types/babel-types (#10448) `@types/babel-types` doesn't seem to be in use anymore. `babel-types` is not used anywhere and `@babel/types` has its own typings included.
yarn.lock
@@ -2427,11 +2427,6 @@ resolved "https://registry.yarnpkg.com/@types/anymatch/-/anymatch-1.3.1.tgz#336badc1beecb9dacc38bea2cf32adf627a8421a" integrity sha512-/+CRPXpBDpo2RK9C68N3b2cOvO0Cf5B9aPijHsoDQTHivnGSObdOF2BRQOYjojWTDy6nQvMjmqRXIxH55VjxxA== -"@types/babel-types@7.0.7": - version "7.0.7" - resolved "http...
true
Other
vercel
next.js
924f8ae3b643b0ffba2fb9dbb5bdc3eb33642fdc.json
Remove old ts-ignores and extra value in routeInfo (#10429)
packages/next/next-server/lib/router/router.ts
@@ -150,7 +150,6 @@ export default class Router implements BaseRouter { // Backwards compat for Router.router.events // TODO: Should be remove the following major version as it was never documented - // @ts-ignore backwards compatibility this.events = Router.events this.pageLoader = pageLoade...
false
Other
vercel
next.js
0b1ef7cbf45ee23694b83b9efbf62eb9bd29f6c9.json
Adjust README of example (#10426)
examples/with-zones/README.md
@@ -31,21 +31,15 @@ cd with-zones ## Notes -In this example, we have two apps: 'home' and 'blog'. We'll start both apps with [Now](https://zeit.co/now): - -```bash -now dev -``` - -Then, you can visit <http://localhost:3000> and develop for both apps as a single app. - -You can also start the apps separately, for ...
false
Other
vercel
next.js
ec39aa46dc40e4b2a86e6500fdf5b48d30c1fa0d.json
Update optimize event with static 404 status (#10420) Co-authored-by: Joe Haddad <timer150@gmail.com>
packages/next/build/index.ts
@@ -773,6 +773,7 @@ export default async function build(dir: string, conf = null): Promise<void> { durationInSeconds: analysisEnd[0], staticPageCount: staticPages.size, ssrPageCount: pagePaths.length - staticPages.size, + hasStatic404: useStatic404, }) )
true
Other
vercel
next.js
ec39aa46dc40e4b2a86e6500fdf5b48d30c1fa0d.json
Update optimize event with static 404 status (#10420) Co-authored-by: Joe Haddad <timer150@gmail.com>
packages/next/telemetry/events/build.ts
@@ -40,6 +40,7 @@ type EventBuildOptimized = { ssrPageCount: number hasDunderPages: boolean hasTestPages: boolean + hasStatic404: boolean } export function eventBuildOptimize(
true
Other
vercel
next.js
ec39aa46dc40e4b2a86e6500fdf5b48d30c1fa0d.json
Update optimize event with static 404 status (#10420) Co-authored-by: Joe Haddad <timer150@gmail.com>
test/integration/telemetry/test/index.test.js
@@ -8,6 +8,7 @@ import { findPort, killApp, waitFor, + nextBuild, } from 'next-test-utils' jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 2 @@ -117,6 +118,16 @@ describe('Telemetry CLI', () => { expect(event2).toMatch(/hasTestPages.*?true/) }) + it('detect static 404 correctly for `next build`'...
true
Other
vercel
next.js
3e81acee56aa7e94763d8eb1cff003a84693d91c.json
Improve prettier ignore (#8753)
.prettierignore
@@ -1 +1,4 @@ node_modules +**/.next/** +**/_next/** +**/dist/**
false
Other
vercel
next.js
ed5dc2107fd6caa966619872ebf58d7a85b179c4.json
Add autoExport to __NEXT_DATA__ (#8746) * Add autoExport to __NEXT_DATA__ * Update render variable
packages/next/next-server/lib/utils.ts
@@ -65,6 +65,7 @@ export type NEXT_DATA = { assetPrefix?: string runtimeConfig?: { [key: string]: any } nextExport?: boolean + autoExport?: boolean skeleton?: boolean dynamicIds?: string[] err?: Error & { statusCode?: number }
true
Other
vercel
next.js
ed5dc2107fd6caa966619872ebf58d7a85b179c4.json
Add autoExport to __NEXT_DATA__ (#8746) * Add autoExport to __NEXT_DATA__ * Update render variable
packages/next/next-server/server/render.tsx
@@ -131,6 +131,7 @@ type RenderOpts = { dangerousAsPath: string assetPrefix?: string err?: Error | null + autoExport?: boolean nextExport?: boolean skeleton?: boolean dev?: boolean @@ -163,6 +164,7 @@ function renderDocument( assetPrefix, runtimeConfig, nextExport, + autoExport, ...
true
Other
vercel
next.js
ed5dc2107fd6caa966619872ebf58d7a85b179c4.json
Add autoExport to __NEXT_DATA__ (#8746) * Add autoExport to __NEXT_DATA__ * Update render variable
test/integration/production/test/index.test.js
@@ -427,6 +427,24 @@ describe('Production Usage', () => { expect(script).not.toMatch(/runtimeConfig/) }) + it('should add autoExport for auto pre-rendered pages', async () => { + for (const page of ['/', '/about']) { + const html = await renderViaHTTP(appPort, page) + const $ = cheer...
true
Other
vercel
next.js
ed5dc2107fd6caa966619872ebf58d7a85b179c4.json
Add autoExport to __NEXT_DATA__ (#8746) * Add autoExport to __NEXT_DATA__ * Update render variable
test/integration/serverless/test/index.test.js
@@ -2,6 +2,7 @@ /* global jasmine */ import webdriver from 'next-webdriver' import { join } from 'path' +import cheerio from 'cheerio' import { existsSync, readdirSync, readFileSync } from 'fs' import { killApp, @@ -34,6 +35,24 @@ describe('Serverless', () => { expect(html).toMatch(/Hello World/) }) +...
true
Other
vercel
next.js
cbd427bf3cc58cce957f3fc112e0080dca87a29f.json
Document the intended behavior of our externals (#8741) This fully annotates our externals code to explain how it should be functioning. This will be useful as tests cases are made to ensure this is working correctly.
packages/next/build/webpack-config.ts
@@ -314,10 +314,17 @@ export default async function getBaseWebpackConfig( return callback() } + // Resolve the import with the webpack provided context, this + // ensures we're resolving the correct version when multiple + // exist. let res ...
false
Other
vercel
next.js
fb834627137a58123dd2435a93289a3d221eaaf4.json
Externalize experimental package (#8731) * Add missing dependency * Ignore prepass for Next.js internal * Revert "Add missing dependency" This reverts commit 9ef0030b56255577364ff7cab46f513216a290ae.
packages/next/build/webpack-config.ts
@@ -318,6 +318,17 @@ export default async function getBaseWebpackConfig( try { res = resolveRequest(request, context) } catch (err) { + if ( + request === 'react-ssr-prepass' && + !config.experimental.ampBindInitData + ) { ...
false
Other
vercel
next.js
98f368f545617b3d15c39d30d9c4549ea3656dba.json
Add missing Link import to routing doc (#8728)
packages/next/README.md
@@ -555,6 +555,8 @@ export default Home ```jsx // pages/about.js +import Link from 'next/link' + function About() { return ( <>
false
Other
vercel
next.js
eb8c11bbdafdecaef9cf952cfbc422b5ff3a96ef.json
Organize webpack configuration imports (#8711) This PR simply organizes the webpack config imports.
packages/next/build/webpack-config.ts
@@ -1,17 +1,9 @@ +import crypto from 'crypto' import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin' -import { - CLIENT_STATIC_FILES_RUNTIME_MAIN, - CLIENT_STATIC_FILES_RUNTIME_WEBPACK, - REACT_LOADABLE_MANIFEST, - SERVER_DIRECTORY, - SERVERLESS_DIRECTORY, -} from '../next-server/lib/constants' -...
false
Other
vercel
next.js
55369051f5a7012c61bed1b7454d694981deea21.json
Warn build on duplicate pages (#8646) * Fail build on duplicate pages This will fail the `next build` command when a duplicate page is found. In development, we'll emit a warning instead of crashing the dev server. * Add test for warning in development * Only issue a warning * Fix production test * Fix development...
packages/next/build/entries.ts
@@ -1,8 +1,10 @@ -import { isTargetLikeServerless } from '../next-server/server/config' +import chalk from 'chalk' import { join } from 'path' import { stringify } from 'querystring' import { API_ROUTE, DOT_NEXT_ALIAS, PAGES_DIR_ALIAS } from '../lib/constants' +import { isTargetLikeServerless } from '../next-serve...
true
Other
vercel
next.js
55369051f5a7012c61bed1b7454d694981deea21.json
Warn build on duplicate pages (#8646) * Fail build on duplicate pages This will fail the `next build` command when a duplicate page is found. In development, we'll emit a warning instead of crashing the dev server. * Add test for warning in development * Only issue a warning * Fix production test * Fix development...
packages/next/build/index.ts
@@ -94,11 +94,9 @@ export default async function build(dir: string, conf = null): Promise<void> { // needed for static exporting since we want to replace with HTML // files - const allPagePaths = [...pagePaths] const allStaticPages = new Set<string>() let allPageInfos = new Map<string, PageInfo>() - c...
true
Other
vercel
next.js
55369051f5a7012c61bed1b7454d694981deea21.json
Warn build on duplicate pages (#8646) * Fail build on duplicate pages This will fail the `next build` command when a duplicate page is found. In development, we'll emit a warning instead of crashing the dev server. * Add test for warning in development * Only issue a warning * Fix production test * Fix development...
packages/next/server/lib/find-page-file.ts
@@ -1,17 +1,21 @@ import { join } from 'path' +import chalk from 'chalk' import { isWriteable } from '../../build/is-writeable' +import { warn } from '../../build/output/log' export async function findPageFile( rootDir: string, normalizedPagePath: string, pageExtensions: string[] ): Promise<string | null...
true
Other
vercel
next.js
55369051f5a7012c61bed1b7454d694981deea21.json
Warn build on duplicate pages (#8646) * Fail build on duplicate pages This will fail the `next build` command when a duplicate page is found. In development, we'll emit a warning instead of crashing the dev server. * Add test for warning in development * Only issue a warning * Fix production test * Fix development...
test/integration/duplicate-pages/pages/hello.js
@@ -0,0 +1,5 @@ +export default () => ( + <> + <h3>Hi 👋</h3> + </> +)
true
Other
vercel
next.js
55369051f5a7012c61bed1b7454d694981deea21.json
Warn build on duplicate pages (#8646) * Fail build on duplicate pages This will fail the `next build` command when a duplicate page is found. In development, we'll emit a warning instead of crashing the dev server. * Add test for warning in development * Only issue a warning * Fix production test * Fix development...
test/integration/duplicate-pages/pages/hello/index.js
@@ -0,0 +1,5 @@ +export default () => ( + <> + <h3>Hi 👋... again</h3> + </> +)
true
Other
vercel
next.js
55369051f5a7012c61bed1b7454d694981deea21.json
Warn build on duplicate pages (#8646) * Fail build on duplicate pages This will fail the `next build` command when a duplicate page is found. In development, we'll emit a warning instead of crashing the dev server. * Add test for warning in development * Only issue a warning * Fix production test * Fix development...
test/integration/duplicate-pages/test/index.test.js
@@ -0,0 +1,42 @@ +/* eslint-env jest */ +/* global jasmine */ +import path from 'path' + +import { + nextBuild, + findPort, + launchApp, + renderViaHTTP, + killApp, + waitFor +} from 'next-test-utils' + +jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 1 +const appDir = path.join(__dirname, '..') + +describe('Handl...
true
Other
vercel
next.js
e5aa9614e1698b0a382728489f9ba40f519447cf.json
Lock CircleCi image for now (#8706) * use legacy image for now * Use image hash * Update config
.circleci/config.yml
@@ -23,7 +23,7 @@ aliases: executors: node: docker: - - image: circleci/node:8-browsers + - image: circleci/node@sha256:8631b3dc0f49fc179940bbd4254ced0c41b99d02bfdbf1d8bdd4d0b135e3ee5f working_directory: ~/repo #########################
false
Other
vercel
next.js
53f4f82e4c69fc9fcdd98d9c952ab0ff97665fa7.json
Catch all requests in custom server (#8704) Some users aren't aware they need to edit their custom server to support various HTTP Methods (e.g. POST for API Routes). Instead, we should just handle all HTTP Methods out-of-the-box. --- Closes #8237
examples/custom-server-express/server.js
@@ -21,7 +21,7 @@ app.prepare().then(() => { return app.render(req, res, '/posts', { id: req.params.id }) }) - server.get('*', (req, res) => { + server.all('*', (req, res) => { return handle(req, res) })
true
Other
vercel
next.js
53f4f82e4c69fc9fcdd98d9c952ab0ff97665fa7.json
Catch all requests in custom server (#8704) Some users aren't aware they need to edit their custom server to support various HTTP Methods (e.g. POST for API Routes). Instead, we should just handle all HTTP Methods out-of-the-box. --- Closes #8237
examples/custom-server-fastify/server.js
@@ -29,7 +29,7 @@ fastify.register((fastify, opts, next) => { }) }) - fastify.get('/*', (req, reply) => { + fastify.all('/*', (req, reply) => { return app.handleRequest(req.req, reply.res).then(() => { reply.sent = true })
true
Other
vercel
next.js
53f4f82e4c69fc9fcdd98d9c952ab0ff97665fa7.json
Catch all requests in custom server (#8704) Some users aren't aware they need to edit their custom server to support various HTTP Methods (e.g. POST for API Routes). Instead, we should just handle all HTTP Methods out-of-the-box. --- Closes #8237
examples/custom-server-hapi/server.js
@@ -39,7 +39,7 @@ app.prepare().then(async () => { }) server.route({ - method: 'GET', + method: '*', path: '/{p*}' /* catch all route */, handler: defaultHandlerWrapper(app) })
true
Other
vercel
next.js
53f4f82e4c69fc9fcdd98d9c952ab0ff97665fa7.json
Catch all requests in custom server (#8704) Some users aren't aware they need to edit their custom server to support various HTTP Methods (e.g. POST for API Routes). Instead, we should just handle all HTTP Methods out-of-the-box. --- Closes #8237
examples/custom-server-koa/server.js
@@ -21,7 +21,7 @@ app.prepare().then(() => { ctx.respond = false }) - router.get('*', async ctx => { + router.all('*', async ctx => { await handle(ctx.req, ctx.res) ctx.respond = false })
true