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 | b31819fa50806fe44338c247ee338f928bdd6768.json | Remove build directory | build/webpack/plugins/terser-webpack-plugin/src/TaskRunner.js | @@ -1,106 +0,0 @@
-import os from 'os';
-
-import cacache from 'cacache';
-import findCacheDir from 'find-cache-dir';
-import workerFarm from 'worker-farm';
-import serialize from 'serialize-javascript';
-
-import minify from './minify';
-
-const worker = require.resolve('./worker');
-
-export default class TaskRunner ... | true |
Other | vercel | next.js | b31819fa50806fe44338c247ee338f928bdd6768.json | Remove build directory | build/webpack/plugins/terser-webpack-plugin/src/cjs.js | @@ -1,3 +0,0 @@
-const plugin = require('./index');
-
-module.exports = plugin.default; | true |
Other | vercel | next.js | b31819fa50806fe44338c247ee338f928bdd6768.json | Remove build directory | build/webpack/plugins/terser-webpack-plugin/src/index.js | @@ -1,423 +0,0 @@
-/* eslint-disable
- no-param-reassign
-*/
-import crypto from 'crypto';
-import path from 'path';
-
-import { SourceMapConsumer } from 'source-map';
-import { SourceMapSource, RawSource, ConcatSource } from 'webpack-sources';
-import RequestShortener from 'webpack/lib/RequestShortener';
-import Modu... | true |
Other | vercel | next.js | b31819fa50806fe44338c247ee338f928bdd6768.json | Remove build directory | build/webpack/plugins/terser-webpack-plugin/src/minify.js | @@ -1,186 +0,0 @@
-/* eslint-disable
- arrow-body-style
-*/
-import { minify as terserMinify } from 'terser';
-
-const buildTerserOptions = ({
- ecma,
- warnings,
- parse = {},
- compress = {},
- mangle,
- module,
- output,
- toplevel,
- nameCache,
- ie8,
- /* eslint-disable camelcase */
- keep_classnames,... | true |
Other | vercel | next.js | b31819fa50806fe44338c247ee338f928bdd6768.json | Remove build directory | build/webpack/plugins/terser-webpack-plugin/src/options.json | @@ -1,169 +0,0 @@
-{
- "additionalProperties": false,
- "definitions": {
- "file-conditions": {
- "anyOf": [
- {
- "instanceof": "RegExp"
- },
- {
- "type": "string"
- }
- ]
- }
- },
- "properties": {
- "test": {
- "anyOf": [
- {
- ... | true |
Other | vercel | next.js | b31819fa50806fe44338c247ee338f928bdd6768.json | Remove build directory | build/webpack/plugins/terser-webpack-plugin/src/worker.js | @@ -1,21 +0,0 @@
-import minify from './minify';
-
-module.exports = (options, callback) => {
- try {
- // 'use strict' => this === undefined (Clean Scope)
- // Safer for possible security issues, albeit not critical at all here
- // eslint-disable-next-line no-new-func, no-param-reassign
- options = new F... | true |
Other | vercel | next.js | b05df7087212ba4384d8aec93c769089491a1b27.json | Fix first render of with-react-helmet example (#6235) | examples/with-react-helmet/README.md | @@ -46,4 +46,5 @@ now
This an minimalistic example of how to combine next.js and [react-helmet](https://github.com/nfl/react-helmet).
The title of the page shall be changed to "Hello next.js!"
+If you go to the page `/about`, the title will be overridden to "About | Hello next.js!"
The rest is all up to you. | true |
Other | vercel | next.js | b05df7087212ba4384d8aec93c769089491a1b27.json | Fix first render of with-react-helmet example (#6235) | examples/with-react-helmet/pages/_app.js | @@ -0,0 +1,33 @@
+import React from 'react'
+import App, { Container } from 'next/app'
+import Helmet from 'react-helmet'
+
+export default class MyApp extends App {
+ static async getInitialProps ({ Component, ctx }) {
+ let pageProps = {}
+
+ if (Component.getInitialProps) {
+ pageProps = await Component.... | true |
Other | vercel | next.js | b05df7087212ba4384d8aec93c769089491a1b27.json | Fix first render of with-react-helmet example (#6235) | examples/with-react-helmet/pages/_document.js | @@ -26,24 +26,10 @@ export default class extends Document {
.map(el => this.props.helmet[el].toComponent())
}
- get helmetJsx () {
- return (
- <Helmet
- htmlAttributes={{ lang: 'en' }}
- title='Hello next.js!'
- meta={[
- { name: 'viewport', content: 'width=device-wid... | true |
Other | vercel | next.js | b05df7087212ba4384d8aec93c769089491a1b27.json | Fix first render of with-react-helmet example (#6235) | examples/with-react-helmet/pages/about.js | @@ -1,24 +1,14 @@
import React from 'react'
import Helmet from 'react-helmet'
-export default class About extends React.Component {
- static async getInitialProps ({ req }) {
- if (req) {
- Helmet.renderStatic()
- }
- return { title: 'About' }
- }
-
- render () {
- const { title } = this.props
-... | true |
Other | vercel | next.js | 63c25a9c60215b8829c2a0abca1434dc15c45eab.json | update preset.ts to use isProduction variable (#6234) | packages/next/build/babel/preset.ts | @@ -79,7 +79,7 @@ module.exports = (context: any, options: NextBabelPresetOptions = {}): BabelPres
...options['transform-runtime']
}],
[require('styled-jsx/babel'), styledJsxOptions(options['styled-jsx'])],
- process.env.NODE_ENV === 'production' && require('babel-plugin-transform-react-remo... | false |
Other | vercel | next.js | ad84d23a02550663a10502cdec148e126935f795.json | Add a space on README (#5574)
Hi
Just add a space on README. That line should be same as [here](https://github.com/zeit/next.js/blob/canary/examples/using-with-router/components/ActiveLink.js#L10) | packages/next/README.md | @@ -676,7 +676,7 @@ import { withRouter } from 'next/router'
const ActiveLink = ({ children, router, href }) => {
const style = {
marginRight: 10,
- color: router.pathname === href? 'red' : 'black'
+ color: router.pathname === href ? 'red' : 'black'
}
const handleClick = (e) => { | false |
Other | vercel | next.js | e8a9472bcd1a402f7d5925e4cac6774ebb62c2ec.json | Remove broken link from progressive-render example (#5552)
- Looks like no other example provides a link to a hosted demo
- There is the "Deploy to now" badge, so it can be deployed on demand when needed
- The link is broken anyway
- Probably any example hosted by an individual contributor sooner or later will be c... | examples/progressive-render/README.md | @@ -48,5 +48,3 @@ This example features:
* An app with a component that must only be rendered in the client
* A loading component that will be displayed before rendering the client-only component
-
-**Example**: https://progressive-render-raceuevkqw.now.sh/ | false |
Other | vercel | next.js | 98568046a328ec4fb050d8770ac1d06f69e509fc.json | Add PropType validation for next/head children (#5504)
Give `Head` a more detailed error messages in dev mode by validating the children prop's PropTypes. | packages/next-server/lib/head.js | @@ -100,4 +100,12 @@ function unique () {
}
}
+if (process.env.NODE_ENV === 'development') {
+ const exact = require('prop-types-exact')
+
+ Head.propTypes = exact({
+ children: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf(PropTypes.element)]).isRequired
+ })
+}
+
export default sideEffect(red... | false |
Other | vercel | next.js | 2c343baeba79d9f1f9ef73e27715a60e9bb842ea.json | Fix issue with HMR not working (#5544)
Change the ignore patterns to ignore `.git/` folder.
Add Windows pattern matching for `.next/` and `.git/` folders.
Fixes #5429 | packages/next/server/hot-reloader.js | @@ -309,11 +309,11 @@ export default class HotReloader {
this.prevChunkHashes = chunkHashes
})
- // We don’t watch .git .next/ and node_modules for changes
+ // We don’t watch .git/ .next/ and node_modules for changes
const ignored = [
- /\.git/,
- /\.next\//,
- /node_modules/
+ ... | false |
Other | vercel | next.js | a7b6ffa9148310e1ba9c7cbbf404e82c43b17e5e.json | Fix ssr auth bug and dependency problems (#5543)
* fix graphql dep
* fix ssr auth bug
* fix linting issues | examples/with-apollo-auth/lib/withApollo.js | @@ -22,9 +22,8 @@ export default App => {
static async getInitialProps (ctx) {
const { Component, router, ctx: { req, res } } = ctx
- const token = parseCookies(req).token
const apollo = initApollo({}, {
- getToken: () => token
+ getToken: () => parseCookies(req).token
})
... | true |
Other | vercel | next.js | a7b6ffa9148310e1ba9c7cbbf404e82c43b17e5e.json | Fix ssr auth bug and dependency problems (#5543)
* fix graphql dep
* fix ssr auth bug
* fix linting issues | examples/with-apollo-auth/package.json | @@ -12,7 +12,7 @@
"apollo-boost": "^0.1.6",
"apollo-link-context": "^1.0.8",
"cookie": "^0.3.1",
- "graphql": "^0.13.2",
+ "graphql": "14.0.2",
"isomorphic-unfetch": "^2.0.0",
"next": "latest",
"prop-types": "^15.6.1", | true |
Other | vercel | next.js | 1770efad6340bc7325b919049eecfc8a743c6c7f.json | Fix typo in router error message (#5515)
Tiny typo fix 🙂 | packages/next-server/lib/EventEmitter.js | @@ -7,7 +7,7 @@ export default class EventEmitter {
}
if (this.listeners[event].has(cb)) {
- throw new Error(`The listener already exising in event: ${event}`)
+ throw new Error(`Listener already exists for router event: \`${event}\``)
}
this.listeners[event].add(cb) | true |
Other | vercel | next.js | 1770efad6340bc7325b919049eecfc8a743c6c7f.json | Fix typo in router error message (#5515)
Tiny typo fix 🙂 | test/unit/EventEmitter.test.js | @@ -69,7 +69,7 @@ describe('EventEmitter', () => {
const run = () => ev.on('sample', cb)
- expect(run).toThrow(/The listener already exising in event: sample/)
+ expect(run).toThrow(/Listener already exists for router event: `sample`/)
})
it('should support chaining like the nodejs Even... | true |
Other | vercel | next.js | f43079659c09b49449df265bb6f7d0c391cdae7e.json | Include node v10 for travis ci (#5490) | .travis.yml | @@ -8,7 +8,7 @@
}
},
language: "node_js",
- node_js: ["8"],
+ node_js: ["8", "10"],
cache: {
directories: ["node_modules"]
}, | false |
Other | vercel | next.js | 4be4452fd8ec1a7def00b15f86b2e258d22cb4d2.json | Add cloud9 (c9.io) to examples (#5448) | examples/with-cloud9/README.md | @@ -0,0 +1,58 @@
+# With Cloud 9 (c9.io) #
+
+## Install NVM and set node to the latest version ##
+
+Cloud 9 environment comes with a preinstalled nvm, but its better to use the latest
+version - follow the install instructions from the [NVM Github page](https://github.com/creationix/nvm)
+
+Then download nvm package ... | true |
Other | vercel | next.js | 4be4452fd8ec1a7def00b15f86b2e258d22cb4d2.json | Add cloud9 (c9.io) to examples (#5448) | examples/with-cloud9/package.json | @@ -0,0 +1,15 @@
+{
+ "name": "with-cloud9",
+ "version": "1.0.0",
+ "scripts": {
+ "dev": "node server.js",
+ "build": "next build",
+ "start": "NODE_ENV=production node server.js"
+ },
+ "license": "ISC",
+ "dependencies": {
+ "next": "^7.0.2",
+ "react": "^16.5.2",
+ "react-dom": "^16.5.2"
+ ... | true |
Other | vercel | next.js | 4be4452fd8ec1a7def00b15f86b2e258d22cb4d2.json | Add cloud9 (c9.io) to examples (#5448) | examples/with-cloud9/pages/index.js | @@ -0,0 +1 @@
+export default () => "If everything works, you should be able to see me."
\ No newline at end of file | true |
Other | vercel | next.js | 4be4452fd8ec1a7def00b15f86b2e258d22cb4d2.json | Add cloud9 (c9.io) to examples (#5448) | examples/with-cloud9/server.js | @@ -0,0 +1,25 @@
+// This file doesn't go through babel or webpack transformation.
+// Make sure the syntax and sources this file requires are compatible with the current node version you are running
+// See https://github.com/zeit/next.js/issues/1245 for discussions on Universal Webpack or universal Babel
+const { cre... | true |
Other | vercel | next.js | 3e72da686f91394d473ca43da3e37c07e07da2b0.json | upgrade react-native-web to fix bug (#5459) | examples/with-react-native-web/package.json | @@ -11,6 +11,6 @@
"react": "^16.4.1",
"react-art": "^16.4.1",
"react-dom": "^16.4.1",
- "react-native-web": "^0.8.8"
+ "react-native-web": "0.9.3"
}
} | false |
Other | vercel | next.js | 398dcd42813dc4074bfc319259d543e77fd1d090.json | Fix typo on README.md (#5484)
Just a quick typo fix on Multi Zones documentation :) | packages/next/README.md | @@ -1694,7 +1694,7 @@ You can use [micro proxy](https://github.com/zeit/micro-proxy) as your local pro
}
```
-For the production deployment, you can use the [path alias](https://zeit.co/docs/features/path-aliases) feature if you are using [ZEIT now](https://zeit.co/now). Otherwise, you can configure your existing p... | false |
Other | vercel | next.js | 9634bad79d3c17ee1b48a6c1e5a66d5ee8c5441a.json | Remove note on OSS/non-OSS issue (#5474)
I successfully deployed this example with `now` and `now --public` (I am on premium plan).
Did this before deploy
```sh
$ cp Dockerfile.multistage Dockerfile
``` | examples/with-docker/README.md | @@ -47,12 +47,10 @@ Deploy it to the cloud with [now](https://zeit.co/now) ([download](https://zeit.
now --docker -e API_URL="https://example.com"
```
->*Note: Multi-stage only works in OSS plan. [\[#962\]](https://github.com/zeit/now-cli/issues/962#issuecomment-383860104)*
-
## The idea behind the example
This... | false |
Other | vercel | next.js | 619ba0000124f2b1fce5d9c763f92419df556282.json | Fix typos on comments (#5457)
Hello,
Here is a small PR to fix some typos on the comments. | examples/with-dynamic-import/pages/index.js | @@ -63,7 +63,7 @@ export default class Index extends React.Component {
<div>
<Header />
- {/* Load immediately, but in a sepeate bundle */}
+ {/* Load immediately, but in a separate bundle */}
<DynamicComponent1 />
{/* Show a progress indicator while loading */}
@@ -7... | false |
Other | vercel | next.js | 61fe50a493849f099355bdb42189e26a3f5d4f56.json | Update husky & lint-staged (#5389)
* Update husky & lint-staged
* Move to pre-commit package
* Include bin files
* Remove husky | package.json | @@ -13,13 +13,14 @@
"pretest": "npm run lint",
"test": "cross-env npm run testall || npm run testall",
"coveralls": "nyc --instrument=false --source-map=false report --temp-directory=./coverage --reporter=text-lcov | coveralls",
- "precommit": "lint-staged",
"lint": "lerna run lint",
- "prepub... | false |
Other | vercel | next.js | 6dcc9bd59a1ad8200f28d32ffe07a805a9fa5368.json | feat: add dynamic layouts with _app.js example (#5420)
Regarding a question about having different global layouts via `_app.js` usage, it came up that we could use a static property in the page that needed a different one(Thanks @timneutkens )
Link to the Spectrum post: https://spectrum.chat/?t=af6ca794-5420-4780-a... | examples/with-dynamic-app-layout/layouts/BlueLayout.js | @@ -0,0 +1,5 @@
+export default ({ children }) => {
+ return <main style={{ border: '4px dashed blue' }}>
+ {children}
+ </main>
+} | true |
Other | vercel | next.js | 6dcc9bd59a1ad8200f28d32ffe07a805a9fa5368.json | feat: add dynamic layouts with _app.js example (#5420)
Regarding a question about having different global layouts via `_app.js` usage, it came up that we could use a static property in the page that needed a different one(Thanks @timneutkens )
Link to the Spectrum post: https://spectrum.chat/?t=af6ca794-5420-4780-a... | examples/with-dynamic-app-layout/layouts/GreenLayout.js | @@ -0,0 +1,5 @@
+export default ({ children }) => {
+ return <main style={{ border: '4px dashed green' }}>
+ {children}
+ </main>
+} | true |
Other | vercel | next.js | 6dcc9bd59a1ad8200f28d32ffe07a805a9fa5368.json | feat: add dynamic layouts with _app.js example (#5420)
Regarding a question about having different global layouts via `_app.js` usage, it came up that we could use a static property in the page that needed a different one(Thanks @timneutkens )
Link to the Spectrum post: https://spectrum.chat/?t=af6ca794-5420-4780-a... | examples/with-dynamic-app-layout/layouts/RedLayout.js | @@ -0,0 +1,5 @@
+export default ({ children }) => {
+ return <main style={{ border: '4px dashed red' }}>
+ {children}
+ </main>
+} | true |
Other | vercel | next.js | 6dcc9bd59a1ad8200f28d32ffe07a805a9fa5368.json | feat: add dynamic layouts with _app.js example (#5420)
Regarding a question about having different global layouts via `_app.js` usage, it came up that we could use a static property in the page that needed a different one(Thanks @timneutkens )
Link to the Spectrum post: https://spectrum.chat/?t=af6ca794-5420-4780-a... | examples/with-dynamic-app-layout/pages/_app.js | @@ -0,0 +1,13 @@
+import React from 'react'
+import App, { Container } from 'next/app'
+
+export default class MyApp extends App {
+ render () {
+ const { Component, pageProps } = this.props
+ return <Container>
+ <Component.Layout>
+ <Component {...pageProps} />
+ </Component.Layout>
+ </Con... | true |
Other | vercel | next.js | 6dcc9bd59a1ad8200f28d32ffe07a805a9fa5368.json | feat: add dynamic layouts with _app.js example (#5420)
Regarding a question about having different global layouts via `_app.js` usage, it came up that we could use a static property in the page that needed a different one(Thanks @timneutkens )
Link to the Spectrum post: https://spectrum.chat/?t=af6ca794-5420-4780-a... | examples/with-dynamic-app-layout/pages/green.js | @@ -0,0 +1,15 @@
+import React from 'react'
+import Link from 'next/link'
+
+import GreenLayout from '../layouts/GreenLayout'
+
+const GreenPage = () => {
+ return <p>
+ This is the <strong style={{ color: 'green' }}>Green</strong> page, it's borders are green<br /><br />
+ Go back to the <Link href='/'><a style... | true |
Other | vercel | next.js | 6dcc9bd59a1ad8200f28d32ffe07a805a9fa5368.json | feat: add dynamic layouts with _app.js example (#5420)
Regarding a question about having different global layouts via `_app.js` usage, it came up that we could use a static property in the page that needed a different one(Thanks @timneutkens )
Link to the Spectrum post: https://spectrum.chat/?t=af6ca794-5420-4780-a... | examples/with-dynamic-app-layout/pages/index.js | @@ -0,0 +1,16 @@
+import React from 'react'
+import Link from 'next/link'
+
+import BlueLayout from '../layouts/BlueLayout'
+
+const BluePage = () => {
+ return <p>
+ This is the <strong style={{ color: 'blue' }}>Blue</strong> page, it's borders are blue<br /><br />
+ Go to the <Link href='/red'><a style={{ colo... | true |
Other | vercel | next.js | 6dcc9bd59a1ad8200f28d32ffe07a805a9fa5368.json | feat: add dynamic layouts with _app.js example (#5420)
Regarding a question about having different global layouts via `_app.js` usage, it came up that we could use a static property in the page that needed a different one(Thanks @timneutkens )
Link to the Spectrum post: https://spectrum.chat/?t=af6ca794-5420-4780-a... | examples/with-dynamic-app-layout/pages/red.js | @@ -0,0 +1,15 @@
+import React from 'react'
+import Link from 'next/link'
+
+import RedLayout from '../layouts/RedLayout'
+
+const RedPage = () => {
+ return <p>
+ This is the <strong style={{ color: 'red' }} >Red</strong> page, it's borders are red<br /><br />
+ Go back to the <Link href='/'><a>Blue Page</a></L... | true |
Other | vercel | next.js | 6dcc9bd59a1ad8200f28d32ffe07a805a9fa5368.json | feat: add dynamic layouts with _app.js example (#5420)
Regarding a question about having different global layouts via `_app.js` usage, it came up that we could use a static property in the page that needed a different one(Thanks @timneutkens )
Link to the Spectrum post: https://spectrum.chat/?t=af6ca794-5420-4780-a... | examples/with-dynamic-app-layout/readme.md | @@ -0,0 +1,45 @@
+[](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/with-dynamic-app-layout)
+
+# With dynamic `App` layout example
+
+## How to use
+
+### Using `create-next-app`
+
+Execute [`create-next-app`](https://github.com... | true |
Other | vercel | next.js | 409cf71a4d8296251c07b118e9da43bab98424c0.json | Move styled-jsx to external modules (#5403) | packages/next/build/webpack.js | @@ -32,7 +32,7 @@ function externalsConfig (dir, isServer) {
return externals
}
- const notExternalModules = ['next/app', 'next/document', 'next/error', 'http-status']
+ const notExternalModules = ['next/app', 'next/document', 'next/error', 'http-status', 'styled-jsx']
externals.push((context, request,... | false |
Other | vercel | next.js | 8ac4561745ae41e069b2a872c3c371219e84d415.json | Remove AppVeyor artefacts (#5398) | appveyor.yml | @@ -1,24 +0,0 @@
-environment:
- matrix:
- - nodejs_version: "8"
-
-# Install scripts. (runs after repo cloning)
-install:
- # Install Google Chrome for e2e testing
- - choco install --ignore-checksums googlechrome
- # Get the latest stable version of Node.js or io.js
- - ps: Install-Product node $env:nodejs_ve... | true |
Other | vercel | next.js | 8ac4561745ae41e069b2a872c3c371219e84d415.json | Remove AppVeyor artefacts (#5398) | packages/next/README.md | @@ -2,7 +2,6 @@
[](https://www.npmjs.com/package/next)
[](https://travis-ci.org/zeit/next.js)
-[](https://ci... | true |
Other | vercel | next.js | ef01f13e5d4d2f01b9edcc7efd4f1767f9115cbc.json | Improve test setup (#5388)
* Update jest
* Let jest start chromedriver
This makes sure chromedriver always ends even if the test was canceled by the user.
* Properly close browser in production-config test
* Properly close browser in production/security test
* Properly close browser in export test
* ... | package.json | @@ -7,11 +7,9 @@
"scripts": {
"lerna": "lerna",
"bootstrap": "lerna bootstrap",
- "pretestonly": "taskr pretest",
"dev": "lerna run build --stream --parallel",
- "testonly": "cross-env NODE_PATH=test/lib jest \\.test.js",
- "posttestonly": "taskr posttest",
- "testall": "npm run testonly -... | true |
Other | vercel | next.js | ef01f13e5d4d2f01b9edcc7efd4f1767f9115cbc.json | Improve test setup (#5388)
* Update jest
* Let jest start chromedriver
This makes sure chromedriver always ends even if the test was canceled by the user.
* Properly close browser in production-config test
* Properly close browser in production/security test
* Properly close browser in export test
* ... | packages/next-server/package.json | @@ -54,6 +54,7 @@
"@babel/runtime": "7.1.2",
"@babel/runtime-corejs2": "7.1.2",
"@taskr/clear": "1.1.0",
- "@taskr/watch": "1.1.0"
+ "@taskr/watch": "1.1.0",
+ "taskr": "1.1.0"
}
} | true |
Other | vercel | next.js | ef01f13e5d4d2f01b9edcc7efd4f1767f9115cbc.json | Improve test setup (#5388)
* Update jest
* Let jest start chromedriver
This makes sure chromedriver always ends even if the test was canceled by the user.
* Properly close browser in production-config test
* Properly close browser in production/security test
* Properly close browser in export test
* ... | packages/next/package.json | @@ -109,6 +109,8 @@
"devDependencies": {
"@babel/preset-flow": "7.0.0",
"@taskr/clear": "1.1.0",
- "@taskr/watch": "1.1.0"
+ "@taskr/esnext": "1.1.0",
+ "@taskr/watch": "1.1.0",
+ "taskr": "1.1.0"
}
} | true |
Other | vercel | next.js | ef01f13e5d4d2f01b9edcc7efd4f1767f9115cbc.json | Improve test setup (#5388)
* Update jest
* Let jest start chromedriver
This makes sure chromedriver always ends even if the test was canceled by the user.
* Properly close browser in production-config test
* Properly close browser in production/security test
* Properly close browser in export test
* ... | taskfile.js | @@ -1,35 +0,0 @@
-const isWindows = /^win/.test(process.platform)
-const childProcess = require('child_process')
-const rimraf = require('rimraf')
-const mkdirp = require('mkdirp')
-
-export async function pretest (task) {
- // Create node_modules/next for the use of test apps
- rimraf.sync('test/node_modules/next')
... | true |
Other | vercel | next.js | ef01f13e5d4d2f01b9edcc7efd4f1767f9115cbc.json | Improve test setup (#5388)
* Update jest
* Let jest start chromedriver
This makes sure chromedriver always ends even if the test was canceled by the user.
* Properly close browser in production-config test
* Properly close browser in production/security test
* Properly close browser in export test
* ... | test/integration/app-aspath/test/index.test.js | @@ -32,24 +32,22 @@ describe('App asPath', () => {
const appPath = join(__dirname, '../', 'pages', '_app.js')
const originalContent = readFileSync(appPath, 'utf8')
- try {
- const text = await browser.elementByCss('body').text()
- expect(text).toBe('{ "url": { "query": {}, "pathname": "/", "asP... | true |
Other | vercel | next.js | ef01f13e5d4d2f01b9edcc7efd4f1767f9115cbc.json | Improve test setup (#5388)
* Update jest
* Let jest start chromedriver
This makes sure chromedriver always ends even if the test was canceled by the user.
* Properly close browser in production-config test
* Properly close browser in production/security test
* Properly close browser in export test
* ... | test/integration/basic/test/client-navigation.js | @@ -56,7 +56,7 @@ export default (context, render) => {
.elementByCss('p').text()
expect(text).toBe('This is the home.')
- browser.close()
+ browser.quit()
})
it('should not navigate if the <a/> tag has a target', async () => { | true |
Other | vercel | next.js | ef01f13e5d4d2f01b9edcc7efd4f1767f9115cbc.json | Improve test setup (#5388)
* Update jest
* Let jest start chromedriver
This makes sure chromedriver always ends even if the test was canceled by the user.
* Properly close browser in production-config test
* Properly close browser in production/security test
* Properly close browser in export test
* ... | test/integration/export/test/dev.js | @@ -12,15 +12,13 @@ export default function (context) {
describe('Render in development mode', () => {
it('should render the home page', async () => {
const browser = await webdriver(context.port, '/')
-
await check(() => getBrowserBodyText(browser), /This is the home page/)
+ browser.close()... | true |
Other | vercel | next.js | ef01f13e5d4d2f01b9edcc7efd4f1767f9115cbc.json | Improve test setup (#5388)
* Update jest
* Let jest start chromedriver
This makes sure chromedriver always ends even if the test was canceled by the user.
* Properly close browser in production-config test
* Properly close browser in production/security test
* Properly close browser in export test
* ... | test/integration/production-config/test/index.test.js | @@ -1,4 +1,5 @@
-/* global jasmine, describe, it, expect, beforeAll, afterAll */
+/* eslint-env jest */
+/* global jasmine */
import { join } from 'path'
import {
@@ -9,51 +10,39 @@ import {
} from 'next-test-utils'
import webdriver from 'next-webdriver'
-const appDir = join(__dirname, '../')
-let server
-let a... | true |
Other | vercel | next.js | ef01f13e5d4d2f01b9edcc7efd4f1767f9115cbc.json | Improve test setup (#5388)
* Update jest
* Let jest start chromedriver
This makes sure chromedriver always ends even if the test was canceled by the user.
* Properly close browser in production-config test
* Properly close browser in production/security test
* Properly close browser in export test
* ... | test/integration/production/test/security.js | @@ -39,7 +39,7 @@ module.exports = (context) => {
throw new Error('Vulnerable to XSS attacks')
}
- browser.close()
+ browser.quit()
})
})
} | true |
Other | vercel | next.js | ef01f13e5d4d2f01b9edcc7efd4f1767f9115cbc.json | Improve test setup (#5388)
* Update jest
* Let jest start chromedriver
This makes sure chromedriver always ends even if the test was canceled by the user.
* Properly close browser in production-config test
* Properly close browser in production/security test
* Properly close browser in export test
* ... | test/jest-config.json | @@ -0,0 +1,7 @@
+{
+ "verbose": true,
+ "bail": true,
+ "testEnvironment": "node",
+ "globalSetup": "./jest-global-setup.js",
+ "globalTeardown": "./jest-global-teardown.js"
+} | true |
Other | vercel | next.js | ef01f13e5d4d2f01b9edcc7efd4f1767f9115cbc.json | Improve test setup (#5388)
* Update jest
* Let jest start chromedriver
This makes sure chromedriver always ends even if the test was canceled by the user.
* Properly close browser in production-config test
* Properly close browser in production/security test
* Properly close browser in export test
* ... | test/jest-global-setup.js | @@ -0,0 +1,5 @@
+const chromedriver = require('chromedriver')
+
+module.exports = async function globalSetup () {
+ chromedriver.start()
+} | true |
Other | vercel | next.js | ef01f13e5d4d2f01b9edcc7efd4f1767f9115cbc.json | Improve test setup (#5388)
* Update jest
* Let jest start chromedriver
This makes sure chromedriver always ends even if the test was canceled by the user.
* Properly close browser in production-config test
* Properly close browser in production/security test
* Properly close browser in export test
* ... | test/jest-global-teardown.js | @@ -0,0 +1,5 @@
+const chromedriver = require('chromedriver')
+
+module.exports = async function globalSetup () {
+ chromedriver.stop()
+} | true |
Other | vercel | next.js | f3c65fd4175952445c94b94a0608c2aa78ffd601.json | update polka example (#5370)
[polka](https://github.com/lukeed/polka/releases/tag/v0.5.0) changed their listen api to be more like express like | examples/custom-server-polka/package.json | @@ -8,7 +8,7 @@
},
"dependencies": {
"next": "latest",
- "polka": "0.2.3",
+ "polka": "0.5.1",
"react": "16.2.0",
"react-dom": "16.2.0"
} | true |
Other | vercel | next.js | f3c65fd4175952445c94b94a0608c2aa78ffd601.json | update polka example (#5370)
[polka](https://github.com/lukeed/polka/releases/tag/v0.5.0) changed their listen api to be more like express like | examples/custom-server-polka/server.js | @@ -15,7 +15,8 @@ app.prepare().then(() => {
server.get('*', (req, res) => handle(req, res))
- server
- .listen(port)
- .then(() => console.log(`> Ready on http://localhost:${port}`))
+ server.listen(PORT, err => {
+ if (err) throw err;
+ console.log(`> Ready on http://localhost:${PORT}`)
+ })
}) | true |
Other | vercel | next.js | 14fad91084840886dd0f10825cf28d97e57f95b4.json | Use correct link to contributing.md | packages/next/README.md | @@ -1843,7 +1843,7 @@ As we were researching options for server-rendering React that didn’t involve
## Contributing
-Please see our [contributing.md](/packages/next/contributing.md)
+Please see our [contributing.md](/contributing.md)
## Authors
| false |
Other | vercel | next.js | ae4c1bc5d0274d0bfc7e3ac0dfba2b5721dc7c4b.json | Link image to nextjs.org | packages/next/README.md | @@ -1,13 +1,11 @@
-<img alt="Next.js" src="https://assets.zeit.co/image/upload/v1538361091/repositories/next-js/next-js.png">
+[](https://nextjs.org)
[](https://www.npmjs.c... | false |
Other | vercel | next.js | 42c0af99adc22edf7579fb91e6fb4b052c003c70.json | Add index.js to files key | packages/next-server/package.json | @@ -4,6 +4,7 @@
"main": "./index.js",
"files": [
"dist",
+ "index.js",
"asset.js",
"config.js",
"constants.js", | false |
Other | vercel | next.js | 8cd6bd3fc3ee7b7eee887092a086cfb1e9c639db.json | Add check for writeable directory (#3370)
* Add check for writeable directory
Followup of https://github.com/zeit/now-cli/issues/175
* Add link to docs | errors/build-dir-not-writeable.md | @@ -0,0 +1,30 @@
+# Build directory not writeable
+
+#### Why This Error Occurred
+
+The filesystem does not allow writing to the specified directory. A common cause for this error is starting a [custom server](https://github.com/zeit/next.js#custom-server-and-routing) in development mode on a production server, for ex... | true |
Other | vercel | next.js | 8cd6bd3fc3ee7b7eee887092a086cfb1e9c639db.json | Add check for writeable directory (#3370)
* Add check for writeable directory
Followup of https://github.com/zeit/now-cli/issues/175
* Add link to docs | readme.md | @@ -669,7 +669,19 @@ export default ({ url }) =>
</ul>
</details></p>
-Typically you start your next server with `next start`. It's possible, however, to start a server 100% programmatically in order to customize routes, use route patterns, etc
+Typically you start your next server with `next start`. It's possibl... | true |
Other | vercel | next.js | 8cd6bd3fc3ee7b7eee887092a086cfb1e9c639db.json | Add check for writeable directory (#3370)
* Add check for writeable directory
Followup of https://github.com/zeit/now-cli/issues/175
* Add link to docs | server/build/index.js | @@ -10,6 +10,14 @@ import md5File from 'md5-file/promise'
export default async function build (dir, conf = null) {
const buildId = uuid.v4()
const buildDir = join(tmpdir(), uuid.v4())
+
+ try {
+ await fs.access(buildDir, fs.constants.W_OK)
+ } catch (err) {
+ console.error(`> Failed, build directory is ... | true |
Other | vercel | next.js | 57c6f80d723849ac89891ed5aeb78197c30ec6ed.json | use underscore in node_modules in travis config (#3369)
The cached directory for node_modules has a dash. AFAIK node uses an underscore, not a dash, for node_modules.
Alternatively, remove it from cached directories if the typo isn't causing any problems. | .travis.yml | @@ -10,7 +10,7 @@
language: "node_js",
node_js: ["6"],
cache: {
- directories: ["node-modules"]
+ directories: ["node_modules"]
},
before_install: [
"rm yarn.lock", | false |
Other | vercel | next.js | df4974eac8a9c3efbfbafa4a64ae43c3e3d95a01.json | Add runtime environment example (#3371) | examples/with-universal-configuration-runtime/lib/env.js | @@ -0,0 +1 @@
+export default ('undefined' !== typeof window ? window.__ENV__ : process.env) | true |
Other | vercel | next.js | df4974eac8a9c3efbfbafa4a64ae43c3e3d95a01.json | Add runtime environment example (#3371) | examples/with-universal-configuration-runtime/package.json | @@ -0,0 +1,13 @@
+{
+ "scripts": {
+ "dev": "next",
+ "build": "next build",
+ "start": "next start"
+ },
+ "dependencies": {
+ "htmlescape": "1.1.1",
+ "next": "4.1.4",
+ "react": "16.2.0",
+ "react-dom": "16.2.0"
+ }
+} | true |
Other | vercel | next.js | df4974eac8a9c3efbfbafa4a64ae43c3e3d95a01.json | Add runtime environment example (#3371) | examples/with-universal-configuration-runtime/pages/_document.js | @@ -0,0 +1,27 @@
+import Document_, { Head, Main, NextScript } from 'next/document'
+import htmlescape from 'htmlescape'
+
+const { API_URL } = process.env
+const env = { API_URL }
+
+export default class Document extends Document_ {
+ static async getInitialProps (ctx) {
+ const props = await Document_.getInitialP... | true |
Other | vercel | next.js | df4974eac8a9c3efbfbafa4a64ae43c3e3d95a01.json | Add runtime environment example (#3371) | examples/with-universal-configuration-runtime/pages/index.js | @@ -0,0 +1,17 @@
+import React from 'react'
+import env from '../lib/env'
+
+const {API_URL} = env
+
+export default class extends React.Component {
+ static async getInitialProps () {
+ // fetch(`${API_URL}/some-path`)
+ return {}
+ }
+
+ render () {
+ return <div>
+ The API_URL is {API_URL}... | true |
Other | vercel | next.js | df4974eac8a9c3efbfbafa4a64ae43c3e3d95a01.json | Add runtime environment example (#3371) | examples/with-universal-configuration-runtime/readme.md | @@ -0,0 +1,30 @@
+[](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/with-universal-configuration)
+
+# With universal runtime configuration
+
+## How to use
+
+Download the example [or clone the repo](https://github.com/zeit/next... | true |
Other | vercel | next.js | 7a08e1b5f89040743f8a3e463c2e56bc9ed68ac8.json | Remove extra div (#3327)
* Replace extra div with React fragment.
* Fix linter
* Replace extra div with React fragment.
* Fix linter
* fix script tag, backport nonce attribute | server/document.js | @@ -3,6 +3,10 @@ import PropTypes from 'prop-types'
import htmlescape from 'htmlescape'
import flush from 'styled-jsx/server'
+function Fragment ({ children }) {
+ return children
+}
+
export default class Document extends Component {
static getInitialProps ({ renderPage }) {
const { html, head, errorHtml... | false |
Other | vercel | next.js | 8eb80342362c545e511c3b0c5416f4542610ca46.json | remove relative path to babel-runtime (#3119) | server/build/babel/preset.js | @@ -1,3 +1,4 @@
+const babelRuntimePath = require.resolve('babel-runtime/package').replace(/[\\/]package\.json$/, '')
const relativeResolve = require('../root-module-relative-path').default(require)
// Resolve styled-jsx plugins
@@ -56,7 +57,7 @@ module.exports = (context, opts = {}) => ({
require.resolve('b... | true |
Other | vercel | next.js | 8eb80342362c545e511c3b0c5416f4542610ca46.json | remove relative path to babel-runtime (#3119) | server/build/webpack.js | @@ -219,6 +219,8 @@ export default async function createCompiler (dir, { buildId, dev = false, quiet
return { content, sourceMap }
}
+ const babelRuntimePath = require.resolve('babel-runtime/package').replace(/[\\/]package\.json$/, '')
+
const transpiled = babelCore.transform(conte... | true |
Other | vercel | next.js | fc335ac36c790eae7432f74417bc3c759008ff5e.json | Add example with tailwind css (#3317)
* Add Tailwind css example
* Fix read me
* Add create-next-app setup to read me | examples/with-tailwindcss/README.md | @@ -0,0 +1,68 @@
+[](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/with-tailwindcss)
+
+# Tailwind CSS example
+
+This is an example of how you can include a global stylesheet in a next.js webapp.
+
+## How to use
+
+If you like... | true |
Other | vercel | next.js | fc335ac36c790eae7432f74417bc3c759008ff5e.json | Add example with tailwind css (#3317)
* Add Tailwind css example
* Fix read me
* Add create-next-app setup to read me | examples/with-tailwindcss/components/head.js | @@ -0,0 +1,37 @@
+import NextHead from 'next/head'
+import { string } from 'prop-types'
+
+const defaultDescription = ''
+const defaultOGURL = ''
+const defaultOGImage = ''
+
+const Head = (props) => (
+ <NextHead>
+ <meta charset="UTF-8" />
+ <title>{props.title || ''}</title>
+ <meta name="description" cont... | true |
Other | vercel | next.js | fc335ac36c790eae7432f74417bc3c759008ff5e.json | Add example with tailwind css (#3317)
* Add Tailwind css example
* Fix read me
* Add create-next-app setup to read me | examples/with-tailwindcss/components/nav.js | @@ -0,0 +1,60 @@
+import Head from './head'
+import Link from 'next/link'
+
+const links = [
+ { href: 'https://github.com/segmentio/create-next-app', label: 'Github' }
+].map(link => {
+ link.key = `nav-link-${link.href}-${link.label}`
+ return link
+})
+
+const Nav = () => (
+ <nav>
+ <ul>
+ <li>
+ ... | true |
Other | vercel | next.js | fc335ac36c790eae7432f74417bc3c759008ff5e.json | Add example with tailwind css (#3317)
* Add Tailwind css example
* Fix read me
* Add create-next-app setup to read me | examples/with-tailwindcss/package.json | @@ -0,0 +1,23 @@
+{
+ "name": "with-tailwindcss",
+ "version": "1.0.0",
+ "scripts": {
+ "dev": "next & yarn dev:css",
+ "dev:css": "postcss styles/index.css --watch -c styles/config/postcss.config.js -o static/css/bundle.css",
+ "build": "next build & yarn build:css",
+ "build:css": "postcss styles/inde... | true |
Other | vercel | next.js | fc335ac36c790eae7432f74417bc3c759008ff5e.json | Add example with tailwind css (#3317)
* Add Tailwind css example
* Fix read me
* Add create-next-app setup to read me | examples/with-tailwindcss/pages/_document.js | @@ -0,0 +1,26 @@
+import Document, { Head, Main, NextScript } from 'next/document'
+
+class MyDocument extends Document {
+ static getInitialProps({ renderPage }) {
+ const { html, head, errorHtml, chunks } = renderPage()
+
+ return { html, head, errorHtml, chunks }
+ }
+
+ render() {
+ return (
+ <htm... | true |
Other | vercel | next.js | fc335ac36c790eae7432f74417bc3c759008ff5e.json | Add example with tailwind css (#3317)
* Add Tailwind css example
* Fix read me
* Add create-next-app setup to read me | examples/with-tailwindcss/pages/index.js | @@ -0,0 +1,13 @@
+import Link from 'next/link'
+import Head from '../components/head'
+import Nav from '../components/nav'
+
+export default () => (
+ <div>
+ <Head title="Home" />
+ <Nav />
+ <div className="hero">
+ <h1 className="title">Next.js + Tailwind css</h1>
+ </div>
+ </div>
+) | true |
Other | vercel | next.js | fc335ac36c790eae7432f74417bc3c759008ff5e.json | Add example with tailwind css (#3317)
* Add Tailwind css example
* Fix read me
* Add create-next-app setup to read me | examples/with-tailwindcss/styles/button.css | @@ -0,0 +1,3 @@
+.btn-blue {
+ @apply .bg-blue .text-white .font-bold .py-2 .px-4 .rounded;
+} | true |
Other | vercel | next.js | fc335ac36c790eae7432f74417bc3c759008ff5e.json | Add example with tailwind css (#3317)
* Add Tailwind css example
* Fix read me
* Add create-next-app setup to read me | examples/with-tailwindcss/styles/config/postcss.config.js | @@ -0,0 +1,10 @@
+var tailwindcss = require('tailwindcss');
+
+module.exports = {
+ plugins: [
+ require('postcss-easy-import'),
+ tailwindcss('./styles/config/tailwind.config.js'),
+ require('autoprefixer'),
+ require('cssnano'),
+ ]
+} | true |
Other | vercel | next.js | fc335ac36c790eae7432f74417bc3c759008ff5e.json | Add example with tailwind css (#3317)
* Add Tailwind css example
* Fix read me
* Add create-next-app setup to read me | examples/with-tailwindcss/styles/config/tailwind.config.js | @@ -0,0 +1,775 @@
+/*
+
+Tailwind - The Utility-First CSS Framework
+
+A project by Adam Wathan (@adamwathan), Jonathan Reinink (@reinink),
+David Hemphill (@davidhemphill) and Steve Schoger (@steveschoger).
+
+Welcome to the Tailwind config file. This is where you can customize
+Tailwind specifically for your project.... | true |
Other | vercel | next.js | fc335ac36c790eae7432f74417bc3c759008ff5e.json | Add example with tailwind css (#3317)
* Add Tailwind css example
* Fix read me
* Add create-next-app setup to read me | examples/with-tailwindcss/styles/index.css | @@ -0,0 +1,55 @@
+@import "./button.css";
+
+@tailwind preflight;
+@tailwind utilities;
+
+.hero {
+ width: 100%;
+ color: #333;
+}
+
+.title {
+ margin: 0;
+ width: 100%;
+ padding-top: 80px;
+ line-height: 1.15;
+ font-size: 48px;
+}
+
+.title, .description {
+ text-align: center;
+}
+
+.row {
+ max-width: 8... | true |
Other | vercel | next.js | f0eacf66eac95db0aea40d502e0d2f049d9be3c7.json | Add data node to serverState declaration (#3321)
The serverState variable definition did not include the data node, which
may cause parsing errors on the client-side.
- add data: { } on line 23 within the apollo: { } object | examples/with-apollo/lib/withData.js | @@ -18,7 +18,11 @@ export default ComposedComponent => {
static async getInitialProps (ctx) {
// Initial serverState with apollo (empty)
- let serverState = { apollo: { } }
+ let serverState = {
+ apollo: {
+ data: { }
+ }
+ }
// Evaluate the composed compo... | false |
Other | vercel | next.js | bda073cfc1a79aa4ff5711183f6dfd3ef74bbca8.json | Remove next.d.ts to use @types/next (#3297) | examples/with-typescript/next.d.ts | @@ -1,10 +0,0 @@
-declare module 'next/link' {
- import { Url } from 'url'
-
- export default class Link extends React.Component<
- {
- href: string | Url;
- },
- {}
- > {}
-} | true |
Other | vercel | next.js | bda073cfc1a79aa4ff5711183f6dfd3ef74bbca8.json | Remove next.d.ts to use @types/next (#3297) | examples/with-typescript/package.json | @@ -9,14 +9,14 @@
},
"dependencies": {
"next": "latest",
- "react": "16.1.0",
- "react-dom": "16.1.0"
+ "react": "^16.1.0",
+ "react-dom": "^16.1.0"
},
"devDependencies": {
- "@types/node": "8.0.51",
- "@types/react": "16.0.22",
+ "@types/next": "^2.4.5",
+ "@types/react": "^16.... | true |
Other | vercel | next.js | 7c9d3500912e009e9f635cc2f31fb149d62d51ad.json | docs(readme): add missing period (#3295) | readme.md | @@ -162,7 +162,7 @@ It's possible to use any existing CSS-in-JS solution. The simplest one is inline
export default () => <p style={{ color: 'red' }}>hi there</p>
```
-To use more sophisticated CSS-in-JS solutions, you typically have to implement style flushing for server-side rendering. We enable this by allowing ... | false |
Other | vercel | next.js | e67d17ef8435c41f1741c86d3137124a4f9d5818.json | Add kea example (#3262) | examples/with-kea/.babelrc | @@ -0,0 +1,8 @@
+{
+ "presets": [
+ "next/babel"
+ ],
+ "plugins": [
+ "transform-decorators-legacy"
+ ]
+} | true |
Other | vercel | next.js | e67d17ef8435c41f1741c86d3137124a4f9d5818.json | Add kea example (#3262) | examples/with-kea/README.md | @@ -0,0 +1,25 @@
+[](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/with-kea)
+
+# kea example
+
+## How to use
+
+Download the example [or clone the repo](https://github.com/zeit/next.js):
+
+```bash
+curl https://codeload.githu... | true |
Other | vercel | next.js | e67d17ef8435c41f1741c86d3137124a4f9d5818.json | Add kea example (#3262) | examples/with-kea/package.json | @@ -0,0 +1,24 @@
+{
+ "name": "with-kea",
+ "version": "1.0.0",
+ "scripts": {
+ "dev": "next",
+ "build": "next build",
+ "start": "next start"
+ },
+ "dependencies": {
+ "kea": "^0.27.3",
+ "next": "^4.1.4",
+ "next-redux-wrapper": "^1.3.4",
+ "prop-types": "^15.6.0",
+ "react": "^16.1.0"... | true |
Other | vercel | next.js | e67d17ef8435c41f1741c86d3137124a4f9d5818.json | Add kea example (#3262) | examples/with-kea/pages/index.js | @@ -0,0 +1,43 @@
+import React from 'react'
+import { initStore } from '../store'
+import withRedux from 'next-redux-wrapper'
+import PropTypes from 'prop-types'
+import { kea } from 'kea'
+
+@kea({
+ path: () => ['kea'],
+ actions: () => ({
+ increment: amount => ({ amount }),
+ decrement: amount => ({ amount ... | true |
Other | vercel | next.js | e67d17ef8435c41f1741c86d3137124a4f9d5818.json | Add kea example (#3262) | examples/with-kea/store.js | @@ -0,0 +1,18 @@
+import { keaReducer } from 'kea'
+import { createStore, compose, combineReducers } from 'redux'
+
+const reducers = combineReducers({
+ kea: keaReducer('kea')
+})
+
+const reduxDevTools =
+ typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__
+ ? window.__REDUX_DEVTOOLS_EXTENSION_... | true |
Other | vercel | next.js | 80a16031895baf4b0bb774e295c8430e65ec9ffa.json | Use uglify-es for minification (#3150) | package.json | @@ -132,6 +132,7 @@
"react-dom": "16.0.0",
"standard": "9.0.2",
"taskr": "1.1.0",
+ "uglifyjs-webpack-plugin": "^1.0.0-beta.3",
"wd": "1.4.1"
},
"peerDependencies": { | true |
Other | vercel | next.js | 80a16031895baf4b0bb774e295c8430e65ec9ffa.json | Use uglify-es for minification (#3150) | server/build/webpack.js | @@ -6,6 +6,7 @@ import glob from 'glob-promise'
import WriteFilePlugin from 'write-file-webpack-plugin'
import FriendlyErrorsWebpackPlugin from 'friendly-errors-webpack-plugin'
import CaseSensitivePathPlugin from 'case-sensitive-paths-webpack-plugin'
+import UglifyJSPlugin from 'uglifyjs-webpack-plugin'
import Unli... | true |
Other | vercel | next.js | 80a16031895baf4b0bb774e295c8430e65ec9ffa.json | Use uglify-es for minification (#3150) | yarn.lock | @@ -156,6 +156,15 @@ ajv@^4.7.0, ajv@^4.9.1:
co "^4.6.0"
json-stable-stringify "^1.0.1"
+ajv@^5.0.0:
+ version "5.2.4"
+ resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.2.4.tgz#3daf9a8b67221299fdae8d82d117ed8e6c80244b"
+ dependencies:
+ co "^4.6.0"
+ fast-deep-equal "^1.0.0"
+ json-schema-tra... | true |
Other | vercel | next.js | 1424b84c98e5e8e2efc279d1790c49c970f21eca.json | Allow overriding Content-Type (#3242)
* Allow overriding Content-Type
* Mock getHeader | server/render.js | @@ -185,7 +185,9 @@ export function sendHTML (req, res, html, method, { dev }) {
}
res.setHeader('ETag', etag)
- res.setHeader('Content-Type', 'text/html')
+ if (!res.getHeader('Content-Type')) {
+ res.setHeader('Content-Type', 'text/html')
+ }
res.setHeader('Content-Length', Buffer.byteLength(html))
... | true |
Other | vercel | next.js | 1424b84c98e5e8e2efc279d1790c49c970f21eca.json | Allow overriding Content-Type (#3242)
* Allow overriding Content-Type
* Mock getHeader | test/integration/basic/pages/custom-encoding.js | @@ -0,0 +1,13 @@
+import React from 'react'
+export default class extends React.Component {
+ static async getInitialProps ({res}) {
+ if (res) {
+ res.setHeader('Content-Type', 'text/html; charset=utf-8')
+ }
+ return {}
+ }
+
+ render () {
+ return null
+ }
+} | true |
Other | vercel | next.js | 1424b84c98e5e8e2efc279d1790c49c970f21eca.json | Allow overriding Content-Type (#3242)
* Allow overriding Content-Type
* Mock getHeader | test/integration/basic/test/index.test.js | @@ -3,6 +3,7 @@
import { join } from 'path'
import {
renderViaHTTP,
+ fetchViaHTTP,
findPort,
launchApp,
killApp
@@ -55,7 +56,7 @@ describe('Basic Features', () => {
})
afterAll(() => killApp(context.server))
- rendering(context, 'Rendering via HTTP', (p, q) => renderViaHTTP(context.appPort, p, ... | true |
Other | vercel | next.js | 1424b84c98e5e8e2efc279d1790c49c970f21eca.json | Allow overriding Content-Type (#3242)
* Allow overriding Content-Type
* Mock getHeader | test/integration/basic/test/rendering.js | @@ -2,7 +2,7 @@
import cheerio from 'cheerio'
-export default function ({ app }, suiteName, render) {
+export default function ({ app }, suiteName, render, fetch) {
async function get$ (path, query) {
const html = await render(path, query)
return cheerio.load(html)
@@ -63,6 +63,16 @@ export default fu... | true |
Other | vercel | next.js | 1424b84c98e5e8e2efc279d1790c49c970f21eca.json | Allow overriding Content-Type (#3242)
* Allow overriding Content-Type
* Mock getHeader | test/integration/production/test/index.test.js | @@ -117,6 +117,9 @@ describe('Production Usage', () => {
const req = { url: '/stateless', headers: {} }
const headers = {}
const res = {
+ getHeader (key) {
+ return headers[key]
+ },
setHeader (key, value) {
headers[key] = value
},
@@ -132,6 +135... | true |
Other | vercel | next.js | 1424b84c98e5e8e2efc279d1790c49c970f21eca.json | Allow overriding Content-Type (#3242)
* Allow overriding Content-Type
* Mock getHeader | test/lib/next-test-utils.js | @@ -23,8 +23,12 @@ export function renderViaAPI (app, pathname, query) {
}
export function renderViaHTTP (appPort, pathname, query) {
+ return fetchViaHTTP(appPort, pathname, query).then((res) => res.text())
+}
+
+export function fetchViaHTTP (appPort, pathname, query) {
const url = `http://localhost:${appPort}... | true |
Other | vercel | next.js | 1424b84c98e5e8e2efc279d1790c49c970f21eca.json | Allow overriding Content-Type (#3242)
* Allow overriding Content-Type
* Mock getHeader | yarn.lock | @@ -6071,9 +6071,9 @@ strip-json-comments@~2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
-styled-jsx@2.1.1:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-2.1.1.tgz... | true |
Other | vercel | next.js | 828dac7d6182095bb53e90441c184c46858cbc5a.json | Use fs.realpath to get actual project directory (#3243)
* resolve base dir symlink
* fix method name | server/build/webpack.js | @@ -1,5 +1,6 @@
import { resolve, join, sep } from 'path'
import { createHash } from 'crypto'
+import { realpathSync } from 'fs'
import webpack from 'webpack'
import glob from 'glob-promise'
import WriteFilePlugin from 'write-file-webpack-plugin'
@@ -28,7 +29,7 @@ const interpolateNames = new Map(defaultPages.map(... | false |
Other | vercel | next.js | 31ba48ada29e5910db7537bb62c2b5975ee4c0ff.json | Upgrade styled-jsx to version 2.1.2 (#3231) | package.json | @@ -91,7 +91,7 @@
"send": "0.16.1",
"source-map-support": "0.4.18",
"strip-ansi": "4.0.0",
- "styled-jsx": "2.1.1",
+ "styled-jsx": "2.1.2",
"touch": "3.1.0",
"unfetch": "3.0.0",
"url": "0.11.0", | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.