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 | fb496b7c9a2123ffd8b6f69b48a53ca044d42730.json | Run tests in Travis. (#1247)
* Run tests in Travis.
* Update deps and config.
* Update jest config.
* Disable a test temp.
* Increase the timeout. | test/integration/basic/test/index.test.js | @@ -22,7 +22,7 @@ context.app = nextServer({
quiet: true
})
-jasmine.DEFAULT_TIMEOUT_INTERVAL = 40000
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 2
describe('Basic Features', () => {
beforeAll(async () => { | true |
Other | vercel | next.js | fb496b7c9a2123ffd8b6f69b48a53ca044d42730.json | Run tests in Travis. (#1247)
* Run tests in Travis.
* Update deps and config.
* Update jest config.
* Disable a test temp.
* Increase the timeout. | yarn.lock | @@ -87,9 +87,11 @@ ansi-styles@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
-ansicolors@~0.2.1:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/ansicolors/-/ansicolors-0.2.1.tgz#be089599097b74a5c9c4a84a0... | true |
Other | vercel | next.js | 9ba7a10f85302d10ea36a2dbe8bdfd8efb45a2ba.json | Fix linting errors (#1235) | examples/with-refnux/helpers/getStore.js | @@ -4,7 +4,7 @@ let storeMemoized = null
const getStore = (initialState) => {
let store = null
- if (typeof window == 'undefined') {
+ if (typeof window === 'undefined') {
store = createStore(initialState)
} else {
if (!storeMemoized) {
@@ -15,4 +15,4 @@ const getStore = (initialState) => {
retu... | true |
Other | vercel | next.js | 9ba7a10f85302d10ea36a2dbe8bdfd8efb45a2ba.json | Fix linting errors (#1235) | examples/with-refnux/helpers/withRefnux.js | @@ -1,5 +1,4 @@
-import { Provider} from 'refnux'
-
+import {Provider} from 'refnux'
import getStore from './getStore'
// The `withRefnux` "decorator"
@@ -9,12 +8,11 @@ import getStore from './getStore'
// - passes `store` to Component's `getInitialProps` so that it can dispatch actions
const withRefnux = (getI... | true |
Other | vercel | next.js | 9ba7a10f85302d10ea36a2dbe8bdfd8efb45a2ba.json | Fix linting errors (#1235) | examples/with-refnux/pages/page1.js | @@ -14,7 +14,7 @@ const Page1 = connect(
<h3>{state.title}</h3>
<p>Current state: {JSON.stringify(state, null, 2)}</p>
<button onClick={() => dispatch(counterIncrement)} >Increment</button>
- <Link href="/page2"><button>go to page 2</button></Link>
+ <Link href='/page2'><button>go to page... | true |
Other | vercel | next.js | 9ba7a10f85302d10ea36a2dbe8bdfd8efb45a2ba.json | Fix linting errors (#1235) | examples/with-refnux/pages/page2.js | @@ -14,7 +14,7 @@ const Page2 = connect(
<h3>{state.title}</h3>
<p>Current state: {JSON.stringify(state, null, 2)}</p>
<button onClick={() => dispatch(counterIncrement)} >Increment</button>
- <Link href="/page1"><button>go to page 2</button></Link>
+ <Link href='/page1'><button>go to page... | true |
Other | vercel | next.js | 9ba7a10f85302d10ea36a2dbe8bdfd8efb45a2ba.json | Fix linting errors (#1235) | examples/with-refnux/store/counterIncrement.js | @@ -3,4 +3,4 @@ const counterIncrement = ({counter}, dispatch) => {
return { counter: counter + 1 }
}
-export default counterIncrement
\ No newline at end of file
+export default counterIncrement | true |
Other | vercel | next.js | 9ba7a10f85302d10ea36a2dbe8bdfd8efb45a2ba.json | Fix linting errors (#1235) | examples/with-refnux/store/getInitialState.js | @@ -3,6 +3,6 @@ const getInitialState = () => {
title: '',
counter: 0
}
-}
+}
-export default getInitialState
\ No newline at end of file
+export default getInitialState | true |
Other | vercel | next.js | 9ba7a10f85302d10ea36a2dbe8bdfd8efb45a2ba.json | Fix linting errors (#1235) | examples/with-refnux/store/getStore.js | @@ -4,7 +4,7 @@ const storeInitialState = { counter: 0, key: 'value' }
const getStore = () => {
let store = null
- if (typeof window == 'undefined') {
+ if (typeof window === 'undefined') {
store = createStore(storeInitialState)
} else {
store = window.store || createStore(storeInitialState)
@@ -13... | true |
Other | vercel | next.js | 9ba7a10f85302d10ea36a2dbe8bdfd8efb45a2ba.json | Fix linting errors (#1235) | examples/with-refnux/store/setTitle.js | @@ -3,4 +3,4 @@ const setTitle = (newTitle) => ({title}) => {
return { title: newTitle }
}
-export default setTitle
\ No newline at end of file
+export default setTitle | true |
Other | vercel | next.js | 22c22efc35ff70e498ca2ef8f46a76c8e0a6a3f7.json | Fix missing dependencies (#1232)
Tried to pull & run this example, it failed, complaining about missing react & react-dom dependencies | examples/with-global-stylesheet/package.json | @@ -14,6 +14,8 @@
"next": "^2.0.0-beta.18",
"node-sass": "^4.4.0",
"raw-loader": "^0.5.1",
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2",
"sass-loader": "^4.1.1"
},
"devDependencies": { | false |
Other | vercel | next.js | 0bd250f4aaf773287754ba6f40156a1ce79cc8fb.json | Handle BUILD_ID mismatch error (#1224)
* Reload the page if the buildIds are mismatch.
* Reload the browser with main.js and commons.js buildId mismatch.
* Implement proper reloading with an API to persist the state.
* Add some tests for force reload.
* Change _reload to _forceReload.
* Add a section ab... | lib/router/index.js | @@ -1,3 +1,4 @@
+/* global window, location */
import _Router from './router'
const SingletonRouter = {
@@ -75,3 +76,11 @@ export const createRouter = function (...args) {
// Export the actual Router class, which is usually used inside the server
export const Router = _Router
+
+export function _notifyBuildIdMi... | true |
Other | vercel | next.js | 0bd250f4aaf773287754ba6f40156a1ce79cc8fb.json | Handle BUILD_ID mismatch error (#1224)
* Reload the page if the buildIds are mismatch.
* Reload the browser with main.js and commons.js buildId mismatch.
* Implement proper reloading with an API to persist the state.
* Add some tests for force reload.
* Change _reload to _forceReload.
* Add a section ab... | lib/router/router.js | @@ -6,6 +6,7 @@ import evalScript from '../eval-script'
import shallowEquals from '../shallow-equals'
import PQueue from '../p-queue'
import { loadGetInitialProps, getLocationOrigin } from '../utils'
+import { _notifyBuildIdMismatch } from './'
// Add "fetch" polyfill for older browsers
if (typeof window !== 'un... | true |
Other | vercel | next.js | 0bd250f4aaf773287754ba6f40156a1ce79cc8fb.json | Handle BUILD_ID mismatch error (#1224)
* Reload the page if the buildIds are mismatch.
* Reload the browser with main.js and commons.js buildId mismatch.
* Implement proper reloading with an API to persist the state.
* Add some tests for force reload.
* Change _reload to _forceReload.
* Add a section ab... | readme.md | @@ -310,6 +310,7 @@ Here's a list of supported events:
- `routeChangeStart(url)` - Fires when a route starts to change
- `routeChangeComplete(url)` - Fires when a route changed completely
- `routeChangeError(err, url)` - Fires when there's an error when changing routes
+- `appUpdated(nextRoute)` - Fires when switchi... | true |
Other | vercel | next.js | 0bd250f4aaf773287754ba6f40156a1ce79cc8fb.json | Handle BUILD_ID mismatch error (#1224)
* Reload the page if the buildIds are mismatch.
* Reload the browser with main.js and commons.js buildId mismatch.
* Implement proper reloading with an API to persist the state.
* Add some tests for force reload.
* Change _reload to _forceReload.
* Add a section ab... | server/index.js | @@ -81,19 +81,30 @@ export default class Server {
},
'/_next/:buildId/main.js': async (req, res, params) => {
- this.handleBuildId(params.buildId, res)
+ if (!this.handleBuildId(params.buildId, res)) {
+ throwBuildIdMismatchError()
+ }
+
const p = join(this.dir, '.... | true |
Other | vercel | next.js | 0bd250f4aaf773287754ba6f40156a1ce79cc8fb.json | Handle BUILD_ID mismatch error (#1224)
* Reload the page if the buildIds are mismatch.
* Reload the browser with main.js and commons.js buildId mismatch.
* Implement proper reloading with an API to persist the state.
* Add some tests for force reload.
* Change _reload to _forceReload.
* Add a section ab... | test/integration/basic/test/misc.js | @@ -1,6 +1,6 @@
/* global describe, test, expect */
-export default function ({ app }) {
+export default function (context) {
describe('Misc', () => {
test('finishes response', async () => {
const res = {
@@ -9,7 +9,7 @@ export default function ({ app }) {
this.finished = true
}
... | true |
Other | vercel | next.js | 20c7d98efe0ce4483ff6d06e1ac1060f584530fb.json | Move lastAppProps back where it should be (#1208)
* Check for lastAppProps
* Move lastAppProps back where it belongs
* Add comment | client/index.js | @@ -77,11 +77,12 @@ async function doRender ({ Component, props, err, emitter }) {
props = props || lastAppProps.props
const appProps = { Component, props, err, router, headManager }
+ // lastAppProps has to be set before ReactDom.render to account for ReactDom throwing an error.
+ lastAppProps = appProps
+
... | false |
Other | vercel | next.js | e5844314e3b644e52d6d73b24dc66b6e1a508094.json | Fix linting errors (#1197) | examples/with-redux/pages/index.js | @@ -1,6 +1,6 @@
import React from 'react'
-import { reducer, initStore, startClock } from '../store'
-import withRedux from 'next-redux-wrapper';
+import { initStore, startClock } from '../store'
+import withRedux from 'next-redux-wrapper'
import Page from '../components/Page'
class Counter extends React.Componen... | true |
Other | vercel | next.js | e5844314e3b644e52d6d73b24dc66b6e1a508094.json | Fix linting errors (#1197) | examples/with-redux/pages/other.js | @@ -1,6 +1,6 @@
import React from 'react'
-import { reducer, initStore, startClock } from '../store'
-import withRedux from 'next-redux-wrapper';
+import { initStore, startClock } from '../store'
+import withRedux from 'next-redux-wrapper'
import Page from '../components/Page'
class Counter extends React.Componen... | true |
Other | vercel | next.js | bdd5b9ef3d25fb35fde33966520474c5fc4ec894.json | Add note for next-connect-redux #1193 (#1203) | examples/with-redux/README.md | @@ -35,7 +35,7 @@ Our page is located at `pages/index.js` so it will map the route `/`. To get the
For safety it is recommended to wrap all pages, no matter if they use Redux or not, so that you should not care about it anymore in all child components.
-`withRedux` function accepts `makeStore` as first argument, a... | false |
Other | vercel | next.js | 00590d71811eadc32c5d2d334bda09d7b682067c.json | Remove babelrc for preact example (#1194) | examples/using-preact/.babelrc | @@ -1,6 +0,0 @@
-{
- "presets": [
- "es2015",
- "react"
- ]
-} | false |
Other | vercel | next.js | 6e5d57dae93a104161f6d28ba4864fe1a2c21115.json | Add example `with-scoped-stylesheets-and-postcss` (#1146)
* Add example `with-external-stylesheets-and-postcss`
* :fire: Remove extra semi-colon
* :memo: Attribute `with-global-stylesheet`
* Force a new test
* :memo: Update README.md
* Rename `external` -> `scoped` | examples/with-scoped-stylesheets-and-postcss/.babelrc | @@ -0,0 +1,10 @@
+{
+ "presets": [
+ "next/babel"
+ ],
+ "plugins": [
+ ["wrap-in-js", {
+ "extensions": ["css$"]
+ }]
+ ]
+} | true |
Other | vercel | next.js | 6e5d57dae93a104161f6d28ba4864fe1a2c21115.json | Add example `with-scoped-stylesheets-and-postcss` (#1146)
* Add example `with-external-stylesheets-and-postcss`
* :fire: Remove extra semi-colon
* :memo: Attribute `with-global-stylesheet`
* Force a new test
* :memo: Update README.md
* Rename `external` -> `scoped` | examples/with-scoped-stylesheets-and-postcss/README.md | @@ -0,0 +1,53 @@
+# Scoped stylesheets with PostCSS example
+
+This is an example of using scoped stylesheets and PostCSS, heavily influenced by @davibe's [`with-global-stylesheet`](https://github.com/zeit/next.js/tree/master/examples/with-global-stylesheet).
+
+## How to use
+
+Download the example [or clone the repo]... | true |
Other | vercel | next.js | 6e5d57dae93a104161f6d28ba4864fe1a2c21115.json | Add example `with-scoped-stylesheets-and-postcss` (#1146)
* Add example `with-external-stylesheets-and-postcss`
* :fire: Remove extra semi-colon
* :memo: Attribute `with-global-stylesheet`
* Force a new test
* :memo: Update README.md
* Rename `external` -> `scoped` | examples/with-scoped-stylesheets-and-postcss/next.config.js | @@ -0,0 +1,43 @@
+module.exports = {
+ webpack: (config) => {
+ config.module.rules.push(
+ {
+ test: /\.css$/,
+ use: [
+ {
+ loader: 'emit-file-loader',
+ options: {
+ name: 'dist/[path][name].[ext]'
+ }
+ },
+ 'raw-loader... | true |
Other | vercel | next.js | 6e5d57dae93a104161f6d28ba4864fe1a2c21115.json | Add example `with-scoped-stylesheets-and-postcss` (#1146)
* Add example `with-external-stylesheets-and-postcss`
* :fire: Remove extra semi-colon
* :memo: Attribute `with-global-stylesheet`
* Force a new test
* :memo: Update README.md
* Rename `external` -> `scoped` | examples/with-scoped-stylesheets-and-postcss/package.json | @@ -0,0 +1,27 @@
+{
+ "name": "next.js-with-scoped-stylesheets-and-postcss",
+ "version": "1.0.0",
+ "description": "",
+ "scripts": {
+ "dev": "next dev",
+ "build": "next build",
+ "start": "next start"
+ },
+ "author": "Thomas Lindstrøm <t@hom.as>",
+ "license": "ISC",
+ "dependencies": {
+ "babe... | true |
Other | vercel | next.js | 6e5d57dae93a104161f6d28ba4864fe1a2c21115.json | Add example `with-scoped-stylesheets-and-postcss` (#1146)
* Add example `with-external-stylesheets-and-postcss`
* :fire: Remove extra semi-colon
* :memo: Attribute `with-global-stylesheet`
* Force a new test
* :memo: Update README.md
* Rename `external` -> `scoped` | examples/with-scoped-stylesheets-and-postcss/pages/index.js | @@ -0,0 +1,10 @@
+import React from 'react'
+import Head from 'next/head'
+import {stylesheet, classNames} from './styles.css'
+
+export default () => (
+ <p className={classNames.paragraph}>
+ <Head><style dangerouslySetInnerHTML={{__html: stylesheet}} /></Head>
+ bazinga
+ </p>
+) | true |
Other | vercel | next.js | 6e5d57dae93a104161f6d28ba4864fe1a2c21115.json | Add example `with-scoped-stylesheets-and-postcss` (#1146)
* Add example `with-external-stylesheets-and-postcss`
* :fire: Remove extra semi-colon
* :memo: Attribute `with-global-stylesheet`
* Force a new test
* :memo: Update README.md
* Rename `external` -> `scoped` | examples/with-scoped-stylesheets-and-postcss/pages/styles.css | @@ -0,0 +1,4 @@
+.paragraph {
+ font-size: 20px;
+ color: red;
+} | true |
Other | vercel | next.js | 6e5d57dae93a104161f6d28ba4864fe1a2c21115.json | Add example `with-scoped-stylesheets-and-postcss` (#1146)
* Add example `with-external-stylesheets-and-postcss`
* :fire: Remove extra semi-colon
* :memo: Attribute `with-global-stylesheet`
* Force a new test
* :memo: Update README.md
* Rename `external` -> `scoped` | examples/with-scoped-stylesheets-and-postcss/postcss.config.js | @@ -0,0 +1,5 @@
+module.exports = {
+ plugins: [
+ require('postcss-cssnext')()
+ ]
+} | true |
Other | vercel | next.js | 1e70324a41993da52eadfe5139943084da9af218.json | print a deprecated message for next/css (#421) | lib/css.js | @@ -1,5 +1,9 @@
const css = require('glamor')
+if (process.env.NODE_ENV !== 'production') {
+ console.error('Warning: \'next/css\' is deprecated. Please use styled-jsx syntax instead.')
+}
+
/**
* Expose style as default and the whole object as properties
* so it can be used as follows: | false |
Other | vercel | next.js | b62a0e8f5510b0636162cb1ef7a3f3ac9e282f46.json | Bundle all the modules inside the app (#414)
* Remove the use of CDN and bundle everything inside the app.
We still pre-build the prefetcher because it needs
different webpack config which only targets browsers
supports Service Workers.
* Remove cdn config item.
We no longer using it.
* Stop adding script ta... | client/next-dev.js | @@ -1,6 +1,4 @@
import 'react-hot-loader/patch'
import * as next from './next'
-import { requireModule } from '../lib/eval-script'
window.next = next
-module.exports = requireModule | true |
Other | vercel | next.js | b62a0e8f5510b0636162cb1ef7a3f3ac9e282f46.json | Bundle all the modules inside the app (#414)
* Remove the use of CDN and bundle everything inside the app.
We still pre-build the prefetcher because it needs
different webpack config which only targets browsers
supports Service Workers.
* Remove cdn config item.
We no longer using it.
* Stop adding script ta... | client/next.js | @@ -5,7 +5,7 @@ import domready from 'domready'
import { rehydrate } from '../lib/css'
import Router from '../lib/router'
import App from '../lib/app'
-import evalScript, { requireModule } from '../lib/eval-script'
+import evalScript from '../lib/eval-script'
const {
__NEXT_DATA__: {
@@ -41,5 +41,3 @@ domready... | true |
Other | vercel | next.js | b62a0e8f5510b0636162cb1ef7a3f3ac9e282f46.json | Bundle all the modules inside the app (#414)
* Remove the use of CDN and bundle everything inside the app.
We still pre-build the prefetcher because it needs
different webpack config which only targets browsers
supports Service Workers.
* Remove cdn config item.
We no longer using it.
* Stop adding script ta... | examples/shared-modules/package.json | @@ -12,8 +12,5 @@
"next": "*"
},
"author": "",
- "license": "ISC",
- "next": {
- "cdn": true
- }
+ "license": "ISC"
} | true |
Other | vercel | next.js | b62a0e8f5510b0636162cb1ef7a3f3ac9e282f46.json | Bundle all the modules inside the app (#414)
* Remove the use of CDN and bundle everything inside the app.
We still pre-build the prefetcher because it needs
different webpack config which only targets browsers
supports Service Workers.
* Remove cdn config item.
We no longer using it.
* Stop adding script ta... | gulpfile.js | @@ -71,69 +71,9 @@ gulp.task('copy-bench-fixtures', () => {
})
gulp.task('build', [
- 'build-dev-client',
- 'build-client',
'build-prefetcher'
])
-gulp.task('build-dev-client', ['compile-lib', 'compile-client'], () => {
- return gulp
- .src('dist/client/next-dev.js')
- .pipe(webpack({
- quiet: true,
-... | true |
Other | vercel | next.js | b62a0e8f5510b0636162cb1ef7a3f3ac9e282f46.json | Bundle all the modules inside the app (#414)
* Remove the use of CDN and bundle everything inside the app.
We still pre-build the prefetcher because it needs
different webpack config which only targets browsers
supports Service Workers.
* Remove cdn config item.
We no longer using it.
* Stop adding script ta... | lib/eval-script.js | @@ -1,32 +1,3 @@
-import React from 'react'
-import ReactDOM from 'react-dom'
-import App from '../lib/app'
-import Link from '../lib/link'
-import * as Prefetch from '../lib/prefetch'
-import * as Css from '../lib/css'
-import Head from '../lib/head'
-
-const modules = new Map([
- ['react', React],
- ['react-dom', R... | true |
Other | vercel | next.js | b62a0e8f5510b0636162cb1ef7a3f3ac9e282f46.json | Bundle all the modules inside the app (#414)
* Remove the use of CDN and bundle everything inside the app.
We still pre-build the prefetcher because it needs
different webpack config which only targets browsers
supports Service Workers.
* Remove cdn config item.
We no longer using it.
* Stop adding script ta... | package.json | @@ -63,7 +63,6 @@
"react": "15.4.1",
"react-dom": "15.4.1",
"react-hot-loader": "3.0.0-beta.6",
- "read-pkg-up": "2.0.0",
"send": "0.14.1",
"source-map-support": "0.4.6",
"strip-ansi": "3.0.1",
@@ -75,7 +74,6 @@
},
"devDependencies": {
"babel-eslint": "7.1.1",
- "babel-plu... | true |
Other | vercel | next.js | b62a0e8f5510b0636162cb1ef7a3f3ac9e282f46.json | Bundle all the modules inside the app (#414)
* Remove the use of CDN and bundle everything inside the app.
We still pre-build the prefetcher because it needs
different webpack config which only targets browsers
supports Service Workers.
* Remove cdn config item.
We no longer using it.
* Stop adding script ta... | server/build/webpack.js | @@ -18,7 +18,10 @@ export default async function createCompiler (dir, { dev = false } = {}) {
ignore: 'pages/_document.js'
})
- const entry = {}
+ const entry = {
+ 'main.js': dev ? require.resolve('../../client/next-dev') : require.resolve('../../client/next')
+ }
+
const defaultEntries = dev
?... | true |
Other | vercel | next.js | b62a0e8f5510b0636162cb1ef7a3f3ac9e282f46.json | Bundle all the modules inside the app (#414)
* Remove the use of CDN and bundle everything inside the app.
We still pre-build the prefetcher because it needs
different webpack config which only targets browsers
supports Service Workers.
* Remove cdn config item.
We no longer using it.
* Stop adding script ta... | server/config.js | @@ -3,7 +3,7 @@ import { readFile } from 'mz/fs'
const cache = new Map()
-const defaultConfig = { cdn: true }
+const defaultConfig = {}
export default function getConfig (dir) {
if (!cache.has(dir)) { | true |
Other | vercel | next.js | b62a0e8f5510b0636162cb1ef7a3f3ac9e282f46.json | Bundle all the modules inside the app (#414)
* Remove the use of CDN and bundle everything inside the app.
We still pre-build the prefetcher because it needs
different webpack config which only targets browsers
supports Service Workers.
* Remove cdn config item.
We no longer using it.
* Stop adding script ta... | server/document.js | @@ -1,12 +1,6 @@
import React, { Component, PropTypes } from 'react'
import htmlescape from 'htmlescape'
import { renderStatic } from 'glamor/server'
-import readPkgUp from 'read-pkg-up'
-
-const { pkg } = readPkgUp.sync({
- cwd: __dirname,
- normalize: false
-})
export default class Document extends Component ... | true |
Other | vercel | next.js | b62a0e8f5510b0636162cb1ef7a3f3ac9e282f46.json | Bundle all the modules inside the app (#414)
* Remove the use of CDN and bundle everything inside the app.
We still pre-build the prefetcher because it needs
different webpack config which only targets browsers
supports Service Workers.
* Remove cdn config item.
We no longer using it.
* Stop adding script ta... | server/index.js | @@ -55,6 +55,11 @@ export default class Server {
await this.serveStatic(req, res, p)
})
+ this.router.get('/_next/main.js', async (req, res, params) => {
+ const p = join(this.dir, '.next/main.js')
+ await this.serveStatic(req, res, p)
+ })
+
this.router.get('/_next/commons.js', async... | true |
Other | vercel | next.js | b62a0e8f5510b0636162cb1ef7a3f3ac9e282f46.json | Bundle all the modules inside the app (#414)
* Remove the use of CDN and bundle everything inside the app.
We still pre-build the prefetcher because it needs
different webpack config which only targets browsers
supports Service Workers.
* Remove cdn config item.
We no longer using it.
* Stop adding script ta... | server/render.js | @@ -3,7 +3,6 @@ import { createElement } from 'react'
import { renderToString, renderToStaticMarkup } from 'react-dom/server'
import requireModule from './require'
import read from './read'
-import getConfig from './config'
import Router from '../lib/router'
import Head, { defaultHead } from '../lib/head'
import ... | true |
Other | vercel | next.js | b62a0e8f5510b0636162cb1ef7a3f3ac9e282f46.json | Bundle all the modules inside the app (#414)
* Remove the use of CDN and bundle everything inside the app.
We still pre-build the prefetcher because it needs
different webpack config which only targets browsers
supports Service Workers.
* Remove cdn config item.
We no longer using it.
* Stop adding script ta... | test/integration.test.js | @@ -3,7 +3,7 @@
'use strict'
import { join } from 'path'
-import next from '../server/next'
+import next from '../dist/server/next'
const dir = join(__dirname, 'fixtures', 'basic')
const app = next({ | true |
Other | vercel | next.js | 561087fa0490afd024f8807c764fe5c4551f60a3.json | Fix typo in a href example (#1168) | README.md | @@ -361,7 +361,7 @@ import Link from 'next/link'
export default () => (
<nav>
<ul>
- <li><Link prefetch ref='/'><a>Home</a></Link></li>
+ <li><Link prefetch href='/'><a>Home</a></Link></li>
<li><Link prefetch href='/about'><a>About</a></Link></li>
<li><Link prefetch href='/contact'><a>C... | false |
Other | vercel | next.js | d8af41d6903e09e0b779c8199aa02fb1fec912cb.json | Add a way to disable running service workers. (#1167) | lib/router/router.js | @@ -10,6 +10,16 @@ import { loadGetInitialProps, getLocationOrigin } from '../utils'
// Add "fetch" polyfill for older browsers
if (typeof window !== 'undefined') {
require('whatwg-fetch')
+ // Unregister if there's an exisiting service worker.
+ // This is because we ship a service worker in previous version.
+... | false |
Other | vercel | next.js | fca186f9e7172fbbe6036ec08fcc1d41a64c51af.json | Remove pre-gzip support (#1155) | package.json | @@ -42,7 +42,6 @@
]
},
"dependencies": {
- "accepts": "1.3.3",
"ansi-html": "0.0.7",
"babel-core": "6.23.1",
"babel-generator": "6.22.0",
@@ -69,7 +68,6 @@
"is-windows-bash": "1.0.3",
"json-loader": "0.5.4",
"loader-utils": "0.2.16",
- "mime-types": "2.1.14",
"minimis... | true |
Other | vercel | next.js | fca186f9e7172fbbe6036ec08fcc1d41a64c51af.json | Remove pre-gzip support (#1155) | server/build/gzip.js | @@ -1,38 +0,0 @@
-import fs from 'fs'
-import path from 'path'
-import zlib from 'zlib'
-import glob from 'glob-promise'
-
-export default async function gzipAssets (dir) {
- const nextDir = path.resolve(dir, '.next')
-
- const coreAssets = [
- path.join(nextDir, 'commons.js'),
- path.join(nextDir, 'main.js')
-... | true |
Other | vercel | next.js | fca186f9e7172fbbe6036ec08fcc1d41a64c51af.json | Remove pre-gzip support (#1155) | server/build/index.js | @@ -4,7 +4,6 @@ import fs from 'mz/fs'
import uuid from 'uuid'
import del from 'del'
import webpack from './webpack'
-import gzipAssets from './gzip'
import replaceCurrentBuild from './replace'
export default async function build (dir) {
@@ -13,7 +12,6 @@ export default async function build (dir) {
try {
... | true |
Other | vercel | next.js | fca186f9e7172fbbe6036ec08fcc1d41a64c51af.json | Remove pre-gzip support (#1155) | server/index.js | @@ -8,8 +8,7 @@ import {
renderJSON,
renderErrorJSON,
sendHTML,
- serveStatic,
- serveStaticWithGzip
+ serveStatic
} from './render'
import Router from './router'
import HotReloader from './hot-reloader'
@@ -84,13 +83,13 @@ export default class Server {
'/_next/:buildId/main.js': async (req, res, ... | true |
Other | vercel | next.js | fca186f9e7172fbbe6036ec08fcc1d41a64c51af.json | Remove pre-gzip support (#1155) | server/render.js | @@ -2,9 +2,6 @@ import { join } from 'path'
import { createElement } from 'react'
import { renderToString, renderToStaticMarkup } from 'react-dom/server'
import send from 'send'
-import fs from 'mz/fs'
-import accepts from 'accepts'
-import mime from 'mime-types'
import requireModule from './require'
import resolv... | true |
Other | vercel | next.js | fca186f9e7172fbbe6036ec08fcc1d41a64c51af.json | Remove pre-gzip support (#1155) | test/integration/production/test/index.test.js | @@ -38,17 +38,6 @@ describe('Production Usage', () => {
})
describe('JSON pages', () => {
- describe('when asked for a gzipped page', () => {
- it('should serve the gzipped page', async () => {
- const url = `http://localhost:${appPort}/_next/${app.renderOpts.buildId}/pages`
- const res = ... | true |
Other | vercel | next.js | fca186f9e7172fbbe6036ec08fcc1d41a64c51af.json | Remove pre-gzip support (#1155) | yarn.lock | @@ -1,21 +1,12 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
-
-
abab@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d"
abbrev@1:
- version "1.0.9"
- resolved "https://registry.yarnpkg.com... | true |
Other | vercel | next.js | 540a86f007da211cd8aaea68ea50fd8739b3d3a4.json | fix prefetch url (#1154) | lib/link.js | @@ -61,8 +61,28 @@ export default class Link extends Component {
})
}
+ prefetch () {
+ if (!this.props.prefetch) return
+ if (typeof window === 'undefined') return
+
+ // Prefetch the JSON page if asked (only in the client)
+ const { pathname } = window.location
+ const href = resolve(pathn... | true |
Other | vercel | next.js | 540a86f007da211cd8aaea68ea50fd8739b3d3a4.json | fix prefetch url (#1154) | lib/prefetch.js | @@ -25,7 +25,7 @@ export default class LinkPrefetch extends React.Component {
wantLinkPrefetch()
const props = {
...this.props,
- prefetch: this.props.prefetch === false ? this.props.prefetch : true
+ prefetch: this.props.prefetch !== false
}
return (<Link {...props} />) | true |
Other | vercel | next.js | ff547752f05e18476ce7c95cc8155de3ac1b8997.json | Fix HMR issue with webpack-stats-analyzer (#1149)
* Use stats.json instead of running server
* Add suggested changes | examples/with-webpack-bundle-analyzer/README.md | @@ -7,7 +7,7 @@ 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/with-webpack-bundle-analyzer
-cd hello-world
+cd with-webpack-bundle-analyzer
```
Install it and run:
@@ -26,... | true |
Other | vercel | next.js | ff547752f05e18476ce7c95cc8155de3ac1b8997.json | Fix HMR issue with webpack-stats-analyzer (#1149)
* Use stats.json instead of running server
* Add suggested changes | examples/with-webpack-bundle-analyzer/next.config.js | @@ -4,11 +4,11 @@ module.exports = {
// Perform customizations to config
config.plugins.push(
new BundleAnalyzerPlugin({
+ analyzerMode: 'disabled',
// For all options see https://github.com/th0r/webpack-bundle-analyzer#as-plugin
- analyzerMode: 'server',
- analyzerHost: '... | true |
Other | vercel | next.js | ff547752f05e18476ce7c95cc8155de3ac1b8997.json | Fix HMR issue with webpack-stats-analyzer (#1149)
* Use stats.json instead of running server
* Add suggested changes | examples/with-webpack-bundle-analyzer/package.json | @@ -1,10 +1,11 @@
{
- "name": "hello-world",
+ "name": "with-webpack-bundle-analyzer",
"version": "1.0.0",
"scripts": {
"dev": "next",
"build": "next build",
- "start": "next start"
+ "start": "next start",
+ "bundle:view": "webpack-bundle-analyzer .next/stats.json"
},
"dependencies": ... | true |
Other | vercel | next.js | f3145ab1d10b0ec78efa9079cd6e887325022da9.json | remove editors section from .gitignore (#1148) | .gitignore | @@ -14,8 +14,3 @@ npm-debug.log
# coverage
.nyc_output
coverage
-
-# editors
-.idea/*
-*.iml
-*.sublime-* | false |
Other | vercel | next.js | 14c86bef1df0c9a390ea465d6454f84a2b223e2a.json | Introduce a simple prefetching solution (#957)
* Implement a very simple prefetching solution.
* Remove next-prefetcher.
* Require 'whatwg-fetch' only in the client.
* Use xhr in the code.
* Use a simple fetching solution.
* Fix 404 and xhr status issue.
* Move the prefetching implementation to next/... | README.md | @@ -344,48 +344,45 @@ Router.onRouteChangeError = (err, url) => {
<ul><li><a href="./examples/with-prefetching">Prefetching</a></li></ul>
</details></p>
-Next.js exposes a module that configures a `ServiceWorker` automatically to prefetch pages: `next/prefetch`.
+Next.js has an API which allows you to prefetch pa... | true |
Other | vercel | next.js | 14c86bef1df0c9a390ea465d6454f84a2b223e2a.json | Introduce a simple prefetching solution (#957)
* Implement a very simple prefetching solution.
* Remove next-prefetcher.
* Require 'whatwg-fetch' only in the client.
* Use xhr in the code.
* Use a simple fetching solution.
* Fix 404 and xhr status issue.
* Move the prefetching implementation to next/... | client/next-prefetcher.js | @@ -1,107 +0,0 @@
-/* global self */
-
-const CACHE_NAME = 'next-prefetcher-v1'
-const log = () => {}
-
-self.addEventListener('install', () => {
- log('Installing Next Prefetcher')
-})
-
-self.addEventListener('activate', (e) => {
- log('Activated Next Prefetcher')
- e.waitUntil(Promise.all([
- resetCache(),
- ... | true |
Other | vercel | next.js | 14c86bef1df0c9a390ea465d6454f84a2b223e2a.json | Introduce a simple prefetching solution (#957)
* Implement a very simple prefetching solution.
* Remove next-prefetcher.
* Require 'whatwg-fetch' only in the client.
* Use xhr in the code.
* Use a simple fetching solution.
* Fix 404 and xhr status issue.
* Move the prefetching implementation to next/... | examples/with-prefetching/components/Header.js | @@ -1,23 +1,23 @@
-import Link, { prefetch } from 'next/prefetch'
-import RegularLink from 'next/link'
+import Router from 'next/router'
+import Link from 'next/link'
export default () => (
<div>
{ /* Prefetch using the declarative API */ }
- <Link href='/'>
+ <Link prefetch href='/'>
<a>Home</a... | true |
Other | vercel | next.js | 14c86bef1df0c9a390ea465d6454f84a2b223e2a.json | Introduce a simple prefetching solution (#957)
* Implement a very simple prefetching solution.
* Remove next-prefetcher.
* Require 'whatwg-fetch' only in the client.
* Use xhr in the code.
* Use a simple fetching solution.
* Fix 404 and xhr status issue.
* Move the prefetching implementation to next/... | flyfile.js | @@ -1,7 +1,6 @@
const webpack = require('webpack')
const notifier = require('node-notifier')
const childProcess = require('child_process')
-const webpackConfig = require('./webpack.config')
const isWindows = /^win/.test(process.platform)
export async function compile(fly) {
@@ -42,15 +41,7 @@ export async functi... | true |
Other | vercel | next.js | 14c86bef1df0c9a390ea465d6454f84a2b223e2a.json | Introduce a simple prefetching solution (#957)
* Implement a very simple prefetching solution.
* Remove next-prefetcher.
* Require 'whatwg-fetch' only in the client.
* Use xhr in the code.
* Use a simple fetching solution.
* Fix 404 and xhr status issue.
* Move the prefetching implementation to next/... | lib/link.js | @@ -62,7 +62,7 @@ export default class Link extends Component {
}
render () {
- let { children } = this.props
+ let { children, prefetch } = this.props
// Deprecated. Warning shown by propType check. If the childen provided is a string (<Link>example</Link>) we wrap it in an <a> tag
if (typeof c... | true |
Other | vercel | next.js | 14c86bef1df0c9a390ea465d6454f84a2b223e2a.json | Introduce a simple prefetching solution (#957)
* Implement a very simple prefetching solution.
* Remove next-prefetcher.
* Require 'whatwg-fetch' only in the client.
* Use xhr in the code.
* Use a simple fetching solution.
* Fix 404 and xhr status issue.
* Move the prefetching implementation to next/... | lib/prefetch.js | @@ -1,150 +1,33 @@
-/* global __NEXT_DATA__ */
-
import React from 'react'
-import Link, { isLocal } from './link'
-import { parse as urlParse } from 'url'
-
-class Messenger {
- constructor () {
- this.id = 0
- this.callacks = {}
- this.serviceWorkerReadyCallbacks = []
- this.serviceWorkerState = null
-
... | true |
Other | vercel | next.js | 14c86bef1df0c9a390ea465d6454f84a2b223e2a.json | Introduce a simple prefetching solution (#957)
* Implement a very simple prefetching solution.
* Remove next-prefetcher.
* Require 'whatwg-fetch' only in the client.
* Use xhr in the code.
* Use a simple fetching solution.
* Fix 404 and xhr status issue.
* Move the prefetching implementation to next/... | lib/router/index.js | @@ -13,7 +13,7 @@ const SingletonRouter = {
// Create public properties and methods of the router in the SingletonRouter
const propertyFields = ['components', 'pathname', 'route', 'query']
-const coreMethodFields = ['push', 'replace', 'reload', 'back']
+const coreMethodFields = ['push', 'replace', 'reload', 'back',... | true |
Other | vercel | next.js | 14c86bef1df0c9a390ea465d6454f84a2b223e2a.json | Introduce a simple prefetching solution (#957)
* Implement a very simple prefetching solution.
* Remove next-prefetcher.
* Require 'whatwg-fetch' only in the client.
* Use xhr in the code.
* Use a simple fetching solution.
* Fix 404 and xhr status issue.
* Move the prefetching implementation to next/... | lib/router/router.js | @@ -1,11 +1,15 @@
-/* global __NEXT_DATA__ */
+/* global __NEXT_DATA__, fetch */
import { parse, format } from 'url'
import evalScript from '../eval-script'
import shallowEquals from '../shallow-equals'
import { EventEmitter } from 'events'
-import { reloadIfPrefetched } from '../prefetch'
-import { loadGetInitia... | true |
Other | vercel | next.js | 14c86bef1df0c9a390ea465d6454f84a2b223e2a.json | Introduce a simple prefetching solution (#957)
* Implement a very simple prefetching solution.
* Remove next-prefetcher.
* Require 'whatwg-fetch' only in the client.
* Use xhr in the code.
* Use a simple fetching solution.
* Fix 404 and xhr status issue.
* Move the prefetching implementation to next/... | lib/utils.js | @@ -54,6 +54,34 @@ export async function loadGetInitialProps (Component, ctx) {
return props
}
+export class LockManager {
+ constructor (maxLocks) {
+ this.maxLocks = maxLocks
+ this.clients = []
+ this.runningLocks = 0
+ }
+
+ get () {
+ return new Promise((resolve) => {
+ this.clients.push(... | true |
Other | vercel | next.js | 14c86bef1df0c9a390ea465d6454f84a2b223e2a.json | Introduce a simple prefetching solution (#957)
* Implement a very simple prefetching solution.
* Remove next-prefetcher.
* Require 'whatwg-fetch' only in the client.
* Use xhr in the code.
* Use a simple fetching solution.
* Fix 404 and xhr status issue.
* Move the prefetching implementation to next/... | package.json | @@ -85,6 +85,7 @@
"webpack": "2.2.1",
"webpack-dev-middleware": "1.10.0",
"webpack-hot-middleware": "2.16.1",
+ "whatwg-fetch": "^2.0.2",
"write-file-webpack-plugin": "3.4.2"
},
"devDependencies": { | true |
Other | vercel | next.js | 14c86bef1df0c9a390ea465d6454f84a2b223e2a.json | Introduce a simple prefetching solution (#957)
* Implement a very simple prefetching solution.
* Remove next-prefetcher.
* Require 'whatwg-fetch' only in the client.
* Use xhr in the code.
* Use a simple fetching solution.
* Fix 404 and xhr status issue.
* Move the prefetching implementation to next/... | test/unit/router.test.js | @@ -0,0 +1,87 @@
+/* global describe, it, expect */
+import Router from '../../dist/lib/router/router'
+
+describe('Router', () => {
+ describe('.prefetch()', () => {
+ it('should prefetch a given page', async () => {
+ const router = new Router('/', {})
+ const res = { aa: 'res' }
+ const route = 'r... | true |
Other | vercel | next.js | 14c86bef1df0c9a390ea465d6454f84a2b223e2a.json | Introduce a simple prefetching solution (#957)
* Implement a very simple prefetching solution.
* Remove next-prefetcher.
* Require 'whatwg-fetch' only in the client.
* Use xhr in the code.
* Use a simple fetching solution.
* Fix 404 and xhr status issue.
* Move the prefetching implementation to next/... | webpack.config.js | @@ -1,35 +0,0 @@
-const resolve = require('path').resolve
-const webpack = require('webpack')
-
-module.exports = {
- entry: './client/next-prefetcher.js',
- output: {
- filename: 'next-prefetcher-bundle.js',
- path: resolve(__dirname, 'dist/client')
- },
- plugins: [
- new webpack.DefinePlugin({
- 'p... | true |
Other | vercel | next.js | 14c86bef1df0c9a390ea465d6454f84a2b223e2a.json | Introduce a simple prefetching solution (#957)
* Implement a very simple prefetching solution.
* Remove next-prefetcher.
* Require 'whatwg-fetch' only in the client.
* Use xhr in the code.
* Use a simple fetching solution.
* Fix 404 and xhr status issue.
* Move the prefetching implementation to next/... | yarn.lock | @@ -4835,7 +4835,7 @@ whatwg-encoding@^1.0.1:
dependencies:
iconv-lite "0.4.13"
-whatwg-fetch@>=0.10.0:
+whatwg-fetch@>=0.10.0, whatwg-fetch@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.2.tgz#fe294d1d89e36c5be8b3195057f2e4bc74fc980e"
| true |
Other | vercel | next.js | 2c85b367ce5d3fa5da88914570fab654d722a295.json | Add notice about getInitialProps (#1140)
* Add notice about getInitialProps
* Remove extra whitespace | README.md | @@ -214,6 +214,8 @@ Notice that to load data when the page loads, we use `getInitialProps` which is
For the initial page load, `getInitialProps` will execute on the server only. `getInitialProps` will only be executed on the client when navigating to a different route via the `Link` component or using the routing AP... | false |
Other | vercel | next.js | 45e77d535f9d5b76374461c7a40b3adaa0f9ed85.json | Fix status messages on error (#1131)
* fix status messages on error
* error: use the special message for 404 | lib/error.js | @@ -1,4 +1,5 @@
import React from 'react'
+import HTTPStatus from 'http-status'
import Head from './head'
export default class Error extends React.Component {
@@ -11,7 +12,7 @@ export default class Error extends React.Component {
const { statusCode } = this.props
const title = statusCode === 404
?... | true |
Other | vercel | next.js | 45e77d535f9d5b76374461c7a40b3adaa0f9ed85.json | Fix status messages on error (#1131)
* fix status messages on error
* error: use the special message for 404 | package.json | @@ -65,6 +65,7 @@
"glamor": "2.20.23",
"glob-promise": "3.1.0",
"htmlescape": "1.1.1",
+ "http-status": "1.0.1",
"is-windows-bash": "1.0.3",
"json-loader": "0.5.4",
"loader-utils": "0.2.16", | true |
Other | vercel | next.js | 77c14f96b17e01e352ea1f6ad47fccd13bc63424.json | Add react-jsx-source for development (#1115) | package.json | @@ -53,6 +53,7 @@
"babel-plugin-transform-es2015-modules-commonjs": "6.22.0",
"babel-plugin-transform-object-rest-spread": "6.22.0",
"babel-plugin-transform-react-constant-elements": "^6.22.0",
+ "babel-plugin-transform-react-jsx-source": "^6.22.0",
"babel-plugin-transform-react-remove-prop-types... | true |
Other | vercel | next.js | 77c14f96b17e01e352ea1f6ad47fccd13bc63424.json | Add react-jsx-source for development (#1115) | server/build/babel/preset.js | @@ -1,11 +1,17 @@
-const isProduction = process.env.NODE_ENV === 'production'
const babelRuntimePath = require.resolve('babel-runtime/package')
.replace(/[\\/]package\.json$/, '')
-const productionPlugins = isProduction ? [
- require.resolve('babel-plugin-transform-react-constant-elements'),
- require.resolve('... | true |
Other | vercel | next.js | 77c14f96b17e01e352ea1f6ad47fccd13bc63424.json | Add react-jsx-source for development (#1115) | yarn.lock | @@ -729,7 +729,7 @@ babel-plugin-transform-react-jsx-self@^6.22.0:
babel-plugin-syntax-jsx "^6.8.0"
babel-runtime "^6.22.0"
-babel-plugin-transform-react-jsx-source@^6.22.0:
+babel-plugin-transform-react-jsx-source, babel-plugin-transform-react-jsx-source@^6.22.0:
version "6.22.0"
resolved "https://re... | true |
Other | vercel | next.js | b0d1e7e3d1ee29ccfa9acea9e3155dee7531c57f.json | Install peerDependencies in readme (#1116) | README.md | @@ -49,7 +49,7 @@ _**NOTE! the README on the `master` branch might not match that of the [latest s
Install it:
```bash
-npm install next --save
+npm install next react react-dom --save
```
and add a script to your package.json like this: | false |
Other | vercel | next.js | a0453a7b84425a02f33cfaa5eedbea5d8fd0a343.json | Add tests for behaviour mentioned in #1079 (#1084) | test/integration/basic/pages/nav/querystring.js | @@ -0,0 +1,22 @@
+import React from 'react'
+import Link from 'next/link'
+
+export default class AsyncProps extends React.Component {
+ static async getInitialProps ({ query: { id = 0 } }) {
+ return { id }
+ }
+
+ render () {
+ return (
+ <div>
+ <Link href={`/nav/querystring?id=${parseInt(this.p... | true |
Other | vercel | next.js | a0453a7b84425a02f33cfaa5eedbea5d8fd0a343.json | Add tests for behaviour mentioned in #1079 (#1084) | test/integration/basic/test/client-navigation.js | @@ -59,5 +59,29 @@ export default (context) => {
await browser.close()
})
})
+
+ describe('with the same page but different querystring', () => {
+ it('should navigate the page', async () => {
+ const browser = await webdriver(context.appPort, '/nav/querystring?id=1')
+ const ... | true |
Other | vercel | next.js | 66d97744e9b9bd8b48058ae93b7f95889f307c85.json | Improve contributing text (#1093) | CONTRIBUTING.md | @@ -5,6 +5,6 @@ Our Commitment to Open Source can be found [here](https://zeit.co/blog/oss)
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device.
2. Install the dependencies:... | false |
Other | vercel | next.js | 4fd2ca25989bdc48110655aa66e9b474ea229032.json | Improve quiet documentation (#1085) | README.md | @@ -443,7 +443,7 @@ The `next` API is as follows:
Supported options:
- `dev` (`bool`) whether to launch Next.js in dev mode - default `false`
- `dir` (`string`) where the Next project is located - default `'.'`
-- `quiet` (`bool`) Display error messages with server information - default `false`
+- `quiet` (`bool`) H... | false |
Other | vercel | next.js | f93bacfaba1054ae14c4907da22e80aac9a247ea.json | Use minimist string option for hostname (#1090)
* Use minimist string option
* Consistently use --hostname
* Code style
* Show hostname | bin/next-start | @@ -14,9 +14,15 @@ const argv = parseArgs(process.argv.slice(2), {
p: 'port'
},
boolean: ['h'],
+ string: ['H'],
default: { p: 3000 }
})
+if (argv.hostname === '') {
+ console.error(`> Provided hostname argument has no value`)
+ process.exit(1)
+}
+
if (argv.help) {
console.log(`
Descriptio... | true |
Other | vercel | next.js | f93bacfaba1054ae14c4907da22e80aac9a247ea.json | Use minimist string option for hostname (#1090)
* Use minimist string option
* Consistently use --hostname
* Code style
* Show hostname | server/index.js | @@ -130,11 +130,7 @@ export default class Server {
// This code catches EADDRINUSE error if the port is already in use
this.http.on('error', reject)
this.http.on('listening', () => resolve())
- if (hostname && typeof hostname !== 'boolean') {
- this.http.listen(port, hostname)
- } ... | true |
Other | vercel | next.js | 250c066de5f5beb1bf2832c176c61eaef264eb9f.json | Optimize React on `next build` (#1075)
* Optimize React
* Remove unused preset | package.json | @@ -52,6 +52,9 @@
"babel-plugin-transform-class-properties": "6.22.0",
"babel-plugin-transform-es2015-modules-commonjs": "6.22.0",
"babel-plugin-transform-object-rest-spread": "6.22.0",
+ "babel-plugin-transform-react-constant-elements": "^6.22.0",
+ "babel-plugin-transform-react-pure-class-to-func... | true |
Other | vercel | next.js | 250c066de5f5beb1bf2832c176c61eaef264eb9f.json | Optimize React on `next build` (#1075)
* Optimize React
* Remove unused preset | server/build/babel/preset.js | @@ -1,6 +1,13 @@
+const isProduction = process.env.NODE_ENV === 'production'
const babelRuntimePath = require.resolve('babel-runtime/package')
.replace(/[\\/]package\.json$/, '')
+const productionPlugins = isProduction ? [
+ require.resolve('babel-plugin-transform-react-constant-elements'),
+ require.resolve('b... | true |
Other | vercel | next.js | 250c066de5f5beb1bf2832c176c61eaef264eb9f.json | Optimize React on `next build` (#1075)
* Optimize React
* Remove unused preset | yarn.lock | @@ -1,7 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
-
-
abab@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d"
@@ -35,10 +33,6 @@ acorn-jsx@^3.0.0:
dependencies:
acorn "^3.0.4"
... | true |
Other | vercel | next.js | 15facf0ae1d3b1a750ef02370384f17acb499dcb.json | switch octal format (#1060) | flyfile.js | @@ -10,7 +10,7 @@ export async function compile(fly) {
}
export async function bin(fly, opts) {
- await fly.source(opts.src || 'bin/*').babel().target('dist/bin', {mode: 0o755})
+ await fly.source(opts.src || 'bin/*').babel().target('dist/bin', {mode: 0755})
notify('Compiled binaries')
}
| false |
Other | vercel | next.js | 864fe60a157d44c9338a43b9f98cdc4ad9891777.json | Write executable files to `dist/bin` (#1059)
* update to fly@2.0.4
* write executable dist/bin files | flyfile.js | @@ -10,7 +10,7 @@ export async function compile(fly) {
}
export async function bin(fly, opts) {
- await fly.source(opts.src || 'bin/*').babel().target('dist/bin')
+ await fly.source(opts.src || 'bin/*').babel().target('dist/bin', {mode: 0o755})
notify('Compiled binaries')
}
| true |
Other | vercel | next.js | 864fe60a157d44c9338a43b9f98cdc4ad9891777.json | Write executable files to `dist/bin` (#1059)
* update to fly@2.0.4
* write executable dist/bin files | package.json | @@ -95,7 +95,7 @@
"chromedriver": "^2.26.1",
"coveralls": "2.11.16",
"cross-env": "^3.1.4",
- "fly": "^2.0.3",
+ "fly": "^2.0.4",
"fly-babel": "^2.1.1",
"fly-clear": "^1.0.1",
"fly-esnext": "^2.0.0", | true |
Other | vercel | next.js | 864fe60a157d44c9338a43b9f98cdc4ad9891777.json | Write executable files to `dist/bin` (#1059)
* update to fly@2.0.4
* write executable dist/bin files | yarn.lock | @@ -2086,9 +2086,9 @@ fly-watch@^1.1.1:
arrify "^1.0.1"
chokidar "^1.6.1"
-fly@^2.0.3:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/fly/-/fly-2.0.3.tgz#a852589d21d2573b058bf0ba9c0055d9be8bf406"
+fly@^2.0.4:
+ version "2.0.4"
+ resolved "https://registry.yarnpkg.com/fly/-/fly-2.0.4.tgz#4d6b... | true |
Other | vercel | next.js | bfab00a3ee09c27910cfb2b4260d573b4f9db8a7.json | add react and react-dom to devDependencies again | package.json | @@ -104,6 +104,8 @@
"jest-cli": "^18.0.0",
"node-fetch": "^1.6.3",
"nyc": "^10.0.0",
+ "react": "15.4.2",
+ "react-dom": "15.4.2",
"run-sequence": "1.2.2",
"standard": "8.6.0",
"wd": "^1.1.3", | false |
Other | vercel | next.js | d6439d172b70e866becfa380af244bba9950fb6e.json | Add table of contents to README (#735)
* Fix example README formatting
* Add table of contents to README | README.md | @@ -6,10 +6,45 @@
Next.js is a minimalistic framework for server-rendered React applications.
-**NOTE! the README on the `master` branch might not match that of the [latest stable release](https://github.com/zeit/next.js/releases/latest)! **
+_**NOTE! the README on the `master` branch might not match that of the [... | false |
Other | vercel | next.js | bdcb0f78282fe1e564f11bfb1ff0c18de5eec30c.json | Add support to transpile import/export syntax (#1044)
next/babel doesn't transpile import/export.
So, we need to do it explicitly, but only for test env. | examples/with-jest/.babelrc | @@ -1,3 +1,15 @@
{
- "presets": ["next/babel"]
+ "env": {
+ "development": {
+ "presets": ["next/babel"]
+ },
+ "production": {
+ "presets": ["next/babel"]
+ },
+ "test": {
+ // next/babel does not transpile import/export syntax.
+ // So, using es2015 in the beginning will fix th... | true |
Other | vercel | next.js | bdcb0f78282fe1e564f11bfb1ff0c18de5eec30c.json | Add support to transpile import/export syntax (#1044)
next/babel doesn't transpile import/export.
So, we need to do it explicitly, but only for test env. | examples/with-jest/package.json | @@ -15,9 +15,8 @@
"babel-jest": "^18.0.0",
"enzyme": "^2.5.1",
"jest-cli": "^18.0.0",
- "react": "^15.3.2",
- "react-addons-test-utils": "^15.3.2",
- "react-dom": "^15.3.2",
- "react-test-renderer": "^15.4.1"
+ "react-addons-test-utils": "^15.4.2",
+ "babel-preset-es2015": "^6.22.0",
+ ... | true |
Other | vercel | next.js | 29e0c3eba0bd6e098f5dac9fd7c0d18c61228924.json | add react and react-dom to devDependencies | package.json | @@ -104,6 +104,8 @@
"node-fetch": "^1.6.3",
"nyc": "^10.0.0",
"portfinder": "^1.0.10",
+ "react": "15.4.2",
+ "react-dom": "15.4.2",
"run-sequence": "1.2.2",
"standard": "8.6.0",
"wd": "^1.1.3", | false |
Other | vercel | next.js | b9b35d406cd95e1cfeff03e7e5e4640db39eb300.json | Remove snippet that is not recommended. (#25220)
In general this means you did something wrong in your application (importing tests for example), so this should be fixed in the app, not using custom config. | docs/api-reference/next.config.js/custom-webpack-config.md | @@ -23,10 +23,6 @@ In order to extend our usage of `webpack`, you can define a function that extend
```js
module.exports = {
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
- // Note: we provide webpack above so you should not `require` it
- // Perform customizations to webpack co... | false |
Other | vercel | next.js | fb7342ac7c8e90f3ac08ff896fa5ad95ddc4d16c.json | Add default revalidate value to docs (#25238)
This makes sure to mention the default revalidate value is `false` or to not revalidate since it previously only mentions it's optional.
## Documentation / Examples
- [x] Make sure the linting passes | docs/basic-features/data-fetching.md | @@ -73,7 +73,7 @@ The `context` parameter is an object containing the following keys:
`getStaticProps` should return an object with:
- `props` - An **optional** object with the props that will be received by the page component. It should be a [serializable object](https://en.wikipedia.org/wiki/Serialization)
-- `re... | false |
Other | vercel | next.js | 0a31a92a3c6855ddb3e0da7028b44395d59dffbe.json | fix respomsive example tailwind (#24582)
Co-authored-by: JJ Kasper <jj@jjsweb.site> | examples/with-tailwindcss/pages/index.js | @@ -8,7 +8,7 @@ export default function Home() {
<link rel="icon" href="/favicon.ico" />
</Head>
- <main className="flex flex-col items-center justify-center flex-1 px-20 text-center">
+ <main className="flex flex-col items-center justify-center w-full flex-1 px-20 text-center">
<h1... | false |
Other | vercel | next.js | 5f30df2f061b4aad8199ea019990f4a1450acc75.json | docs(readme.md): add good first issue section to readme (#25085)
Co-authored-by: JJ Kasper <jj@jjsweb.site> | packages/next/README.md | @@ -44,6 +44,10 @@ Our [Code of Conduct](https://github.com/vercel/next.js/blob/canary/CODE_OF_COND
Please see our [contributing.md](/contributing.md).
+### Good First Issues
+
+We have a list of [good first issues](https://github.com/vercel/next.js/labels/good%20first%20issue) that contain bugs which have a relat... | false |
Other | vercel | next.js | 78b17351fb9265dc80329d3e331022f6ebc7d0ff.json | Fix typo in dev-build-watcher.js (#25196)
transtion -> transition | packages/next/client/dev/dev-build-watcher.js | @@ -66,7 +66,7 @@ export default function initializeBuildWatcher(toggleCallback) {
case 'built':
case 'sync':
isBuilding = false
- // Wait for the fade out transtion to complete
+ // Wait for the fade out transition to complete
timeoutId = setTimeout(() => {
isVi... | false |
Other | vercel | next.js | 1ab90c142c22e6e444488e4af5b308bcd33dd1e8.json | docs(image.md): update layout property part (#25149)
When I first read the documentation about the `layout` property, I wondered how to apply the `object-fit` css property to the `Image` component. I think it makes sense to mention its `objectFit` property at this point.
## Documentation / Examples
- [x] Make sure t... | docs/api-reference/next/image.md | @@ -101,8 +101,7 @@ When `responsive`, the image will scale the dimensions down for smaller
viewports and scale up for larger viewports.
When `fill`, the image will stretch both width and height to the dimensions of
-the parent element, usually paired with
-[object-fit](https://developer.mozilla.org/en-US/docs/Web/... | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.