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 | 47d3cfd0fd3c38cf1affbb986d9e2d336cbb7c92.json | Upgrade React for all examples (#3113) | examples/with-refnux/package.json | @@ -7,8 +7,8 @@
"license": "ISC",
"dependencies": {
"next": "latest",
- "react": "^15.4.2",
- "react-dom": "^15.4.2",
+ "react": "^16.0.0",
+ "react-dom": "^16.0.0",
"refnux": "^1.3.0"
}
} | true |
Other | vercel | next.js | 47d3cfd0fd3c38cf1affbb986d9e2d336cbb7c92.json | Upgrade React for all examples (#3113) | examples/with-scoped-stylesheets-and-postcss/package.json | @@ -14,8 +14,8 @@
"postcss-cssnext": "^2.9.0",
"postcss-loader": "^1.3.0",
"postcss-modules": "^0.6.4",
- "react": "^15.4.2",
- "react-dom": "^15.4.2",
+ "react": "^16.0.0",
+ "react-dom": "^16.0.0",
"skeleton-loader": "^1.1.2",
"trash": "^4.0.1"
}, | true |
Other | vercel | next.js | 47d3cfd0fd3c38cf1affbb986d9e2d336cbb7c92.json | Upgrade React for all examples (#3113) | examples/with-semantic-ui/package.json | @@ -8,8 +8,8 @@
},
"dependencies": {
"next": "latest",
- "react": "^15.4.2",
- "react-dom": "^15.4.2",
+ "react": "^16.0.0",
+ "react-dom": "^16.0.0",
"semantic-ui-react": "^0.68.0"
},
"license": "ISC" | true |
Other | vercel | next.js | 47d3cfd0fd3c38cf1affbb986d9e2d336cbb7c92.json | Upgrade React for all examples (#3113) | examples/with-shallow-routing/package.json | @@ -8,8 +8,8 @@
},
"dependencies": {
"next": "latest",
- "react": "^15.4.2",
- "react-dom": "^15.4.2"
+ "react": "^16.0.0",
+ "react-dom": "^16.0.0"
},
"license": "ISC"
} | true |
Other | vercel | next.js | 47d3cfd0fd3c38cf1affbb986d9e2d336cbb7c92.json | Upgrade React for all examples (#3113) | examples/with-styletron/package.json | @@ -8,8 +8,8 @@
},
"dependencies": {
"next": "latest",
- "react": "^15.4.2",
- "react-dom": "^15.4.2",
+ "react": "^16.0.0",
+ "react-dom": "^16.0.0",
"styletron-client": "^2.2.0",
"styletron-react": "^2.2.1",
"styletron-server": "^2.2.0" | true |
Other | vercel | next.js | 47d3cfd0fd3c38cf1affbb986d9e2d336cbb7c92.json | Upgrade React for all examples (#3113) | examples/with-sw-precache/package.json | @@ -7,8 +7,8 @@
},
"dependencies": {
"next": "latest",
- "react": "^15.4.2",
- "react-dom": "^15.4.2",
+ "react": "^16.0.0",
+ "react-dom": "^16.0.0",
"sw-precache-webpack-plugin": "^0.11.3"
}
} | true |
Other | vercel | next.js | 47d3cfd0fd3c38cf1affbb986d9e2d336cbb7c92.json | Upgrade React for all examples (#3113) | examples/with-universal-configuration/package.json | @@ -8,8 +8,8 @@
},
"dependencies": {
"next": "latest",
- "react": "^15.4.2",
- "react-dom": "^15.4.2"
+ "react": "^16.0.0",
+ "react-dom": "^16.0.0"
},
"devDependencies": {
"babel-plugin-transform-define": "^1.2.0" | true |
Other | vercel | next.js | 47d3cfd0fd3c38cf1affbb986d9e2d336cbb7c92.json | Upgrade React for all examples (#3113) | examples/with-url-object-routing/package.json | @@ -9,7 +9,7 @@
"dependencies": {
"next": "latest",
"path-match": "1.2.4",
- "react": "^15.4.2",
- "react-dom": "^15.4.2"
+ "react": "^16.0.0",
+ "react-dom": "^16.0.0"
}
} | true |
Other | vercel | next.js | 43b5626ec6f7bdd7dbc0e9931e598035d3d1a0dd.json | Use strict version of react-hot-loader (#3112) | package.json | @@ -86,7 +86,7 @@
"pkg-up": "2.0.0",
"prop-types": "15.6.0",
"prop-types-exact": "1.1.1",
- "react-hot-loader": "^3.0.0",
+ "react-hot-loader": "3.1.1",
"recursive-copy": "2.0.6",
"send": "0.16.1",
"source-map-support": "0.4.18", | false |
Other | vercel | next.js | b7406e90c570ec45cca9b20794503932ed5160b2.json | Fix url typo (#3111) | examples/custom-server-fastify/server.js | @@ -11,7 +11,7 @@ app.prepare()
const server = fastify()
server.get('/a', (req, res) => {
- return app.render(req.req, res.res, '/b', req.query)
+ return app.render(req.req, res.res, '/a', req.query)
})
server.get('/b', (req, res) => { | false |
Other | vercel | next.js | f5aac04b790ee097f825b070874f0bdf6fdbce4f.json | Proposal: Add shields io npm version badge (#3099) | readme.md | @@ -1,5 +1,6 @@
<img width="112" alt="screen shot 2016-10-25 at 2 37 27 pm" src="https://cloud.githubusercontent.com/assets/13041/19686250/971bf7f8-9ac0-11e6-975c-188defd82df1.png">
+[](https://www.npmjs.com/package/next)
[
Running nsp check
```
➜ web git:(master) nsp check
(+) 1 vulnerabilities found
┌───────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ │ Regular Expression Denial of Service ... | package.json | @@ -88,7 +88,7 @@
"prop-types-exact": "1.1.1",
"react-hot-loader": "^3.0.0",
"recursive-copy": "2.0.6",
- "send": "0.15.6",
+ "send": "0.16.1",
"source-map-support": "0.4.18",
"strip-ansi": "4.0.0",
"styled-jsx": "2.0.2", | false |
Other | vercel | next.js | 8711a7d14e064604078a5cfd29eb90a1ab1f18c7.json | Fix renderPage in production mode (#3089)
The next object was not being exported in the same manner in dev vs. prod mode. | client/next-dev.js | @@ -1,10 +1,11 @@
import 'react-hot-loader/patch'
+import initNext, * as next from './'
import initOnDemandEntries from './on-demand-entries-client'
import initWebpackHMR from './webpack-hot-middleware-client'
-const next = window.next = require('./')
+window.next = next
-next.default()
+initNext()
.then((emi... | true |
Other | vercel | next.js | 8711a7d14e064604078a5cfd29eb90a1ab1f18c7.json | Fix renderPage in production mode (#3089)
The next object was not being exported in the same manner in dev vs. prod mode. | client/next.js | @@ -1,6 +1,8 @@
-import next from './'
+import initNext, * as next from './'
-next()
+window.next = next
+
+initNext()
.catch((err) => {
console.error(`${err.message}\n${err.stack}`)
}) | true |
Other | vercel | next.js | 63ac27b9001005c96cad10283a19569dcd06f9fc.json | Update TypeScript example (#3074) | examples/with-typescript/package.json | @@ -6,11 +6,11 @@
},
"dependencies": {
"next": "latest",
- "react": "^15.5.4",
- "react-dom": "^15.5.4"
+ "react": "^16.0.0",
+ "react-dom": "^16.0.0"
},
"devDependencies": {
- "@types/react": "^15.0.1",
+ "@types/react": "^16.0.9",
"concurrently": "^3.1.0",
"typescript": "^... | false |
Other | vercel | next.js | 8873735de38f52735682fcb6877aae193c5192d7.json | Upgrade react-hot-loader (add React 16 Support) (#3072) | package.json | @@ -86,7 +86,7 @@
"pkg-up": "2.0.0",
"prop-types": "15.6.0",
"prop-types-exact": "1.1.1",
- "react-hot-loader": "3.0.0-beta.7",
+ "react-hot-loader": "^3.0.0",
"recursive-copy": "2.0.6",
"send": "0.15.6",
"source-map-support": "0.4.18", | true |
Other | vercel | next.js | 8873735de38f52735682fcb6877aae193c5192d7.json | Upgrade react-hot-loader (add React 16 Support) (#3072) | yarn.lock | @@ -5414,9 +5414,9 @@ rc@^1.1.7:
minimist "^1.2.0"
strip-json-comments "~2.0.1"
-react-deep-force-update@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-2.0.1.tgz#4f7f6c12c3e7de42f345992a3c518236fa1ecad3"
+react-deep-force-update@^2.1.1:... | true |
Other | vercel | next.js | ebfa08fdff12f5de546ec8b303980d206418c672.json | Add details to with-scoped-external-css (#3055) | examples/with-external-scoped-css/README.md | @@ -12,8 +12,7 @@ yarn start
#### Supported Langs
The plugin supports the `less`, `scss` and `css` file extensions. It is possible to add support for another pre-processor by creating a function to compile the code. In the example we use `sass` as our css pre-processor
-To edit the types you need to go to `.babelrc... | false |
Other | vercel | next.js | 17329edcc930a286fac538522fca81256bb51659.json | Handle require.ensure errors well.
Introduce a new Promise library which runs on the same eventloop. | lib/dynamic.js | @@ -53,3 +53,89 @@ export function flushChunks () {
currentChunks = []
return chunks
}
+
+export class SameLoopPromise {
+ constructor (cb) {
+ this.onResultCallbacks = []
+ this.onErrorCallbacks = []
+
+ if (cb) {
+ cb(
+ (result) => this.setResult(result),
+ (error) => this.setErro... | true |
Other | vercel | next.js | 17329edcc930a286fac538522fca81256bb51659.json | Handle require.ensure errors well.
Introduce a new Promise library which runs on the same eventloop. | server/build/babel/plugins/handle-import.js | @@ -8,35 +8,34 @@ const TYPE_IMPORT = 'Import'
const buildImport = (args) => (template(`
(
- typeof window === 'undefined' ?
- {
- then(cb) {
- eval('require.ensure = function (deps, callback) { callback(require) }')
- require.ensure([], (require) => {
- let m = requir... | true |
Other | vercel | next.js | b5a03a38964fba0e5f203c33941424b377c6ccd3.json | Implement ssr=false support. | examples/with-dynamic-import/components/hello3.js | @@ -0,0 +1,3 @@
+export default () => (
+ <p>Hello World 3 (imported dynamiclly) </p>
+) | true |
Other | vercel | next.js | b5a03a38964fba0e5f203c33941424b377c6ccd3.json | Implement ssr=false support. | examples/with-dynamic-import/pages/index.js | @@ -10,12 +10,17 @@ const DynamicComponentWithCustomLoading = dynamic(
loading: () => (<p>...</p>)
}
)
+const DynamicComponentWithNoSSR = dynamic(
+ import('../components/hello3'),
+ { ssr: false }
+)
export default () => (
<div>
<Header />
<DynamicComponent />
<DynamicComponentWithCusto... | true |
Other | vercel | next.js | b5a03a38964fba0e5f203c33941424b377c6ccd3.json | Implement ssr=false support. | lib/dynamic.js | @@ -6,10 +6,16 @@ export default function dynamicComponent (promise, options = {}) {
return class Comp extends React.Component {
constructor (...args) {
super(...args)
+
this.LoadingComponent = options.loading ? options.loading : () => (<p>loading...</p>)
+ this.ssr = options.ssr === false ? ... | true |
Other | vercel | next.js | f2bfcd01b0ea12a3dd267f7d714b6cdbccf4b1e9.json | Add an example with custom loading component. | examples/with-dynamic-import/components/hello.js | @@ -1,3 +0,0 @@
-export default () => (
- <p>Hello World (imported dynamiclly) </p>
-) | true |
Other | vercel | next.js | f2bfcd01b0ea12a3dd267f7d714b6cdbccf4b1e9.json | Add an example with custom loading component. | examples/with-dynamic-import/components/hello1.js | @@ -0,0 +1,3 @@
+export default () => (
+ <p>Hello World 1 (imported dynamiclly) </p>
+) | true |
Other | vercel | next.js | f2bfcd01b0ea12a3dd267f7d714b6cdbccf4b1e9.json | Add an example with custom loading component. | examples/with-dynamic-import/components/hello2.js | @@ -0,0 +1,3 @@
+export default () => (
+ <p>Hello World 2 (imported dynamiclly) </p>
+) | true |
Other | vercel | next.js | f2bfcd01b0ea12a3dd267f7d714b6cdbccf4b1e9.json | Add an example with custom loading component. | examples/with-dynamic-import/pages/index.js | @@ -3,12 +3,19 @@ import Header from '../components/Header'
import Counter from '../components/Counter'
import dynamic from 'next/dynamic'
-const DynamicComponent = dynamic(import('../components/hello'))
+const DynamicComponent = dynamic(import('../components/hello1'))
+const DynamicComponentWithCustomLoading = dyn... | true |
Other | vercel | next.js | f2bfcd01b0ea12a3dd267f7d714b6cdbccf4b1e9.json | Add an example with custom loading component. | lib/dynamic.js | @@ -2,10 +2,11 @@ import React from 'react'
let currentChunks = []
-export default function dynamicComponent (promise, Loading = () => (<p>Loading...</p>)) {
+export default function dynamicComponent (promise, options = {}) {
return class Comp extends React.Component {
constructor (...args) {
super(... | true |
Other | vercel | next.js | f82e52935db5bea04c5eb0f7328c06618d62a235.json | Implement ETag support for server rendered pages. (#1693) | package.json | @@ -61,8 +61,10 @@
"case-sensitive-paths-webpack-plugin": "2.0.0",
"cross-spawn": "5.1.0",
"del": "2.2.2",
+ "etag": "1.8.0",
+ "fresh": "0.5.0",
"friendly-errors-webpack-plugin": "1.5.0",
- "glob": "^7.1.1",
+ "glob": "7.1.1",
"glob-promise": "3.1.0",
"htmlescape": "1.1.1",
... | true |
Other | vercel | next.js | f82e52935db5bea04c5eb0f7328c06618d62a235.json | Implement ETag support for server rendered pages. (#1693) | server/index.js | @@ -225,7 +225,7 @@ export default class Server {
res.setHeader('X-Powered-By', `Next.js ${pkg.version}`)
}
const html = await this.renderToHTML(req, res, pathname, query)
- return sendHTML(res, html, req.method)
+ return sendHTML(req, res, html, req.method)
}
async renderToHTML (req, res... | true |
Other | vercel | next.js | f82e52935db5bea04c5eb0f7328c06618d62a235.json | Implement ETag support for server rendered pages. (#1693) | server/render.js | @@ -2,6 +2,8 @@ import { join } from 'path'
import { createElement } from 'react'
import { renderToString, renderToStaticMarkup } from 'react-dom/server'
import send from 'send'
+import generateETag from 'etag'
+import fresh from 'fresh'
import requireModule from './require'
import getConfig from './config'
impor... | true |
Other | vercel | next.js | f82e52935db5bea04c5eb0f7328c06618d62a235.json | Implement ETag support for server rendered pages. (#1693) | test/integration/basic/test/misc.js | @@ -1,4 +1,5 @@
/* global describe, test, expect */
+import fetch from 'node-fetch'
export default function (context) {
describe('Misc', () => {
@@ -12,5 +13,14 @@ export default function (context) {
const html = await context.app.renderToHTML({}, res, '/finish-response', {})
expect(html).toBeFalsy... | true |
Other | vercel | next.js | f82e52935db5bea04c5eb0f7328c06618d62a235.json | Implement ETag support for server rendered pages. (#1693) | test/integration/basic/test/xpowered-by.js | @@ -4,7 +4,7 @@ import { pkg } from 'next-test-utils'
export default function ({ app }) {
describe('X-Powered-By header', () => {
test('set it by default', async () => {
- const req = { url: '/stateless' }
+ const req = { url: '/stateless', headers: {} }
const headers = {}
const res = {... | true |
Other | vercel | next.js | f82e52935db5bea04c5eb0f7328c06618d62a235.json | Implement ETag support for server rendered pages. (#1693) | yarn.lock | @@ -1972,7 +1972,7 @@ esutils@^2.0.0, esutils@^2.0.2:
version "2.0.2"
resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
-etag@~1.8.0:
+etag@1.8.0, etag@~1.8.0:
version "1.8.0"
resolved "https://registry.npmjs.org/etag/-/etag-1.8.0.tgz#6f631aef336d6c... | true |
Other | vercel | next.js | b3f15f8d5c7f3923ead925e7d9e24724777141cc.json | Fix a typo. (#1749) | server/render.js | @@ -125,7 +125,7 @@ export async function renderScriptError (req, res, page, error, customFields, op
res.setHeader('Content-Type', 'text/javascript')
res.end(`
window.__NEXT_REGISTER_PAGE('${page}', function() {
- var error = new Error('Page not exists: ${page}')
+ var error = new Error('... | false |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | client/index.js | @@ -4,9 +4,9 @@ import mitt from 'mitt'
import HeadManager from './head-manager'
import { createRouter } from '../lib/router'
import App from '../lib/app'
-import evalScript from '../lib/eval-script'
import { loadGetInitialProps, getURL } from '../lib/utils'
import ErrorDebugComponent from '../lib/error-debug'
+im... | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | client/next-dev.js | @@ -1,14 +1,40 @@
-import evalScript from '../lib/eval-script'
+import 'react-hot-loader/patch'
import ReactReconciler from 'react-dom/lib/ReactReconciler'
-
-const { __NEXT_DATA__: { errorComponent } } = window
-const ErrorComponent = evalScript(errorComponent).default
-
-require('react-hot-loader/patch')
+import ini... | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | client/next.js | @@ -1,3 +1,6 @@
import next from './'
next()
+ .catch((err) => {
+ console.error(`${err.message}\n${err.stack}`)
+ }) | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | client/on-demand-entries-client.js | @@ -3,31 +3,33 @@
import Router from '../lib/router'
import fetch from 'unfetch'
-Router.ready(() => {
- Router.router.events.on('routeChangeComplete', ping)
-})
+export default () => {
+ Router.ready(() => {
+ Router.router.events.on('routeChangeComplete', ping)
+ })
-async function ping () {
- try {
- ... | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | client/webpack-hot-middleware-client.js | @@ -1,48 +1,50 @@
import webpackHotMiddlewareClient from 'webpack-hot-middleware/client?overlay=false&reload=true&path=/_next/webpack-hmr'
import Router from '../lib/router'
-const handlers = {
- reload (route) {
- if (route === '/_error') {
- for (const r of Object.keys(Router.components)) {
- cons... | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | lib/error.js | @@ -3,8 +3,8 @@ import HTTPStatus from 'http-status'
import Head from './head'
export default class Error extends React.Component {
- static getInitialProps ({ res, jsonPageRes }) {
- const statusCode = res ? res.statusCode : (jsonPageRes ? jsonPageRes.status : null)
+ static getInitialProps ({ res, err }) {
+... | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | lib/eval-script.js | @@ -1,18 +0,0 @@
-/**
- * IMPORTANT: This module is compiled *without* `use strict`
- * so that when we `eval` a dependency below, we don't enforce
- * `use strict` implicitly.
- *
- * Otherwise, modules like `d3` get `eval`d and forced into
- * `use strict` where they don't work (at least in current versions)
- *
- * ... | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | lib/page-loader.js | @@ -0,0 +1,102 @@
+/* global window, document */
+import mitt from 'mitt'
+
+const webpackModule = module
+
+export default class PageLoader {
+ constructor (buildId, assetPrefix) {
+ this.buildId = buildId
+ this.assetPrefix = assetPrefix
+
+ this.pageCache = {}
+ this.pageLoadedHandlers = {}
+ this.re... | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | lib/router/router.js | @@ -1,28 +1,28 @@
import { parse, format } from 'url'
import mitt from 'mitt'
-import fetch from 'unfetch'
-import evalScript from '../eval-script'
import shallowEquals from '../shallow-equals'
import PQueue from '../p-queue'
import { loadGetInitialProps, getURL } from '../utils'
import { _notifyBuildIdMismatch }... | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | readme.md | @@ -34,6 +34,7 @@ Next.js is a minimalistic framework for server-rendered React applications.
- [Custom configuration](#custom-configuration)
- [Customizing webpack config](#customizing-webpack-config)
- [Customizing babel config](#customizing-babel-config)
+ - [CDN support with Asset Prefix](#cdn-support-wit... | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | server/build/plugins/json-pages-plugin.js | @@ -1,24 +0,0 @@
-export default class JsonPagesPlugin {
- apply (compiler) {
- compiler.plugin('after-compile', (compilation, callback) => {
- const pages = Object
- .keys(compilation.assets)
- .filter((filename) => /^bundles[/\\]pages.*\.js$/.test(filename))
-
- pages.forEach((pageName) =>... | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | server/build/plugins/pages-plugin.js | @@ -0,0 +1,33 @@
+export default class PagesPlugin {
+ apply (compiler) {
+ const isBundledPage = /^bundles[/\\]pages.*\.js$/
+ const matchRouteName = /^bundles[/\\]pages[/\\](.*)\.js$/
+
+ compiler.plugin('after-compile', (compilation, callback) => {
+ const pages = Object
+ .keys(compilation.nam... | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | server/build/webpack.js | @@ -6,7 +6,7 @@ import WriteFilePlugin from 'write-file-webpack-plugin'
import FriendlyErrorsWebpackPlugin from 'friendly-errors-webpack-plugin'
import CaseSensitivePathPlugin from 'case-sensitive-paths-webpack-plugin'
import UnlinkFilePlugin from './plugins/unlink-file-plugin'
-import JsonPagesPlugin from './plugin... | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | server/config.js | @@ -6,7 +6,8 @@ const cache = new Map()
const defaultConfig = {
webpack: null,
poweredByHeader: true,
- distDir: '.next'
+ distDir: '.next',
+ assetPrefix: ''
}
export default function getConfig (dir) { | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | server/document.js | @@ -34,9 +34,45 @@ export class Head extends Component {
_documentProps: PropTypes.any
}
+ getChunkPreloadLink (filename) {
+ const { __NEXT_DATA__ } = this.context._documentProps
+ let { buildStats, assetPrefix } = __NEXT_DATA__
+ const hash = buildStats ? buildStats[filename].hash : '-'
+
+ ret... | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | server/hot-reloader.js | @@ -5,7 +5,6 @@ import onDemandEntryHandler from './on-demand-entry-handler'
import isWindowsBash from 'is-windows-bash'
import webpack from './build/webpack'
import clean from './build/clean'
-import readPage from './read-page'
import getConfig from './config'
export default class HotReloader {
@@ -205,7 +204,6... | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | server/index.js | @@ -6,10 +6,10 @@ import http, { STATUS_CODES } from 'http'
import {
renderToHTML,
renderErrorToHTML,
- renderJSON,
- renderErrorJSON,
sendHTML,
- serveStatic
+ serveStatic,
+ renderScript,
+ renderScriptError
} from './render'
import Router from './router'
import HotReloader from './hot-reloader'
@@... | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | server/read-page.js | @@ -1,25 +0,0 @@
-import fs from 'mz/fs'
-import resolve from './resolve'
-
-/**
- * resolve a JSON page like `require.resolve`,
- * and read and cache the file content
- */
-
-async function readPage (path) {
- const f = await resolve(path)
- if (cache.hasOwnProperty(f)) {
- return cache[f]
- }
-
- const source... | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | server/render.js | @@ -5,7 +5,6 @@ import send from 'send'
import requireModule from './require'
import getConfig from './config'
import resolvePath from './resolve'
-import readPage from './read-page'
import { Router } from '../lib/router'
import { loadGetInitialProps } from '../lib/utils'
import Head, { defaultHead } from '../lib... | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | test/integration/ondemand/test/index.test.js | @@ -31,13 +31,13 @@ describe('On Demand Entries', () => {
})
it('should compile pages for JSON page requests', async () => {
- const pageContent = await renderViaHTTP(context.appPort, '/_next/-/pages/about')
+ const pageContent = await renderViaHTTP(context.appPort, '/_next/-/page/about')
expect(page... | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | test/integration/production/pages/about.js | @@ -0,0 +1,3 @@
+export default () => (
+ <div className='about-page'>About Page</div>
+) | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | test/integration/production/pages/index.js | @@ -1,3 +1,8 @@
+import Link from 'next/link'
+
export default () => (
- <div>Hello World</div>
+ <div>
+ <Link href='/about'><a>About Page</a></Link>
+ <p>Hello World</p>
+ </div>
) | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | test/integration/production/test/index.test.js | @@ -1,6 +1,5 @@
/* global jasmine, describe, it, expect, beforeAll, afterAll */
-import fetch from 'node-fetch'
import { join } from 'path'
import {
nextServer,
@@ -9,6 +8,7 @@ import {
stopApp,
renderViaHTTP
} from 'next-test-utils'
+import webdriver from 'next-webdriver'
const appDir = join(__dirnam... | true |
Other | vercel | next.js | dec85fe6c4c5360aced57d75f9cea78ed388f2f8.json | Add CDN support with assetPrefix (#1700)
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases... | test/unit/router.test.js | @@ -1,52 +1,53 @@
/* global describe, it, expect */
import Router from '../../dist/lib/router/router'
+class PageLoader {
+ constructor (options = {}) {
+ this.options = options
+ this.loaded = {}
+ }
+
+ loadPage (route) {
+ this.loaded[route] = true
+
+ if (this.options.delay) {
+ return new P... | true |
Other | vercel | next.js | f51300f14bd44d03db0e6ab6ad05f163938b418c.json | Add core import() support. | examples/with-dynamic-import/README.md | @@ -0,0 +1,27 @@
+# Example app with dynamic-imports
+
+## How to use
+
+Download the example [or clone the repo](https://github.com/zeit/next.js):
+
+```bash
+curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/shared-modules
+cd shared-modules
+```
+
+Install it and... | true |
Other | vercel | next.js | f51300f14bd44d03db0e6ab6ad05f163938b418c.json | Add core import() support. | examples/with-dynamic-import/components/Counter.js | @@ -0,0 +1,19 @@
+import React from 'react'
+
+let count = 0
+
+export default class Counter extends React.Component {
+ add () {
+ count += 1
+ this.forceUpdate()
+ }
+
+ render () {
+ return (
+ <div>
+ <p>Count is: {count}</p>
+ <button onClick={() => this.add()}>Add</button>
+ </... | true |
Other | vercel | next.js | f51300f14bd44d03db0e6ab6ad05f163938b418c.json | Add core import() support. | examples/with-dynamic-import/components/Header.js | @@ -0,0 +1,19 @@
+import Link from 'next/link'
+
+export default () => (
+ <div>
+ <Link href='/'>
+ <a style={styles.a} >Home</a>
+ </Link>
+
+ <Link href='/about'>
+ <a style={styles.a} >About</a>
+ </Link>
+ </div>
+)
+
+const styles = {
+ a: {
+ marginRight: 10
+ }
+} | true |
Other | vercel | next.js | f51300f14bd44d03db0e6ab6ad05f163938b418c.json | Add core import() support. | examples/with-dynamic-import/components/hello.js | @@ -0,0 +1,3 @@
+export default () => (
+ <p>Hello World (imported dynamiclly) </p>
+) | true |
Other | vercel | next.js | f51300f14bd44d03db0e6ab6ad05f163938b418c.json | Add core import() support. | examples/with-dynamic-import/lib/with-import.js | @@ -0,0 +1,23 @@
+import React from 'react'
+
+export default function withImport (promise, Loading = () => (<p>Loading...</p>)) {
+ return class Comp extends React.Component {
+ constructor (...args) {
+ super(...args)
+ this.state = { AsyncComponent: null }
+ }
+
+ componentDidMount () {
+ pr... | true |
Other | vercel | next.js | f51300f14bd44d03db0e6ab6ad05f163938b418c.json | Add core import() support. | examples/with-dynamic-import/package.json | @@ -0,0 +1,18 @@
+{
+ "name": "with-dynamic-import",
+ "version": "1.0.0",
+ "description": "This example features:",
+ "main": "index.js",
+ "scripts": {
+ "dev": "next",
+ "build": "next build",
+ "start": "next start"
+ },
+ "dependencies": {
+ "next": "*",
+ "react": "^15.4.2",
+ "react-dom... | true |
Other | vercel | next.js | f51300f14bd44d03db0e6ab6ad05f163938b418c.json | Add core import() support. | examples/with-dynamic-import/pages/about.js | @@ -0,0 +1,12 @@
+import Header from '../components/Header'
+import Counter from '../components/Counter'
+
+const About = () => (
+ <div>
+ <Header />
+ <p>This is the about page.</p>
+ <Counter />
+ </div>
+)
+
+export default About | true |
Other | vercel | next.js | f51300f14bd44d03db0e6ab6ad05f163938b418c.json | Add core import() support. | examples/with-dynamic-import/pages/index.js | @@ -0,0 +1,15 @@
+import React from 'react'
+import Header from '../components/Header'
+import Counter from '../components/Counter'
+import withImport from '../lib/with-import'
+
+const DynamicComponent = withImport(import('../components/hello'))
+
+export default () => (
+ <div>
+ <Header />
+ <DynamicComponent... | true |
Other | vercel | next.js | f51300f14bd44d03db0e6ab6ad05f163938b418c.json | Add core import() support. | package.json | @@ -52,6 +52,7 @@
"babel-loader": "6.4.1",
"babel-plugin-module-resolver": "2.6.2",
"babel-plugin-react-require": "3.0.0",
+ "babel-plugin-syntax-dynamic-import": "6.18.0",
"babel-plugin-transform-class-properties": "6.22.0",
"babel-plugin-transform-es2015-modules-commonjs": "6.24.0",
"... | true |
Other | vercel | next.js | f51300f14bd44d03db0e6ab6ad05f163938b418c.json | Add core import() support. | server/build/babel/plugins/handle-import.js | @@ -0,0 +1,41 @@
+// Based on https://github.com/airbnb/babel-plugin-dynamic-import-webpack
+// We've added support for SSR with this version
+import template from 'babel-template'
+import syntax from 'babel-plugin-syntax-dynamic-import'
+import UUID from 'uuid'
+
+const TYPE_IMPORT = 'Import'
+
+const buildImport = (a... | true |
Other | vercel | next.js | f51300f14bd44d03db0e6ab6ad05f163938b418c.json | Add core import() support. | server/build/babel/preset.js | @@ -20,6 +20,7 @@ module.exports = {
],
plugins: [
require.resolve('babel-plugin-react-require'),
+ require.resolve('./plugins/handle-import'),
require.resolve('babel-plugin-transform-object-rest-spread'),
require.resolve('babel-plugin-transform-class-properties'),
require.resolve('babel-pl... | true |
Other | vercel | next.js | f51300f14bd44d03db0e6ab6ad05f163938b418c.json | Add core import() support. | server/build/webpack.js | @@ -277,7 +277,9 @@ export default async function createCompiler (dir, { dev = false, quiet = false,
// append hash id for cache busting
return `webpack:///${resourcePath}?${id}`
- }
+ },
+ // This saves chunks with the name given via require.ensure()
+ chunkFilename: '[name]'
... | true |
Other | vercel | next.js | f51300f14bd44d03db0e6ab6ad05f163938b418c.json | Add core import() support. | server/index.js | @@ -91,6 +91,13 @@ export default class Server {
await this.serveStatic(req, res, p)
},
+ // This is to support, webpack dynamic imports in production.
+ '/_webpack/chunks/:name': async (req, res, params) => {
+ res.setHeader('Cache-Control', 'max-age=365000000, immutable')
+ c... | true |
Other | vercel | next.js | f51300f14bd44d03db0e6ab6ad05f163938b418c.json | Add core import() support. | yarn.lock | @@ -504,6 +504,10 @@ babel-plugin-syntax-class-properties@^6.8.0:
version "6.13.0"
resolved "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de"
+babel-plugin-syntax-dynamic-import@^6.18.0:
+ version "6.18.0... | true |
Other | vercel | next.js | 2103e0541b8e2149a8b2e1e53d6a0ea8a66efb46.json | remove roadmap to 2.0 (#1711)
2.0 is already released | readme.md | @@ -36,7 +36,6 @@ Next.js is a minimalistic framework for server-rendered React applications.
- [Customizing babel config](#customizing-babel-config)
- [Production deployment](#production-deployment)
- [FAQ](#faq)
-- [Roadmap](#roadmap)
- [Contributing](#contributing)
- [Authors](#authors)
@@ -845,10 +844,6 @@... | false |
Other | vercel | next.js | e0544300261bd6048089f887fdac3ff382da3966.json | Fix a typo | readme.md | @@ -44,7 +44,8 @@ Next.js is a minimalistic framework for server-rendered React applications.
## How to use
-### Gettin Started
+### Getting Started
+
A step by step interactive guide of next features is available at [learnnextjs.com](https://learnnextjs.com/)
### Setup | false |
Other | vercel | next.js | a52458181a4e2f3d6e2fea64e34f158e087037f6.json | Add learnnextjs link (#1710)
* Add learnnextjs link
* fix typos | readme.md | @@ -11,6 +11,7 @@ Next.js is a minimalistic framework for server-rendered React applications.
<!-- https://github.com/thlorenz/doctoc -->
- [How to use](#how-to-use)
+ - [Getting Started](#getting-started)
- [Setup](#setup)
- [Automatic code splitting](#automatic-code-splitting)
- [CSS](#css)
@@ -43,6 +44... | false |
Other | vercel | next.js | 6f735eeb0568637c7f33388bfe00390d9cb41f75.json | Fix a typo. | server/render.js | @@ -123,7 +123,7 @@ export async function renderScriptError (req, res, page, error, customFields, op
res.setHeader('Content-Type', 'text/javascript')
res.end(`
window.__NEXT_REGISTER_PAGE('${page}', function() {
- var error = new Error('Page not exists: ${page}')
+ var error = new Error('... | false |
Other | vercel | next.js | 7997c1fd3c4a5e66c9700f04d911f9557b79aaee.json | Introduce a better way to register pages. | client/index.js | @@ -28,11 +28,13 @@ const {
location
} = window
-const pageLoader = window.__NEXT_PAGE_LOADER__ = new PageLoader(buildId)
-if (window.__NEXT_LOADED_PAGES__) {
- window.__NEXT_LOADED_PAGES__.forEach((fn) => fn())
- delete window.__NEXT_LOADED_PAGES__
-}
+const pageLoader = new PageLoader(buildId)
+window.__NEXT_... | true |
Other | vercel | next.js | 7997c1fd3c4a5e66c9700f04d911f9557b79aaee.json | Introduce a better way to register pages. | lib/page-loader.js | @@ -71,13 +71,12 @@ export default class PageLoader {
// This method if called by the route code.
registerPage (route, regFn) {
- const register = () => {
- regFn((error, page) => {
- route = this.normalizeRoute(route)
+ route = this.normalizeRoute(route)
- // add the page to the cach... | true |
Other | vercel | next.js | 7997c1fd3c4a5e66c9700f04d911f9557b79aaee.json | Introduce a better way to register pages. | server/build/plugins/pages-plugin.js | @@ -16,19 +16,10 @@ export default class PagesPlugin {
const content = page.source()
const newContent = `
- function loadPage () {
- window.__NEXT_PAGE_LOADER__.registerPage('${routeName}', function(cb) {
- var comp = ${content}
- cb(null, comp.default)
... | true |
Other | vercel | next.js | 7997c1fd3c4a5e66c9700f04d911f9557b79aaee.json | Introduce a better way to register pages. | server/document.js | @@ -101,7 +101,15 @@ export class NextScript extends Component {
return <div>
{staticMarkup ? null : <script dangerouslySetInnerHTML={{
- __html: `__NEXT_DATA__ = ${htmlescape(__NEXT_DATA__)}; module={};`
+ __html: `
+ __NEXT_DATA__ = ${htmlescape(__NEXT_DATA__)}
+ module={... | true |
Other | vercel | next.js | 7997c1fd3c4a5e66c9700f04d911f9557b79aaee.json | Introduce a better way to register pages. | server/render.js | @@ -122,20 +122,12 @@ export async function renderScriptError (req, res, page, error, customFields, op
if (error.code === 'ENOENT') {
res.setHeader('Content-Type', 'text/javascript')
res.end(`
- function loadPage () {
+ window.__NEXT_REGISTER_PAGE('${page}', function() {
var error = new ... | true |
Other | vercel | next.js | 6f9b51fce6e7024a1701946c0cd52beb12f99c0c.json | Remove pageNotFound key from the error. | lib/error.js | @@ -5,13 +5,12 @@ import Head from './head'
export default class Error extends React.Component {
static getInitialProps ({ res, err }) {
const statusCode = res ? res.statusCode : (err ? err.statusCode : null)
- const pageNotFound = statusCode === 404 || (err ? err.pageNotFound : false)
- return { statusC... | true |
Other | vercel | next.js | 6f9b51fce6e7024a1701946c0cd52beb12f99c0c.json | Remove pageNotFound key from the error. | lib/router/router.js | @@ -208,7 +208,7 @@ export default class Router {
return { error: err }
}
- if (err.pageNotFound) {
+ if (err.statusCode === 404) {
// Indicate main error display logic to
// ignore rendering this error as a runtime error.
err.ignore = true | true |
Other | vercel | next.js | 6f9b51fce6e7024a1701946c0cd52beb12f99c0c.json | Remove pageNotFound key from the error. | server/render.js | @@ -124,7 +124,6 @@ export async function renderScriptError (req, res, page, error, customFields, op
res.end(`
function loadPage () {
var error = new Error('Page not exists: ${page}')
- error.pageNotFound = true
error.statusCode = 404
__NEXT_PAGE_LOADER__.registerPage('${pa... | true |
Other | vercel | next.js | 8d2bbf940d52c8f44709a62bcd6d46ca34171e2d.json | Refactor the build server to remove tie to fs (#1656) | server/build/index.js | @@ -1,6 +1,5 @@
import { tmpdir } from 'os'
import { join } from 'path'
-import getConfig from '../config'
import fs from 'mz/fs'
import uuid from 'uuid'
import del from 'del'
@@ -14,10 +13,8 @@ export default async function build (dir) {
try {
await runCompiler(compiler)
-
- // Pass in both the build... | true |
Other | vercel | next.js | 8d2bbf940d52c8f44709a62bcd6d46ca34171e2d.json | Refactor the build server to remove tie to fs (#1656) | server/build/replace.js | @@ -4,10 +4,9 @@ import getConfig from '../config'
export default async function replaceCurrentBuild (dir, buildDir) {
const dist = getConfig(dir).distDir
- const buildDist = getConfig(buildDir).distDir
const _dir = join(dir, dist)
- const _buildDir = join(buildDir, dist)
- const oldDir = join(buildDir, `${... | true |
Other | vercel | next.js | 8d2bbf940d52c8f44709a62bcd6d46ca34171e2d.json | Refactor the build server to remove tie to fs (#1656) | server/build/webpack.js | @@ -265,7 +265,7 @@ export default async function createCompiler (dir, { dev = false, quiet = false,
context: dir,
entry,
output: {
- path: join(buildDir || dir, config.distDir),
+ path: buildDir ? join(buildDir, '.next') : join(dir, config.distDir),
filename: '[name]',
libraryTar... | true |
Other | vercel | next.js | 9347c8bdd010742c55dde14c7975afb8e8704cf2.json | Specify a different build directory for #1513 (#1599)
* Update references to `.next`
* Remove console logs and extraneous semi colons
* Remove lint errors
* Update references to .next and update docs
* Update options from nested to flat with `distDir`
* Add integration tests, and update `.gitignore`
... | .gitignore | @@ -11,3 +11,5 @@ npm-debug.log
# coverage
.nyc_output
coverage
+
+.DS_Store | true |
Other | vercel | next.js | 9347c8bdd010742c55dde14c7975afb8e8704cf2.json | Specify a different build directory for #1513 (#1599)
* Update references to `.next`
* Remove console logs and extraneous semi colons
* Remove lint errors
* Update references to .next and update docs
* Update options from nested to flat with `distDir`
* Add integration tests, and update `.gitignore`
... | bin/next-build | @@ -22,8 +22,9 @@ if (argv.help) {
Usage
$ next build <dir>
- <dir> represents where the compiled .next folder should go.
- If no directory is provided, .next will be created in the current directory
+ <dir> represents where the compiled dist folder should go.
+ If no directory is provided, th... | true |
Other | vercel | next.js | 9347c8bdd010742c55dde14c7975afb8e8704cf2.json | Specify a different build directory for #1513 (#1599)
* Update references to `.next`
* Remove console logs and extraneous semi colons
* Remove lint errors
* Update references to .next and update docs
* Update options from nested to flat with `distDir`
* Add integration tests, and update `.gitignore`
... | bin/next-dev | @@ -29,8 +29,9 @@ if (argv.help) {
Usage
$ next dev <dir> -p <port number>
- <dir> represents where the compiled .next folder should go.
- If no directory is provided, .next will be created in the current directory
+ <dir> represents where the compiled folder should go.
+ If no directory is pr... | true |
Other | vercel | next.js | 9347c8bdd010742c55dde14c7975afb8e8704cf2.json | Specify a different build directory for #1513 (#1599)
* Update references to `.next`
* Remove console logs and extraneous semi colons
* Remove lint errors
* Update references to .next and update docs
* Update options from nested to flat with `distDir`
* Add integration tests, and update `.gitignore`
... | bin/next-start | @@ -4,6 +4,7 @@ import { resolve } from 'path'
import parseArgs from 'minimist'
import Server from '../server'
import { existsSync } from 'fs'
+import getConfig from '../server/config'
process.env.NODE_ENV = process.env.NODE_ENV || 'production'
@@ -32,9 +33,10 @@ if (argv.help) {
Usage
$ next start ... | true |
Other | vercel | next.js | 9347c8bdd010742c55dde14c7975afb8e8704cf2.json | Specify a different build directory for #1513 (#1599)
* Update references to `.next`
* Remove console logs and extraneous semi colons
* Remove lint errors
* Update references to .next and update docs
* Update options from nested to flat with `distDir`
* Add integration tests, and update `.gitignore`
... | readme.md | @@ -644,6 +644,17 @@ module.exports = {
}
```
+#### Setting a custom build directory
+
+You can specify a name to use for a custom build directory. For example, the following config will create a `build` folder instead of a `.next` folder. If no configuration is specified then next will create a `.next` folder.
+
+... | true |
Other | vercel | next.js | 9347c8bdd010742c55dde14c7975afb8e8704cf2.json | Specify a different build directory for #1513 (#1599)
* Update references to `.next`
* Remove console logs and extraneous semi colons
* Remove lint errors
* Update references to .next and update docs
* Update options from nested to flat with `distDir`
* Add integration tests, and update `.gitignore`
... | server/build/clean.js | @@ -1,6 +1,8 @@
import { resolve } from 'path'
import del from 'del'
+import getConfig from '../config'
export default function clean (dir) {
- return del(resolve(dir, '.next'))
+ const dist = getConfig(dir).distDir
+ return del(resolve(dir, dist))
} | true |
Other | vercel | next.js | 9347c8bdd010742c55dde14c7975afb8e8704cf2.json | Specify a different build directory for #1513 (#1599)
* Update references to `.next`
* Remove console logs and extraneous semi colons
* Remove lint errors
* Update references to .next and update docs
* Update options from nested to flat with `distDir`
* Add integration tests, and update `.gitignore`
... | server/build/index.js | @@ -1,5 +1,6 @@
import { tmpdir } from 'os'
import { join } from 'path'
+import getConfig from '../config'
import fs from 'mz/fs'
import uuid from 'uuid'
import del from 'del'
@@ -13,8 +14,10 @@ export default async function build (dir) {
try {
await runCompiler(compiler)
- await writeBuildStats(build... | true |
Other | vercel | next.js | 9347c8bdd010742c55dde14c7975afb8e8704cf2.json | Specify a different build directory for #1513 (#1599)
* Update references to `.next`
* Remove console logs and extraneous semi colons
* Remove lint errors
* Update references to .next and update docs
* Update options from nested to flat with `distDir`
* Add integration tests, and update `.gitignore`
... | server/build/replace.js | @@ -1,10 +1,13 @@
import mv from 'mv'
import { join } from 'path'
+import getConfig from '../config'
export default async function replaceCurrentBuild (dir, buildDir) {
- const _dir = join(dir, '.next')
- const _buildDir = join(buildDir, '.next')
- const oldDir = join(buildDir, '.next.old')
+ const dist = getC... | true |
Other | vercel | next.js | 9347c8bdd010742c55dde14c7975afb8e8704cf2.json | Specify a different build directory for #1513 (#1599)
* Update references to `.next`
* Remove console logs and extraneous semi colons
* Remove lint errors
* Update references to .next and update docs
* Update options from nested to flat with `distDir`
* Add integration tests, and update `.gitignore`
... | server/build/webpack.js | @@ -265,7 +265,7 @@ export default async function createCompiler (dir, { dev = false, quiet = false,
context: dir,
entry,
output: {
- path: join(buildDir || dir, '.next'),
+ path: join(buildDir || dir, config.distDir),
filename: '[name]',
libraryTarget: 'commonjs2',
publicP... | true |
Other | vercel | next.js | 9347c8bdd010742c55dde14c7975afb8e8704cf2.json | Specify a different build directory for #1513 (#1599)
* Update references to `.next`
* Remove console logs and extraneous semi colons
* Remove lint errors
* Update references to .next and update docs
* Update options from nested to flat with `distDir`
* Add integration tests, and update `.gitignore`
... | server/config.js | @@ -5,7 +5,8 @@ const cache = new Map()
const defaultConfig = {
webpack: null,
- poweredByHeader: true
+ poweredByHeader: true,
+ distDir: '.next'
}
export default function getConfig (dir) { | true |
Other | vercel | next.js | 9347c8bdd010742c55dde14c7975afb8e8704cf2.json | Specify a different build directory for #1513 (#1599)
* Update references to `.next`
* Remove console logs and extraneous semi colons
* Remove lint errors
* Update references to .next and update docs
* Update options from nested to flat with `distDir`
* Add integration tests, and update `.gitignore`
... | server/index.js | @@ -27,7 +27,8 @@ export default class Server {
this.hotReloader = dev ? new HotReloader(this.dir, { quiet }) : null
this.http = null
this.config = getConfig(this.dir)
- this.buildStats = !dev ? require(join(this.dir, '.next', 'build-stats.json')) : null
+ this.dist = this.config.distDir
+ this.... | true |
Other | vercel | next.js | 9347c8bdd010742c55dde14c7975afb8e8704cf2.json | Specify a different build directory for #1513 (#1599)
* Update references to `.next`
* Remove console logs and extraneous semi colons
* Remove lint errors
* Update references to .next and update docs
* Update options from nested to flat with `distDir`
* Add integration tests, and update `.gitignore`
... | server/render.js | @@ -3,6 +3,7 @@ import { createElement } from 'react'
import { renderToString, renderToStaticMarkup } from 'react-dom/server'
import send from 'send'
import requireModule from './require'
+import getConfig from './config'
import resolvePath from './resolve'
import readPage from './read-page'
import { Router } fro... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.