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
9c4eefcdbf4058b65c8b88fe98387166acad127b.json
Add prettier for examples directory (#5909) * Add prettier for examples directory * Fix files * Fix linting * Add prettier script in case it has to be ran again
examples/with-redux-saga/components/clock.js
@@ -9,15 +9,15 @@ const format = t => { return `${pad(hours)}:${pad(minutes)}:${pad(seconds)}` } -function Clock ({lastUpdate, light}) { +function Clock ({ lastUpdate, light }) { return ( <div className={light ? 'light' : ''}> {format(new Date(lastUpdate))} <style jsx>{` div { ...
true
Other
vercel
next.js
9c4eefcdbf4058b65c8b88fe98387166acad127b.json
Add prettier for examples directory (#5909) * Add prettier for examples directory * Fix files * Fix linting * Add prettier script in case it has to be ran again
examples/with-redux-saga/components/counter.js
@@ -1,7 +1,7 @@ -import React, {Component} from 'react' -import {connect} from 'react-redux' +import React, { Component } from 'react' +import { connect } from 'react-redux' -import {increment, decrement, reset} from '../actions' +import { increment, decrement, reset } from '../actions' class Counter extends Compo...
true
Other
vercel
next.js
9c4eefcdbf4058b65c8b88fe98387166acad127b.json
Add prettier for examples directory (#5909) * Add prettier for examples directory * Fix files * Fix linting * Add prettier script in case it has to be ran again
examples/with-redux-saga/components/page.js
@@ -1,32 +1,34 @@ import Link from 'next/link' -import {connect} from 'react-redux' +import { connect } from 'react-redux' import Counter from './counter' import Clock from './clock' -function Page ({error, lastUpdate, light, linkTo, NavigateTo, placeholderData, title}) { +function Page ({ + error, + lastUpdat...
true
Other
vercel
next.js
9c4eefcdbf4058b65c8b88fe98387166acad127b.json
Add prettier for examples directory (#5909) * Add prettier for examples directory * Fix files * Fix linting * Add prettier script in case it has to be ran again
examples/with-redux-saga/pages/index.js
@@ -1,7 +1,7 @@ import React from 'react' -import {connect} from 'react-redux' +import { connect } from 'react-redux' -import {loadData, startClock, tickClock} from '../actions' +import { loadData, startClock, tickClock } from '../actions' import Page from '../components/page' class Index extends React.Component...
true
Other
vercel
next.js
b91a96018277ed5f8c423abd814a34e2213ca107.json
Improve dev experience by listening faster (#5902) As I detailed in [this thread on Spectrum](https://spectrum.chat/?t=3df7b1fb-7331-4ca4-af35-d9a8b1cacb2c), the dev experience would be a lot nicer if the server started listening as soon as possible, before the slow initialization steps. That way, instead of manually ...
packages/next/bin/next-dev.ts
@@ -55,8 +55,9 @@ if (!existsSync(join(dir, 'pages'))) { const port = args['--port'] || 3000 startServer({dir, dev: true}, port, args['--hostname']) - .then(async () => { + .then(async (app) => { console.log(`> Ready on http://${args['--hostname'] || 'localhost'}:${port}`) + await app.prepare() }) ....
true
Other
vercel
next.js
b91a96018277ed5f8c423abd814a34e2213ca107.json
Improve dev experience by listening faster (#5902) As I detailed in [this thread on Spectrum](https://spectrum.chat/?t=3df7b1fb-7331-4ca4-af35-d9a8b1cacb2c), the dev experience would be a lot nicer if the server started listening as soon as possible, before the slow initialization steps. That way, instead of manually ...
packages/next/bin/next-start.ts
@@ -41,8 +41,9 @@ if (args['--help']) { const dir = resolve(args._[0] || '.') const port = args['--port'] || 3000 startServer({dir}, port, args['--hostname']) - .then(() => { + .then(async (app) => { console.log(`> Ready on http://${args['--hostname']}:${port}`) + await app.prepare() }) .catch((err) ...
true
Other
vercel
next.js
b91a96018277ed5f8c423abd814a34e2213ca107.json
Improve dev experience by listening faster (#5902) As I detailed in [this thread on Spectrum](https://spectrum.chat/?t=3df7b1fb-7331-4ca4-af35-d9a8b1cacb2c), the dev experience would be a lot nicer if the server started listening as soon as possible, before the slow initialization steps. That way, instead of manually ...
packages/next/server/lib/start-server.js
@@ -3,12 +3,14 @@ import next from '../next' export default async function start (serverOptions, port, hostname) { const app = next(serverOptions) - await app.prepare() const srv = http.createServer(app.getRequestHandler()) await new Promise((resolve, reject) => { // This code catches EADDRINUSE error...
true
Other
vercel
next.js
b91a96018277ed5f8c423abd814a34e2213ca107.json
Improve dev experience by listening faster (#5902) As I detailed in [this thread on Spectrum](https://spectrum.chat/?t=3df7b1fb-7331-4ca4-af35-d9a8b1cacb2c), the dev experience would be a lot nicer if the server started listening as soon as possible, before the slow initialization steps. That way, instead of manually ...
packages/next/server/next-dev-server.js
@@ -7,8 +7,10 @@ import {PHASE_DEVELOPMENT_SERVER} from 'next-server/constants' export default class DevServer extends Server { constructor (options) { super(options) - this.hotReloader = new HotReloader(this.dir, { config: this.nextConfig, buildId: this.buildId }) this.renderOpts.dev = true + this....
true
Other
vercel
next.js
b5b0c743b36c1ea7703d8ad2ac5e6293f8e65f0e.json
Add ws dependency
packages/next/package.json
@@ -87,7 +87,8 @@ "webpack-dev-middleware": "3.4.0", "webpack-hot-middleware": "2.22.3", "webpack-sources": "1.2.0", - "webpackbar": "2.6.3" + "webpackbar": "2.6.3", + "ws": "6.1.2" }, "peerDependencies": { "react": "^16.0.0",
true
Other
vercel
next.js
b5b0c743b36c1ea7703d8ad2ac5e6293f8e65f0e.json
Add ws dependency
yarn.lock
@@ -11555,20 +11555,20 @@ write@^0.2.1: dependencies: mkdirp "^0.5.1" +ws@6.1.2, ws@^6.0.0: + version "6.1.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-6.1.2.tgz#3cc7462e98792f0ac679424148903ded3b9c3ad8" + integrity sha512-rfUqzvz0WxmSXtJpPMX2EeASXabOrSMk1ruMOV3JBTBjo4ac2lDjGGsbQSyxj8Odhw5fBib8ZKEjD...
true
Other
vercel
next.js
af07611a632311eeeac3360bfef6190ef2ddb72f.json
Implement websockets based on-demand-entries ping (#4508) Fixes #4495 Here's my approach for replacing the XHR on-demand-entries pinger #1364 #4495. I'm not sure if this is the way everyone wants to accomplish this since I saw mention of using a separate server and port for the dynamic entries websocket, but though...
packages/next/client/on-demand-entries-client.js
@@ -1,32 +1,58 @@ -/* global location */ +/* global location, WebSocket */ import Router from 'next/router' import fetch from 'unfetch' -export default ({assetPrefix}) => { +const { hostname } = location +const retryTime = 5000 +let ws = null +let lastHref = null + +export default async ({ assetPrefix }) => { ...
true
Other
vercel
next.js
af07611a632311eeeac3360bfef6190ef2ddb72f.json
Implement websockets based on-demand-entries ping (#4508) Fixes #4495 Here's my approach for replacing the XHR on-demand-entries pinger #1364 #4495. I'm not sure if this is the way everyone wants to accomplish this since I saw mention of using a separate server and port for the dynamic entries websocket, but though...
packages/next/server/hot-reloader.js
@@ -5,6 +5,7 @@ import errorOverlayMiddleware from './lib/error-overlay-middleware' import del from 'del' import onDemandEntryHandler, {normalizePage} from './on-demand-entry-handler' import webpack from 'webpack' +import WebSocket from 'ws' import getBaseWebpackConfig from '../build/webpack-config' import {IS_BUN...
true
Other
vercel
next.js
af07611a632311eeeac3360bfef6190ef2ddb72f.json
Implement websockets based on-demand-entries ping (#4508) Fixes #4495 Here's my approach for replacing the XHR on-demand-entries pinger #1364 #4495. I'm not sure if this is the way everyone wants to accomplish this since I saw mention of using a separate server and port for the dynamic entries websocket, but though...
packages/next/server/on-demand-entry-handler.js
@@ -1,7 +1,6 @@ import DynamicEntryPlugin from 'webpack/lib/DynamicEntryPlugin' import { EventEmitter } from 'events' import { join } from 'path' -import { parse } from 'url' import fs from 'fs' import promisify from '../lib/promisify' import globModule from 'glob' @@ -34,7 +33,8 @@ export default function onDema...
true
Other
vercel
next.js
af07611a632311eeeac3360bfef6190ef2ddb72f.json
Implement websockets based on-demand-entries ping (#4508) Fixes #4495 Here's my approach for replacing the XHR on-demand-entries pinger #1364 #4495. I'm not sure if this is the way everyone wants to accomplish this since I saw mention of using a separate server and port for the dynamic entries websocket, but though...
test/integration/ondemand/test/index.test.js
@@ -3,8 +3,10 @@ import { join, resolve } from 'path' import { existsSync } from 'fs' import webdriver from 'next-webdriver' +import WebSocket from 'ws' import { renderViaHTTP, + fetchViaHTTP, findPort, launchApp, killApp, @@ -15,26 +17,48 @@ import { const context = {} +const doPing = path => { +...
true
Other
vercel
next.js
c2a208d1415b28a1a20f0c9f09b43405f5b4ac01.json
Update styletron example (#5879) Missed a fix for the styletron api. Previous config won't work for server rendering.
examples/with-styletron/pages/_document.js
@@ -16,8 +16,8 @@ export default class MyDocument extends Document { {this.props.stylesheets.map((sheet, i) => ( <style className='_styletron_hydrate_' - dangerouslySetInnerHTML={{ __html: sheet.css }} - media={sheet.media || null} + dangerou...
false
Other
vercel
next.js
5e3bf6e537124107034a35c49fceb27415214fec.json
Convert render.js to typescript (#5869) * Convert render.js to typescript * Compile tsx files too * Remove internal renderErrorToHTML function * Interopt component result * requirePage doesn’t need async * Move out enhancing logic into it’s own function * Remove buildManifest from renderPage * Mov...
packages/next-server/lib/loadable-capture.tsx
@@ -23,7 +23,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE import React from 'react' import PropTypes from 'prop-types' -export default class Capture extends React.Component { +type Props = { + report: (moduleName: string) => void +} + +export default class Capture extends React.Component<Pr...
true
Other
vercel
next.js
5e3bf6e537124107034a35c49fceb27415214fec.json
Convert render.js to typescript (#5869) * Convert render.js to typescript * Compile tsx files too * Remove internal renderErrorToHTML function * Interopt component result * requirePage doesn’t need async * Move out enhancing logic into it’s own function * Remove buildManifest from renderPage * Mov...
packages/next-server/lib/loadable.js
@@ -315,4 +315,4 @@ Loadable.preloadReady = (webpackIds) => { }) } -module.exports = Loadable +export default Loadable
true
Other
vercel
next.js
5e3bf6e537124107034a35c49fceb27415214fec.json
Convert render.js to typescript (#5869) * Convert render.js to typescript * Compile tsx files too * Remove internal renderErrorToHTML function * Interopt component result * requirePage doesn’t need async * Move out enhancing logic into it’s own function * Remove buildManifest from renderPage * Mov...
packages/next-server/package.json
@@ -42,6 +42,8 @@ "devDependencies": { "@taskr/clear": "1.1.0", "@taskr/watch": "1.1.0", + "@types/react": "16.7.13", + "@types/react-dom": "16.0.11", "@types/send": "0.14.4", "taskr": "1.1.0", "typescript": "3.1.6"
true
Other
vercel
next.js
5e3bf6e537124107034a35c49fceb27415214fec.json
Convert render.js to typescript (#5869) * Convert render.js to typescript * Compile tsx files too * Remove internal renderErrorToHTML function * Interopt component result * requirePage doesn’t need async * Move out enhancing logic into it’s own function * Remove buildManifest from renderPage * Mov...
packages/next-server/server/get-dynamic-import-bundles.ts
@@ -1,4 +1,4 @@ -type ManifestItem = { +export type ManifestItem = { id: number|string, name: string, file: string,
true
Other
vercel
next.js
5e3bf6e537124107034a35c49fceb27415214fec.json
Convert render.js to typescript (#5869) * Convert render.js to typescript * Compile tsx files too * Remove internal renderErrorToHTML function * Interopt component result * requirePage doesn’t need async * Move out enhancing logic into it’s own function * Remove buildManifest from renderPage * Mov...
packages/next-server/server/next-server.ts
@@ -4,10 +4,7 @@ import { resolve, join, sep } from 'path' import { parse as parseUrl, UrlWithParsedQuery } from 'url' import { parse as parseQs, ParsedUrlQuery } from 'querystring' import fs from 'fs' -import { - renderToHTML, - renderErrorToHTML -} from './render' +import {renderToHTML} from './render' import {...
true
Other
vercel
next.js
5e3bf6e537124107034a35c49fceb27415214fec.json
Convert render.js to typescript (#5869) * Convert render.js to typescript * Compile tsx files too * Remove internal renderErrorToHTML function * Interopt component result * requirePage doesn’t need async * Move out enhancing logic into it’s own function * Remove buildManifest from renderPage * Mov...
packages/next-server/server/render.js
@@ -1,162 +0,0 @@ -import { join } from 'path' -import React from 'react' -import { renderToString, renderToStaticMarkup } from 'react-dom/server' -import {requirePage} from './require' -import Router from '../lib/router/router' -import { loadGetInitialProps, isResSent } from '../lib/utils' -import Head, { defaultHead ...
true
Other
vercel
next.js
5e3bf6e537124107034a35c49fceb27415214fec.json
Convert render.js to typescript (#5869) * Convert render.js to typescript * Compile tsx files too * Remove internal renderErrorToHTML function * Interopt component result * requirePage doesn’t need async * Move out enhancing logic into it’s own function * Remove buildManifest from renderPage * Mov...
packages/next-server/server/render.tsx
@@ -0,0 +1,208 @@ +import {IncomingMessage, ServerResponse} from 'http' +import { ParsedUrlQuery } from 'querystring' +import { join } from 'path' +import React from 'react' +import { renderToString, renderToStaticMarkup } from 'react-dom/server' +import {requirePage} from './require' +import Router from '../lib/router...
true
Other
vercel
next.js
5e3bf6e537124107034a35c49fceb27415214fec.json
Convert render.js to typescript (#5869) * Convert render.js to typescript * Compile tsx files too * Remove internal renderErrorToHTML function * Interopt component result * requirePage doesn’t need async * Move out enhancing logic into it’s own function * Remove buildManifest from renderPage * Mov...
packages/next-server/server/require.ts
@@ -45,7 +45,7 @@ export function getPagePath (page: string, distDir: string): string { return join(serverBuildPath, pagesManifest[page]) } -export async function requirePage (page: string, distDir: string): Promise<any> { +export function requirePage (page: string, distDir: string): any { const pagePath = get...
true
Other
vercel
next.js
5e3bf6e537124107034a35c49fceb27415214fec.json
Convert render.js to typescript (#5869) * Convert render.js to typescript * Compile tsx files too * Remove internal renderErrorToHTML function * Interopt component result * requirePage doesn’t need async * Move out enhancing logic into it’s own function * Remove buildManifest from renderPage * Mov...
packages/next-server/taskfile.js
@@ -1,12 +1,12 @@ const notifier = require('node-notifier') export async function lib (task, opts) { - await task.source(opts.src || 'lib/**/*.+(js|ts)').typescript({module: 'commonjs'}).target('dist/lib') + await task.source(opts.src || 'lib/**/*.+(js|ts|tsx)').typescript({module: 'commonjs'}).target('dist/lib')...
true
Other
vercel
next.js
5e3bf6e537124107034a35c49fceb27415214fec.json
Convert render.js to typescript (#5869) * Convert render.js to typescript * Compile tsx files too * Remove internal renderErrorToHTML function * Interopt component result * requirePage doesn’t need async * Move out enhancing logic into it’s own function * Remove buildManifest from renderPage * Mov...
packages/next/pages/_document.js
@@ -14,9 +14,9 @@ export default class Document extends Component { } static getInitialProps ({ renderPage }) { - const { html, head, buildManifest } = renderPage() + const { html, head } = renderPage() const styles = flush() - return { html, head, styles, buildManifest } + return { html, head,...
true
Other
vercel
next.js
5e3bf6e537124107034a35c49fceb27415214fec.json
Convert render.js to typescript (#5869) * Convert render.js to typescript * Compile tsx files too * Remove internal renderErrorToHTML function * Interopt component result * requirePage doesn’t need async * Move out enhancing logic into it’s own function * Remove buildManifest from renderPage * Mov...
packages/next/server/error-debug.js
@@ -5,13 +5,12 @@ import Head from 'next-server/head' // This component is rendered through dev-error-overlay on the client side. // On the server side it's rendered directly export default function ErrorDebug ({error, info}) { - const { name, message, module } = error + const { name, message } = error return (...
true
Other
vercel
next.js
5e3bf6e537124107034a35c49fceb27415214fec.json
Convert render.js to typescript (#5869) * Convert render.js to typescript * Compile tsx files too * Remove internal renderErrorToHTML function * Interopt component result * requirePage doesn’t need async * Move out enhancing logic into it’s own function * Remove buildManifest from renderPage * Mov...
packages/next/taskfile.js
@@ -10,33 +10,33 @@ export async function bin (task, opts) { } export async function lib (task, opts) { - await task.source(opts.src || 'lib/**/*.+(js|ts)').typescript({module: 'commonjs'}).target('dist/lib') + await task.source(opts.src || 'lib/**/*.+(js|ts|tsx)').typescript({module: 'commonjs'}).target('dist/li...
true
Other
vercel
next.js
d58cecc92a5015b1bbb035fc5493b3cb7835d2a5.json
Upgrade React from 16.4.2 to 16.6.3 (#5861) * Upgrade React version * Update size-limit test to account for React change
package.json
@@ -68,8 +68,8 @@ "node-notifier": "5.1.2", "node-sass": "4.9.2", "pre-commit": "1.2.2", - "react": "16.4.2", - "react-dom": "16.4.2", + "react": "16.6.3", + "react-dom": "16.6.3", "rimraf": "2.6.2", "standard": "11.0.1", "taskr": "1.1.0",
true
Other
vercel
next.js
d58cecc92a5015b1bbb035fc5493b3cb7835d2a5.json
Upgrade React from 16.4.2 to 16.6.3 (#5861) * Upgrade React version * Update size-limit test to account for React change
test/integration/size-limit/test/index.test.js
@@ -66,6 +66,6 @@ describe('Production response size', () => { console.log(`Response Sizes:\n${responseSizes.map(obj => ` ${obj.url}: ${obj.bytes} (bytes)`).join('\n')} \nOverall: ${responseSizeKilobytes} KB`) // These numbers are without gzip compression! - expect(responseSizeKilobytes).toBeLessThanOrEq...
true
Other
vercel
next.js
5708e99ecaba8907642e371efb2d431a982b7242.json
Run compilers sequentially when in lambdas mode (#5862)
packages/next/build/compiler.ts
@@ -1,6 +1,6 @@ import webpack from 'webpack' -type CompilerResult = { +export type CompilerResult = { errors: Error[], warnings: Error[] }
true
Other
vercel
next.js
5708e99ecaba8907642e371efb2d431a982b7242.json
Run compilers sequentially when in lambdas mode (#5862)
packages/next/build/index.ts
@@ -6,7 +6,7 @@ import getBaseWebpackConfig from './webpack-config' import {generateBuildId} from './generate-build-id' import {writeBuildId} from './write-build-id' import {isWriteable} from './is-writeable' -import {runCompiler} from './compiler' +import {runCompiler, CompilerResult} from './compiler' export de...
true
Other
vercel
next.js
93424b64a972a0db82b89cdfe99d2242fa827984.json
Use correct default for query (#5851)
packages/next-server/server/next-server.ts
@@ -205,7 +205,7 @@ export default class Server { return sendHTML(req, res, html, {generateEtags}) } - public async render (req: IncomingMessage, res: ServerResponse, pathname: string, query: ParsedUrlQuery, parsedUrl: UrlWithParsedQuery): Promise<void> { + public async render (req: IncomingMessage, res: Se...
true
Other
vercel
next.js
93424b64a972a0db82b89cdfe99d2242fa827984.json
Use correct default for query (#5851)
test/integration/custom-server/pages/no-query.js
@@ -0,0 +1 @@ +export default () => 'test'
true
Other
vercel
next.js
93424b64a972a0db82b89cdfe99d2242fa827984.json
Use correct default for query (#5851)
test/integration/custom-server/server.js
@@ -10,6 +10,10 @@ const handleNextRequests = app.getRequestHandler() app.prepare().then(() => { const server = new http.Server((req, res) => { + if (req.url === '/no-query') { + return app.render(req, res, '/no-query') + } + if (/setAssetPrefix/.test(req.url)) { app.setAssetPrefix(`http://...
true
Other
vercel
next.js
93424b64a972a0db82b89cdfe99d2242fa827984.json
Use correct default for query (#5851)
test/integration/custom-server/test/index.test.js
@@ -37,6 +37,10 @@ describe('Custom Server', () => { beforeAll(() => startServer()) afterAll(() => killApp(server)) + it('should handle render with undefined query', async () => { + expect(await renderViaHTTP(appPort, '/no-query')).toMatch(/"query":/) + }) + it('should set the assetPrefix dy...
true
Other
vercel
next.js
9ddc1d7b6f19499512ea87c3479b746740bd6ce8.json
update styletron example (#5573)
examples/with-styletron/layout.js
@@ -1,8 +0,0 @@ -import { StyletronProvider } from 'styletron-react' -import getStyletron from './styletron' - -export default ({ children }) => ( - <StyletronProvider styletron={getStyletron()}> - {children} - </StyletronProvider> -)
true
Other
vercel
next.js
9ddc1d7b6f19499512ea87c3479b746740bd6ce8.json
update styletron example (#5573)
examples/with-styletron/package.json
@@ -10,8 +10,8 @@ "next": "latest", "react": "^16.0.0", "react-dom": "^16.0.0", - "styletron-client": "^2.2.0", - "styletron-react": "^2.2.1", - "styletron-server": "^2.2.0" + "styletron": "^3.0.4", + "styletron-engine-atomic": "^1.0.8", + "styletron-react": "^4.3.5" } }
true
Other
vercel
next.js
9ddc1d7b6f19499512ea87c3479b746740bd6ce8.json
update styletron example (#5573)
examples/with-styletron/pages/_app.js
@@ -0,0 +1,19 @@ +import App, { Container } from 'next/app' +import React from 'react' +import { Provider as StyletronProvider } from 'styletron-react' +import getStyletron from '../styletron' + +class MyApp extends App { + render () { + const { Component } = this.props + return ( + <Container> + <St...
true
Other
vercel
next.js
9ddc1d7b6f19499512ea87c3479b746740bd6ce8.json
update styletron example (#5573)
examples/with-styletron/pages/_document.js
@@ -17,7 +17,7 @@ export default class MyDocument extends Document { <style className='_styletron_hydrate_' dangerouslySetInnerHTML={{ __html: sheet.css }} - media={sheet.media || ''} + media={sheet.media || null} key={i} /...
true
Other
vercel
next.js
9ddc1d7b6f19499512ea87c3479b746740bd6ce8.json
update styletron example (#5573)
examples/with-styletron/pages/index.js
@@ -1,13 +1,12 @@ import { styled } from 'styletron-react' -import Page from '../layout' const Title = styled('div', { color: 'red', fontSize: '50px' }) export default () => ( - <Page> + <div> <Title>My page</Title> - </Page> + </div> )
true
Other
vercel
next.js
9ddc1d7b6f19499512ea87c3479b746740bd6ce8.json
update styletron example (#5573)
examples/with-styletron/styletron.js
@@ -1,18 +1,16 @@ - const isServer = typeof window === 'undefined' let styletron export default function getStyletron () { - if (isServer) { - const Styletron = require('styletron-server') + if (isServer && !styletron) { + const Styletron = require('styletron-engine-atomic').Server styletron = new S...
true
Other
vercel
next.js
27c0b199d005fc44cda54b1af7412228192871fd.json
Fix paths when built on windows (#5795) This PR Fixes #4920 So the problem is that when a next.js application is built on windows, the `pages-manifest.json` file is created with backslashes. If this built application is deployed to a linux hosting enviroment, the server will fail when trying to load the modules. ```...
packages/next/build/webpack/plugins/pages-manifest-plugin.js
@@ -23,7 +23,8 @@ export default class PagesManifestPlugin { } const {name} = entry - pages[`/${pagePath.replace(/\\/g, '/')}`] = name + // Write filename, replace any backslashes in path (on windows) with forwardslashes for cross-platform consistency. + pages[`/${pagePath.repla...
true
Other
vercel
next.js
27c0b199d005fc44cda54b1af7412228192871fd.json
Fix paths when built on windows (#5795) This PR Fixes #4920 So the problem is that when a next.js application is built on windows, the `pages-manifest.json` file is created with backslashes. If this built application is deployed to a linux hosting enviroment, the server will fail when trying to load the modules. ```...
test/integration/production/test/index.test.js
@@ -16,7 +16,7 @@ import fetch from 'node-fetch' import dynamicImportTests from './dynamic' import processEnv from './process-env' import security from './security' -import {BUILD_MANIFEST, REACT_LOADABLE_MANIFEST} from 'next-server/constants' +import {BUILD_MANIFEST, REACT_LOADABLE_MANIFEST, PAGES_MANIFEST} from 'n...
true
Other
vercel
next.js
c867b0ce9ce4a42896b6362c6ec43630e398de0a.json
Fix paths when built on windows (#5795) This PR Fixes #4920 So the problem is that when a next.js application is built on windows, the `pages-manifest.json` file is created with backslashes. If this built application is deployed to a linux hosting enviroment, the server will fail when trying to load the modules. ...
build/webpack/plugins/pages-manifest-plugin.js
@@ -24,7 +24,8 @@ export default class PagesManifestPlugin { } const {name} = entry - pages[`/${pagePath.replace(/\\/g, '/')}`] = name + // Write filename, replace any backslashes in path (on windows) with forwardslashes for cross-platform consistency. + pages[`/${pagePath.repla...
true
Other
vercel
next.js
c867b0ce9ce4a42896b6362c6ec43630e398de0a.json
Fix paths when built on windows (#5795) This PR Fixes #4920 So the problem is that when a next.js application is built on windows, the `pages-manifest.json` file is created with backslashes. If this built application is deployed to a linux hosting enviroment, the server will fail when trying to load the modules. ...
test/integration/production/test/index.test.js
@@ -16,7 +16,7 @@ import fetch from 'node-fetch' import dynamicImportTests from './dynamic' import processEnv from './process-env' import security from './security' -import {BUILD_MANIFEST, REACT_LOADABLE_MANIFEST} from 'next/constants' +import {BUILD_MANIFEST, REACT_LOADABLE_MANIFEST, PAGES_MANIFEST} from 'next/con...
true
Other
vercel
next.js
8b6173917ab47ce73adc669531223541711913d7.json
Convert next-server.js to typescript (#5844)
package.json
@@ -28,6 +28,7 @@ "standard": { "parser": "babel-eslint", "ignore": [ + "packages/next-server/server/next-server.ts", "**/*.d.ts", "**/node_modules/**", "examples/with-ioc/**",
true
Other
vercel
next.js
8b6173917ab47ce73adc669531223541711913d7.json
Convert next-server.js to typescript (#5844)
packages/next-server/server/next-server.ts
@@ -1,24 +1,48 @@ -/* eslint-disable import/first, no-return-await */ +/* eslint-disable import/first */ +import {IncomingMessage, ServerResponse} from 'http' import { resolve, join, sep } from 'path' -import { parse as parseUrl } from 'url' -import { parse as parseQs } from 'querystring' +import { parse as parseUrl, ...
true
Other
vercel
next.js
8b6173917ab47ce73adc669531223541711913d7.json
Convert next-server.js to typescript (#5844)
packages/next-server/server/render.js
@@ -64,7 +64,7 @@ async function doRender (req, res, pathname, query, { ] // the response might be finshed on the getinitialprops call - if (isResSent(res)) return + if (isResSent(res)) return null let reactLoadableModules = [] const renderPage = (options = Page => Page) => { @@ -114,7 +114,7 @@ async...
true
Other
vercel
next.js
8b6173917ab47ce73adc669531223541711913d7.json
Convert next-server.js to typescript (#5844)
packages/next-server/server/router.js
@@ -1,27 +0,0 @@ -import pathMatch from './lib/path-match' - -export const route = pathMatch() - -export default class Router { - constructor (routes = []) { - this.routes = routes - } - - add (route) { - this.routes.unshift(route) - } - - match (req, res, parsedUrl) { - if (req.method !== 'GET' && req.me...
true
Other
vercel
next.js
8b6173917ab47ce73adc669531223541711913d7.json
Convert next-server.js to typescript (#5844)
packages/next-server/server/router.ts
@@ -0,0 +1,37 @@ +import {IncomingMessage, ServerResponse} from 'http' +import {UrlWithParsedQuery} from 'url' +import pathMatch from './lib/path-match' + +export const route = pathMatch() + +type Params = {[param: string]: string} + +export type Route = { + match: (pathname: string|undefined) => false|Params, + fn: ...
true
Other
vercel
next.js
8b6173917ab47ce73adc669531223541711913d7.json
Convert next-server.js to typescript (#5844)
packages/next-server/server/send-html.ts
@@ -3,7 +3,7 @@ import generateETag from 'etag' import fresh from 'fresh' import { isResSent } from '../lib/utils' -export function sendHTML (req: IncomingMessage, res: ServerResponse, html: string, { dev, generateEtags }: {dev: boolean, generateEtags: boolean}) { +export function sendHTML (req: IncomingMessage, re...
true
Other
vercel
next.js
8b6173917ab47ce73adc669531223541711913d7.json
Convert next-server.js to typescript (#5844)
packages/next-server/server/utils.ts
@@ -5,7 +5,7 @@ const internalPrefixes = [ /^\/static\// ] -export function isInternalUrl (url) { +export function isInternalUrl (url: string): boolean { for (const prefix of internalPrefixes) { if (prefix.test(url)) { return true @@ -15,6 +15,6 @@ export function isInternalUrl (url) { return fa...
true
Other
vercel
next.js
8b6173917ab47ce73adc669531223541711913d7.json
Convert next-server.js to typescript (#5844)
packages/next/server/next-dev-server.js
@@ -120,6 +120,12 @@ export default class DevServer extends Server { } } + sendHTML (req, res, html) { + // In dev, we should not cache pages for any reason. + res.setHeader('Cache-Control', 'no-store, must-revalidate') + return super.sendHTML(req, res, html) + } + setImmutableAssetCacheControl ...
true
Other
vercel
next.js
61894816ba7ed65f498c373d039beb54164d5374.json
Remove app variable as it’s only used once (#5842) * Remove app variable as it’s only used once * Remove double spread
packages/next-server/server/render.js
@@ -83,14 +83,6 @@ async function doRender (req, res, pathname, query, { } } - const app = <LoadableCapture report={moduleName => reactLoadableModules.push(moduleName)}> - <EnhancedApp {...{ - Component: EnhancedComponent, - router, - ...props - }} /> - </LoadableCaptu...
false
Other
vercel
next.js
0e6d190706678c95bcf7f6556bad5e50ecf4d8e5.json
Move sendHTML and rewrite in ts (#5839) * Move send-html function and rewrite in typescript * Move getPageFiles and convert to ts * Move getPageFiles and convert to ts (#5841) * Move getPageFiles and convert to ts # Conflicts: # packages/next-server/server/render.js * Fix unit tests
packages/next-server/server/next-server.js
@@ -5,9 +5,9 @@ import { parse as parseQs } from 'querystring' import fs from 'fs' import { renderToHTML, - renderErrorToHTML, - sendHTML + renderErrorToHTML } from './render' +import {sendHTML} from './send-html' import {serveStatic} from './serve-static' import Router, {route} from './router' import { isI...
true
Other
vercel
next.js
0e6d190706678c95bcf7f6556bad5e50ecf4d8e5.json
Move sendHTML and rewrite in ts (#5839) * Move send-html function and rewrite in typescript * Move getPageFiles and convert to ts * Move getPageFiles and convert to ts (#5841) * Move getPageFiles and convert to ts # Conflicts: # packages/next-server/server/render.js * Fix unit tests
packages/next-server/server/render.js
@@ -1,8 +1,6 @@ import { join } from 'path' import React from 'react' import { renderToString, renderToStaticMarkup } from 'react-dom/server' -import generateETag from 'etag' -import fresh from 'fresh' import {requirePage} from './require' import Router from '../lib/router/router' import { loadGetInitialProps, is...
true
Other
vercel
next.js
0e6d190706678c95bcf7f6556bad5e50ecf4d8e5.json
Move sendHTML and rewrite in ts (#5839) * Move send-html function and rewrite in typescript * Move getPageFiles and convert to ts * Move getPageFiles and convert to ts (#5841) * Move getPageFiles and convert to ts # Conflicts: # packages/next-server/server/render.js * Fix unit tests
packages/next-server/server/send-html.ts
@@ -0,0 +1,30 @@ +import {IncomingMessage, ServerResponse} from 'http' +import generateETag from 'etag' +import fresh from 'fresh' +import { isResSent } from '../lib/utils' + +export function sendHTML (req: IncomingMessage, res: ServerResponse, html: string, { dev, generateEtags }: {dev: boolean, generateEtags: boolean...
true
Other
vercel
next.js
0e6d190706678c95bcf7f6556bad5e50ecf4d8e5.json
Move sendHTML and rewrite in ts (#5839) * Move send-html function and rewrite in typescript * Move getPageFiles and convert to ts * Move getPageFiles and convert to ts (#5841) * Move getPageFiles and convert to ts # Conflicts: # packages/next-server/server/render.js * Fix unit tests
packages/next/package.json
@@ -101,6 +101,8 @@ "@types/babel__generator": "7.0.1", "@types/babel__template": "7.0.1", "@types/babel__traverse": "7.0.3", + "@types/etag": "1.8.0", + "@types/fresh": "0.5.0", "@types/nanoid": "1.2.0", "@types/node-fetch": "2.1.4", "@types/webpack": "4.4.20",
true
Other
vercel
next.js
8873242b0bc2e34ebea7962ce1f157f1f24c0eb9.json
Move getPageFiles and convert to ts (#5841) * Move getPageFiles and convert to ts # Conflicts: # packages/next-server/server/render.js * Fix unit tests
packages/next-server/package.json
@@ -18,7 +18,8 @@ "scripts": { "build": "taskr", "release": "taskr release", - "prepublish": "npm run release" + "prepublish": "npm run release", + "typescript": "tsc --noEmit" }, "taskr": { "requires": [
true
Other
vercel
next.js
8873242b0bc2e34ebea7962ce1f157f1f24c0eb9.json
Move getPageFiles and convert to ts (#5841) * Move getPageFiles and convert to ts # Conflicts: # packages/next-server/server/render.js * Fix unit tests
packages/next-server/server/get-page-files.ts
@@ -0,0 +1,19 @@ +import {normalizePagePath} from './require' + +type BuildManifest = { + pages: { + [page: string]: string[] + } +} + +export function getPageFiles (buildManifest: BuildManifest, page: string): string[] { + const normalizedPage = normalizePagePath(page) + const files = buildManifest.pages[normal...
true
Other
vercel
next.js
8873242b0bc2e34ebea7962ce1f157f1f24c0eb9.json
Move getPageFiles and convert to ts (#5841) * Move getPageFiles and convert to ts # Conflicts: # packages/next-server/server/render.js * Fix unit tests
packages/next-server/server/render.js
@@ -3,14 +3,15 @@ import React from 'react' import { renderToString, renderToStaticMarkup } from 'react-dom/server' import generateETag from 'etag' import fresh from 'fresh' -import requirePage, {normalizePagePath} from './require' +import {requirePage} from './require' import Router from '../lib/router/router' im...
true
Other
vercel
next.js
8873242b0bc2e34ebea7962ce1f157f1f24c0eb9.json
Move getPageFiles and convert to ts (#5841) * Move getPageFiles and convert to ts # Conflicts: # packages/next-server/server/render.js * Fix unit tests
packages/next-server/server/require.ts
@@ -1,13 +1,13 @@ import {join, posix} from 'path' import {PAGES_MANIFEST, SERVER_DIRECTORY} from 'next-server/constants' -export function pageNotFoundError (page) { - const err = new Error(`Cannot find module for page: ${page}`) +export function pageNotFoundError (page: string): Error { + const err: any = new Er...
true
Other
vercel
next.js
8873242b0bc2e34ebea7962ce1f157f1f24c0eb9.json
Move getPageFiles and convert to ts (#5841) * Move getPageFiles and convert to ts # Conflicts: # packages/next-server/server/render.js * Fix unit tests
test/isolated/require-page.test.js
@@ -2,7 +2,7 @@ import { join } from 'path' import {SERVER_DIRECTORY, CLIENT_STATIC_FILES_PATH} from 'next-server/constants' -import requirePage, {getPagePath, normalizePagePath, pageNotFoundError} from 'next-server/dist/server/require' +import {requirePage, getPagePath, normalizePagePath, pageNotFoundError} from '...
true
Other
vercel
next.js
8ca5749ff98a9cad88467b0d57a117b5c987ceb7.json
Remove unused properties (#5837)
packages/next-server/server/render.js
@@ -16,8 +16,9 @@ export function renderToHTML (req, res, pathname, query, opts) { return doRender(req, res, pathname, query, opts) } -export function renderErrorToHTML (err, req, res, pathname, query, opts = {}) { - return doRender(req, res, pathname, query, { ...opts, err, page: '/_error' }) +// _pathname is f...
false
Other
vercel
next.js
ffe1a12f2ee191db9f6a346399f1dde17c5bc85d.json
Move getDynamicImportBundles into own ts file (#5836)
packages/next-server/server/get-dynamic-import-bundles.ts
@@ -0,0 +1,22 @@ +type ManifestItem = { + id: number|string, + name: string, + file: string, + publicPath: string +} + +type Manifest = {[moduleId: string]: ManifestItem[]} + +type DynamicImportBundles = Set<ManifestItem> + +// Based on https://github.com/jamiebuilds/react-loadable/pull/132 +export function getDyna...
true
Other
vercel
next.js
ffe1a12f2ee191db9f6a346399f1dde17c5bc85d.json
Move getDynamicImportBundles into own ts file (#5836)
packages/next-server/server/render.js
@@ -10,17 +10,7 @@ import Head, { defaultHead } from '../lib/head' import Loadable from '../lib/loadable' import LoadableCapture from '../lib/loadable-capture' import { BUILD_MANIFEST, REACT_LOADABLE_MANIFEST, SERVER_DIRECTORY, CLIENT_STATIC_FILES_PATH } from 'next-server/constants' - -// Based on https://github.com...
true
Other
vercel
next.js
3c62b07593a02b3ea8a05e2203af274ce5f69d6b.json
Move serve-static to typescript (#5833)
packages/next-server/package.json
@@ -41,6 +41,7 @@ "devDependencies": { "@taskr/clear": "1.1.0", "@taskr/watch": "1.1.0", + "@types/send": "0.14.4", "taskr": "1.1.0", "typescript": "3.1.6" },
true
Other
vercel
next.js
3c62b07593a02b3ea8a05e2203af274ce5f69d6b.json
Move serve-static to typescript (#5833)
packages/next-server/server/next-server.js
@@ -6,9 +6,9 @@ import fs from 'fs' import { renderToHTML, renderErrorToHTML, - sendHTML, - serveStatic + sendHTML } from './render' +import {serveStatic} from './serve-static' import Router, {route} from './router' import { isInternalUrl, isBlockedPage } from './utils' import loadConfig from 'next-server...
true
Other
vercel
next.js
3c62b07593a02b3ea8a05e2203af274ce5f69d6b.json
Move serve-static to typescript (#5833)
packages/next-server/server/render.js
@@ -1,7 +1,6 @@ import { join } from 'path' import React from 'react' import { renderToString, renderToStaticMarkup } from 'react-dom/server' -import send from 'send' import generateETag from 'etag' import fresh from 'fresh' import requirePage, {normalizePagePath} from './require' @@ -23,9 +22,6 @@ function getDy...
true
Other
vercel
next.js
3c62b07593a02b3ea8a05e2203af274ce5f69d6b.json
Move serve-static to typescript (#5833)
packages/next-server/server/serve-static.ts
@@ -0,0 +1,20 @@ +import {IncomingMessage, ServerResponse} from 'http' +import send from 'send' + +// since send doesn't support wasm yet +send.mime.define({ 'application/wasm': ['wasm'] }) + +export function serveStatic (req: IncomingMessage, res: ServerResponse, path: string): Promise<void> { + return new Promise((r...
true
Other
vercel
next.js
5d2250ac2744fb59bc5c50dec4fdf1ff68fae6bf.json
Remove unused functions (#5832) Couldn't find a reference to these functions as next-server uses the renderToHTML directly.
packages/next-server/server/render.js
@@ -26,20 +26,10 @@ function getDynamicImportBundles (manifest, moduleIds) { // since send doesn't support wasm yet send.mime.define({ 'application/wasm': ['wasm'] }) -export async function render (req, res, pathname, query, opts) { - const html = await renderToHTML(req, res, pathname, query, opts) - sendHTML(req...
true
Other
vercel
next.js
5d2250ac2744fb59bc5c50dec4fdf1ff68fae6bf.json
Remove unused functions (#5832) Couldn't find a reference to these functions as next-server uses the renderToHTML directly.
packages/next/server/hot-reloader.js
@@ -8,7 +8,21 @@ import webpack from 'webpack' import getBaseWebpackConfig from '../build/webpack-config' import {IS_BUNDLED_PAGE_REGEX, ROUTE_NAME_REGEX, BLOCKED_PAGES, CLIENT_STATIC_FILES_PATH} from 'next-server/constants' import {route} from 'next-server/dist/server/router' -import {renderScriptError} from 'next-...
true
Other
vercel
next.js
9547e77820305ac90a60d652f09ab29af53e11d3.json
use native http instead of micro (#5706)
package.json
@@ -55,7 +55,6 @@ "jest-cli": "23.6.0", "lerna": "^3.4.0", "lint-staged": "4.2.3", - "micro": "9.1.0", "mkdirp": "0.5.1", "node-fetch": "1.7.3", "node-notifier": "5.1.2",
true
Other
vercel
next.js
9547e77820305ac90a60d652f09ab29af53e11d3.json
use native http instead of micro (#5706)
packages/next/README.md
@@ -899,14 +899,14 @@ Here's an example usage of it: ```js const next = require('next') -const micro = require('micro') +const http = require('http') const dev = process.env.NODE_ENV !== 'production' const app = next({ dev }) const handleNextRequests = app.getRequestHandler() app.prepare().then(() => { - c...
true
Other
vercel
next.js
9547e77820305ac90a60d652f09ab29af53e11d3.json
use native http instead of micro (#5706)
test/integration/custom-server/server.js
@@ -1,4 +1,4 @@ -const micro = require('micro') +const http = require('http') const next = require('next') const dev = process.env.NODE_ENV !== 'production' @@ -9,7 +9,7 @@ const app = next({ dev, dir }) const handleNextRequests = app.getRequestHandler() app.prepare().then(() => { - const server = micro((req, ...
true
Other
vercel
next.js
9547e77820305ac90a60d652f09ab29af53e11d3.json
use native http instead of micro (#5706)
test/integration/filesystempublicroutes/server.js
@@ -1,4 +1,4 @@ -const micro = require('micro') +const http = require('http') const next = require('next') const dev = process.env.NODE_ENV !== 'production' @@ -9,7 +9,7 @@ const app = next({ dev, dir }) const handleNextRequests = app.getRequestHandler() app.prepare().then(() => { - const server = micro((req, ...
true
Other
vercel
next.js
0d77dda28c8b0eaed38bb203de737ffc1235d42a.json
Fix typos on next-server.js comments. (#5672)
packages/next-server/server/next-server.js
@@ -120,9 +120,9 @@ export default class Server { } }, { - // It's very important keep this route's param optional. - // (but it should support as many as params, seperated by '/') - // Othewise this will lead to a pretty simple DOS attack. + // It's very important to ...
false
Other
vercel
next.js
79470c76b8500475b9898878347466b5844ce69b.json
Add license to next-server Fixes #5671
packages/next-server/license.md
@@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016-present Zeit, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +t...
true
Other
vercel
next.js
79470c76b8500475b9898878347466b5844ce69b.json
Add license to next-server Fixes #5671
packages/next-server/package.json
@@ -2,6 +2,7 @@ "name": "next-server", "version": "7.0.2-canary.23", "main": "./index.js", + "license": "MIT", "files": [ "dist", "index.js",
true
Other
vercel
next.js
819efed2c00f65295022fc564fd48c1812d764ec.json
Fix incorrect path for ts server example (#5612) The customer-server-typescript example has a bug where the `yarn start` command has the incorrect path to the server entry point file.
examples/custom-server-typescript/package.json
@@ -2,7 +2,7 @@ "scripts": { "dev": "nodemon server/index.ts", "build": "next build && tsc --project tsconfig.server.json", - "start": "NODE_ENV=production node .next/production-server/index.js" + "start": "NODE_ENV=production node .next/production-server/server/index.js" }, "dependencies": { ...
false
Other
vercel
next.js
f01457e8fc10f68eafe1a1e68c3117eccf25df9c.json
Take full advantage of caching between builds (#5597) Takes advantage of caching between builds for Terser, also makes writing caches for babel-loader faster by disabling compression. Results for zeit.co (350 pages): Without cache: [4:16:22 PM] Compiled server in 1m [4:16:57 PM] Compiled client in 2m ✨ Done ...
packages/next/build/webpack.js
@@ -94,11 +94,19 @@ function optimizationConfig ({dir, dev, isServer, totalPages}) { } // Terser is a better uglifier - config.minimizer = [new TerserPlugin({ - parallel: true, - sourceMap: false, - cache: true - })] + config.minimizer = [ + new TerserPlugin({ + parallel: true, + source...
true
Other
vercel
next.js
f01457e8fc10f68eafe1a1e68c3117eccf25df9c.json
Take full advantage of caching between builds (#5597) Takes advantage of caching between builds for Terser, also makes writing caches for babel-loader faster by disabling compression. Results for zeit.co (350 pages): Without cache: [4:16:22 PM] Compiled server in 1m [4:16:57 PM] Compiled client in 2m ✨ Done ...
packages/next/build/webpack/loaders/next-babel-loader.js
@@ -12,6 +12,7 @@ module.exports = babelLoader.custom(babel => { dev: opts.dev } const loader = Object.assign({ + cacheCompression: false, cacheDirectory: true }, opts) delete loader.isServer
true
Other
vercel
next.js
f01457e8fc10f68eafe1a1e68c3117eccf25df9c.json
Take full advantage of caching between builds (#5597) Takes advantage of caching between builds for Terser, also makes writing caches for babel-loader faster by disabling compression. Results for zeit.co (350 pages): Without cache: [4:16:22 PM] Compiled server in 1m [4:16:57 PM] Compiled client in 2m ✨ Done ...
test/integration/size-limit/test/index.test.js
@@ -66,6 +66,6 @@ describe('Production response size', () => { console.log(`Response Sizes:\n${responseSizes.map(obj => ` ${obj.url}: ${obj.bytes} (bytes)`).join('\n')} \nOverall: ${responseSizeKilobytes} KB`) // These numbers are without gzip compression! - expect(responseSizeKilobytes).toBeLessThanOrEq...
true
Other
vercel
next.js
4945740ac79a3d3296e31e59b93717dac02af401.json
Add dir and distDir to resolve log
packages/next/build/webpack.js
@@ -173,7 +173,7 @@ export default async function getBaseWebpackConfig (dir: string, {dev = false, i } } - console.log('RESOLVE_CONFIG', resolveConfig) + console.log('RESOLVE_CONFIG', {dir, distDir}, resolveConfig) const webpackMode = dev ? 'development' : 'production'
false
Other
vercel
next.js
1388c6897ef99b94b313b49bdf901efed84db571.json
Add resolve_config log
packages/next/build/webpack.js
@@ -173,6 +173,8 @@ export default async function getBaseWebpackConfig (dir: string, {dev = false, i } } + console.log('RESOLVE_CONFIG', resolveConfig) + const webpackMode = dev ? 'development' : 'production' let webpackConfig = {
false
Other
vercel
next.js
d5caafb86e0b0dbeea0713d17d1a0b62bd1792e3.json
Log original error
packages/next/build/index.js
@@ -52,18 +52,22 @@ function runCompiler (compiler) { return reject(err) } - const jsonStats = stats.toJson({ warnings: true, errors: true }) + let buildFailed = false + for (const stat of stats.stats) { + for (const error of stat.compilation.errors) { + buildFailed = tr...
false
Other
vercel
next.js
bdd6fba29a66049d5a7793c9cfe122464e18669a.json
Remove yarn prefix in publish command
package.json
@@ -15,7 +15,7 @@ "coveralls": "cat ./test/coverage/lcov.info | coveralls", "lint": "standard", "prepublish": "lerna run prepublish", - "publish-canary": "yarn lerna version prerelease --preid canary --force-publish", + "publish-canary": "lerna version prerelease --preid canary --force-publish", ...
false
Other
vercel
next.js
b04923775b9046e35a5e9c3bc7568ae4ec8182cf.json
Add string-hash to compilation for styled-jsx
packages/next/build/webpack.js
@@ -31,7 +31,7 @@ function externalsConfig (dir, isServer) { return externals } - const notExternalModules = ['next/app', 'next/document', 'next/error', 'http-status'] + const notExternalModules = ['next/app', 'next/document', 'next/error', 'http-status', 'string-hash'] externals.push((context, request...
false
Other
vercel
next.js
1aa965226e55d054112d229369e74756f2346fef.json
Add engines to package.json (#5585) Based on this PR https://github.com/zeit/next.js/pull/5520 there should be `engines` definition in package.json as first warn. Why i choose Node 8 as minimum? @timneutkens said (https://github.com/zeit/next.js/pull/5520/files#r228330327) that next.js should work on version 7.5 bu...
package.json
@@ -67,5 +67,8 @@ "taskr": "1.1.0", "wait-port": "0.2.2", "wd": "1.10.3" + }, + "engines": { + "node": ">= 8.0.0" } }
false
Other
vercel
next.js
a2553bb46e13e171f43c0f6314879bd917a26396.json
Remove registration code from initial markup (#5583) Clears the way a bit for #4943, also makes _document.js less complex, and will allow us to move `__NEXT_DATA__` to a `application/json` script tag. Also this causes a slightly smaller bundle size 😌
packages/next/build/webpack/plugins/pages-plugin.js
@@ -41,10 +41,10 @@ export default class PagesPlugin { routeName = `/${routeName.replace(/(^|\/)index$/, '')}` const source = new ConcatSource( - `__NEXT_REGISTER_PAGE('${routeName}', function() {\n`, + `(window.__NEXT_P=window.__NEXT_P||[]).push(['${routeName}', function() {\n`, ...
true
Other
vercel
next.js
a2553bb46e13e171f43c0f6314879bd917a26396.json
Remove registration code from initial markup (#5583) Clears the way a bit for #4943, also makes _document.js less complex, and will allow us to move `__NEXT_DATA__` to a `application/json` script tag. Also this causes a slightly smaller bundle size 😌
packages/next/client/index.js
@@ -48,11 +48,12 @@ envConfig.setConfig({ const asPath = getURL() const pageLoader = new PageLoader(buildId, prefix) -window.__NEXT_LOADED_PAGES__.forEach(([r, f]) => { - pageLoader.registerPage(r, f) -}) -delete window.__NEXT_LOADED_PAGES__ -window.__NEXT_REGISTER_PAGE = pageLoader.registerPage.bind(pageLoader) +...
true
Other
vercel
next.js
a2553bb46e13e171f43c0f6314879bd917a26396.json
Remove registration code from initial markup (#5583) Clears the way a bit for #4943, also makes _document.js less complex, and will allow us to move `__NEXT_DATA__` to a `application/json` script tag. Also this causes a slightly smaller bundle size 😌
packages/next/pages/_document.js
@@ -187,7 +187,7 @@ export class NextScript extends Component { static getInlineScriptSource (documentProps) { const { __NEXT_DATA__ } = documentProps const { page } = __NEXT_DATA__ - return `__NEXT_DATA__ = ${htmlescape(__NEXT_DATA__)};__NEXT_LOADED_PAGES__=[];__NEXT_REGISTER_PAGE=function(r,f){__NEXT_...
true
Other
vercel
next.js
a1bdbad2cfc7ad7b58187ce7dbbd22295617b6cd.json
Move ensurePage to DevServer (#5582) It's no longer needed inside the `render()` function since we have a separate devServer
packages/next-server/server/render.js
@@ -24,8 +24,6 @@ function getDynamicImportBundles (manifest, moduleIds) { }, []) } -const logger = console - // since send doesn't support wasm yet send.mime.define({ 'application/wasm': ['wasm'] }) @@ -63,7 +61,6 @@ async function doRender (req, res, pathname, query, { err, page, buildId, - hotRel...
true
Other
vercel
next.js
a1bdbad2cfc7ad7b58187ce7dbbd22295617b6cd.json
Move ensurePage to DevServer (#5582) It's no longer needed inside the `render()` function since we have a separate devServer
packages/next/server/next-dev-server.js
@@ -8,7 +8,6 @@ export default class DevServer extends Server { constructor (options) { super(options) this.hotReloader = new HotReloader(this.dir, { config: this.nextConfig, buildId: this.buildId }) - this.renderOpts.hotReloader = this.hotReloader this.renderOpts.dev = true } @@ -90,6 +89,17 ...
true
Other
vercel
next.js
1496ad62993de66ea3fdd39cd4bfd099f0ce902a.json
fix: update correct path to use when exporting 404 page (#5470) When exporting error page, next defaults it to 404/index.html which is not recognized as a default 404 page. This should fix https://github.com/zeit/next.js/issues/5035
packages/next/export/index.js
@@ -38,7 +38,7 @@ export default async function (dir, options, configuration) { } if (page === '/_error') { - defaultPathMap['/404'] = { page } + defaultPathMap['/404.html'] = { page } continue }
true
Other
vercel
next.js
1496ad62993de66ea3fdd39cd4bfd099f0ce902a.json
fix: update correct path to use when exporting 404 page (#5470) When exporting error page, next defaults it to 404/index.html which is not recognized as a default 404 page. This should fix https://github.com/zeit/next.js/issues/5035
test/integration/export/test/ssr.js
@@ -53,5 +53,10 @@ export default function (context) { const html = await renderViaHTTP(context.port, '/404') expect(html).toMatch(/404/) }) + + it('should export 404.html instead of 404/index.html', async () => { + const html = await renderViaHTTP(context.port, '/404.html') + expect(htm...
true
Other
vercel
next.js
345efa3ea8e7bf24cfa0165432f4ae14c94aa385.json
Keep Chunk Hash in Build Output (#10020)
packages/next/build/utils.ts
@@ -172,7 +172,7 @@ export async function printTreeView( // Re-add `static/` for root files .replace(/^<buildId>/, 'static') // Remove file hash - .replace(/[.-][0-9a-z]{20}(?=\.)/, '') + .replace(/[.-]([0-9a-z]{6})[0-9a-z]{14}(?=\.)/, '.$1') messages.push([ ` ...
true
Other
vercel
next.js
345efa3ea8e7bf24cfa0165432f4ae14c94aa385.json
Keep Chunk Hash in Build Output (#10020)
test/integration/build-output/test/index.test.js
@@ -24,8 +24,8 @@ describe('Build Output', () => { expect(stdout).toMatch(/\/ [ ]* \d{1,} B/) expect(stdout).toMatch(/\+ shared by all [ 0-9.]* kB/) - expect(stdout).toMatch(/ runtime\/main\.js [ 0-9.]* kB/) - expect(stdout).toMatch(/ chunks\/framework\.js [ 0-9. ]* kB/) + expect(stdout)....
true
Other
vercel
next.js
dd6406ace23796cc668f9ffdabf4cc58df944210.json
Add Back Comments (#10019) * Add Back Comments * remove property all together * Replace all instances
packages/next/taskfile-babel.js
@@ -10,7 +10,6 @@ module.exports = function(task) { const options = { ...babelOpts, compact: true, - comments: false, babelrc: false, configFile: false, filename: file.base, @@ -31,7 +30,7 @@ module.exports = function(task) { // Workaround for noop.js loading if (f...
false
Other
vercel
next.js
af82f322e54917afee3b93578830defe66aca59f.json
Enable New CSS Support by Default (#9927) * Enable New CSS Support by Default * Adjust configs * Fix invisible AMP body * Fix AMP validation warning * test fix * Use expression that won't be eliminated by babel
packages/next/client/dev/amp-dev.js
@@ -3,6 +3,7 @@ import fetch from 'unfetch' import EventSourcePolyfill from './event-source-polyfill' import { getEventSourceWrapper } from './error-overlay/eventsource' import { setupPing } from './on-demand-entries-utils' +import { displayContent } from './fouc' if (!window.EventSource) { window.EventSource ...
true