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 | aa630279e672c882e3c74acd1cd7e56c63536722.json | examples: simplify download instruction | examples/with-prefetching/README.md | @@ -5,8 +5,8 @@
Download the example:
```bash
-curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz next.js-master/examples/with-prefetching
-cd next.js-master/examples/with-prefetching
+curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-pre... | true |
Other | vercel | next.js | aa630279e672c882e3c74acd1cd7e56c63536722.json | examples: simplify download instruction | examples/with-redux/README.md | @@ -6,8 +6,8 @@
Download the example:
```bash
-curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz next.js-master/examples/with-redux
-cd next.js-master/examples/with-redux
+curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-redux
+cd with-... | true |
Other | vercel | next.js | aa630279e672c882e3c74acd1cd7e56c63536722.json | examples: simplify download instruction | examples/with-styled-components/README.md | @@ -6,8 +6,8 @@
Download the example:
```bash
-curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz next.js-master/examples/with-styles-components
-cd next.js-master/examples/with-styled-components
+curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examp... | true |
Other | vercel | next.js | 9ac79ed1ae1b6a96eb0214b04a187346e6af6a14.json | fix: expose babel presets for upstream libraries (#463) | package.json | @@ -7,6 +7,7 @@
"repository": "zeit/next.js",
"files": [
"dist",
+ "babel.js",
"link.js",
"css.js",
"head.js", | false |
Other | vercel | next.js | 68738d1c904476e9c99989ae5ee12a90c184fbc1.json | Use deterministic names for dynamic import (#2788)
* Always use the same name for the same dynamic import.
* Add unit tests for the modulePath generation.
* Allow tests to run correctly on Windows.
* Make the chunk name a bit pretty.
* Fix tests to run on Windows. | server/build/babel/plugins/handle-import.js | @@ -2,7 +2,8 @@
// We've added support for SSR with this version
import template from 'babel-template'
import syntax from 'babel-plugin-syntax-dynamic-import'
-import UUID from 'uuid'
+import { dirname, resolve, sep } from 'path'
+import Crypto from 'crypto'
const TYPE_IMPORT = 'Import'
@@ -37,14 +38,33 @@ cons... | true |
Other | vercel | next.js | 68738d1c904476e9c99989ae5ee12a90c184fbc1.json | Use deterministic names for dynamic import (#2788)
* Always use the same name for the same dynamic import.
* Add unit tests for the modulePath generation.
* Allow tests to run correctly on Windows.
* Make the chunk name a bit pretty.
* Fix tests to run on Windows. | test/unit/handle-import-babel-plugin.test.js | @@ -0,0 +1,42 @@
+/* global describe, it, expect */
+import { getModulePath } from '../../dist/server/build/babel/plugins/handle-import'
+
+function cleanPath (mPath) {
+ return mPath
+ .replace(/\\/g, '/')
+ .replace(/^.*:/, '')
+}
+
+describe('handle-import-babel-plugin', () => {
+ describe('getModulePath', (... | true |
Other | vercel | next.js | 708193d2273afc7377df35c61f4eda022b040c05.json | Relay Modern Example (#1757) (#2773) | examples/with-relay-modern/.babelrc | @@ -0,0 +1,8 @@
+{
+ "presets": [
+ "next/babel"
+ ],
+ "plugins": [
+ "relay"
+ ]
+}
\ No newline at end of file | true |
Other | vercel | next.js | 708193d2273afc7377df35c61f4eda022b040c05.json | Relay Modern Example (#1757) (#2773) | examples/with-relay-modern/.env | @@ -0,0 +1 @@
+RELAY_ENDPOINT=https://api.graph.cool/relay/v1/next-js-with-relay-modern-example
\ No newline at end of file | true |
Other | vercel | next.js | 708193d2273afc7377df35c61f4eda022b040c05.json | Relay Modern Example (#1757) (#2773) | examples/with-relay-modern/README.md | @@ -0,0 +1,52 @@
+[](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/with-relay-modern)
+# Relay Modern Example
+
+## How to use
+
+Download the example [or clone the repo](https://github.com/zeit/next.js):
+
+```bash
+curl https:... | true |
Other | vercel | next.js | 708193d2273afc7377df35c61f4eda022b040c05.json | Relay Modern Example (#1757) (#2773) | examples/with-relay-modern/components/BlogPostPreview.js | @@ -0,0 +1,17 @@
+import React from 'react'
+import { createFragmentContainer, graphql } from 'react-relay'
+
+const BlogPostPreview = props => {
+ return (
+ <div key={props.post.id}>{props.post.title}</div>
+ )
+}
+
+export default createFragmentContainer(BlogPostPreview, {
+ post: graphql`
+ fragment Bl... | true |
Other | vercel | next.js | 708193d2273afc7377df35c61f4eda022b040c05.json | Relay Modern Example (#1757) (#2773) | examples/with-relay-modern/components/BlogPosts.js | @@ -0,0 +1,28 @@
+import React from 'react'
+import { createFragmentContainer, graphql } from 'react-relay'
+import BlogPostPreview from './BlogPostPreview'
+
+const BlogPosts = props => {
+ return (
+ <div>
+ <h1>Blog posts</h1>
+ {props.viewer.allBlogPosts.edges.map(({ node }) =>
+ <BlogPostPrevi... | true |
Other | vercel | next.js | 708193d2273afc7377df35c61f4eda022b040c05.json | Relay Modern Example (#1757) (#2773) | examples/with-relay-modern/lib/RelayProvider.js | @@ -0,0 +1,31 @@
+import React from 'react'
+import PropTypes from 'prop-types'
+
+// Thank you https://github.com/robrichard
+// https://github.com/robrichard/relay-context-provider
+
+class RelayProvider extends React.Component {
+ getChildContext () {
+ return {
+ relay: {
+ environment: this.props.e... | true |
Other | vercel | next.js | 708193d2273afc7377df35c61f4eda022b040c05.json | Relay Modern Example (#1757) (#2773) | examples/with-relay-modern/lib/createRelayEnvironment.js | @@ -0,0 +1,50 @@
+import { Environment, Network, RecordSource, Store } from 'relay-runtime'
+import fetch from 'isomorphic-unfetch'
+
+let relayEnvironment = null
+
+// Define a function that fetches the results of an operation (query/mutation/etc)
+// and returns its results as a Promise:
+function fetchQuery (
+ o... | true |
Other | vercel | next.js | 708193d2273afc7377df35c61f4eda022b040c05.json | Relay Modern Example (#1757) (#2773) | examples/with-relay-modern/lib/withData.js | @@ -0,0 +1,53 @@
+import React from 'react'
+import initEnvironment from './createRelayEnvironment'
+import { fetchQuery } from 'react-relay'
+import RelayProvider from './RelayProvider'
+
+export default (ComposedComponent, options = {}) => {
+ return class WithData extends React.Component {
+ static displayName =... | true |
Other | vercel | next.js | 708193d2273afc7377df35c61f4eda022b040c05.json | Relay Modern Example (#1757) (#2773) | examples/with-relay-modern/next.config.js | @@ -0,0 +1,22 @@
+require('dotenv').config()
+
+const path = require('path')
+const Dotenv = require('dotenv-webpack')
+
+module.exports = {
+ webpack: (config) => {
+ config.plugins = config.plugins || []
+
+ config.plugins = [
+ ...config.plugins,
+
+ // Read the .env file
+ new Dotenv({
+ ... | true |
Other | vercel | next.js | 708193d2273afc7377df35c61f4eda022b040c05.json | Relay Modern Example (#1757) (#2773) | examples/with-relay-modern/package.json | @@ -0,0 +1,29 @@
+{
+ "name": "with-relay-modern",
+ "version": "3.0.3",
+ "description": "Example of Next.js with Relay Modern SSR",
+ "scripts": {
+ "graphcool-init": "graphcool init --schema schema/init-schema.graphql",
+ "dev": "next",
+ "build": "next build",
+ "start": "next start",
+ "relay": ... | true |
Other | vercel | next.js | 708193d2273afc7377df35c61f4eda022b040c05.json | Relay Modern Example (#1757) (#2773) | examples/with-relay-modern/pages/index.js | @@ -0,0 +1,26 @@
+import React, { Component } from 'react'
+import { graphql } from 'react-relay'
+import withData from '../lib/withData'
+import BlogPosts from '../components/BlogPosts'
+
+class Index extends Component {
+ static displayName = `Index`
+
+ render (props) {
+ return (
+ <div>
+ <BlogPos... | true |
Other | vercel | next.js | 708193d2273afc7377df35c61f4eda022b040c05.json | Relay Modern Example (#1757) (#2773) | examples/with-relay-modern/schema/init-schema.graphql | @@ -0,0 +1,7 @@
+type BlogPost implements Node {
+ content: String!
+ createdAt: DateTime!
+ id: ID! @isUnique
+ title: String!
+ updatedAt: DateTime!
+}
\ No newline at end of file | true |
Other | vercel | next.js | 708193d2273afc7377df35c61f4eda022b040c05.json | Relay Modern Example (#1757) (#2773) | examples/with-relay-modern/scripts/getSchema.js | @@ -0,0 +1,28 @@
+var fetch = require('node-fetch')
+var fs = require('fs')
+var path = require('path')
+
+require('dotenv').config()
+
+const {
+ buildClientSchema,
+ introspectionQuery,
+ printSchema
+} = require('graphql/utilities')
+
+console.log(introspectionQuery)
+
+fetch(process.env.RELAY_ENDPOINT, {
+ ... | true |
Other | vercel | next.js | 029bac4fd9e23f60dedac59ed57c5a5cc5d5b299.json | Remove unnecessary lookup in example with emotion (#2731) | examples/with-emotion/pages/_document.js | @@ -16,7 +16,7 @@ export default class MyDocument extends Document {
super(props)
const { __NEXT_DATA__, ids } = props
if (ids) {
- __NEXT_DATA__.ids = this.props.ids
+ __NEXT_DATA__.ids = ids
}
}
| false |
Other | vercel | next.js | a99a1670675d0de1fd9e43a6d63674b4370bf841.json | Remove beta information from the README. | readme.md | @@ -1,7 +1,7 @@
<img width="112" alt="screen shot 2016-10-25 at 2 37 27 pm" src="https://cloud.githubusercontent.com/assets/13041/19686250/971bf7f8-9ac0-11e6-975c-188defd82df1.png">
[](https://travis-ci.org/zeit/next.js)
-[
* Add Electron usage example
* Remove the deploy part
* Only allow GET request to our HTTP server
* Only allow request from an electron app (checking the user agent)
* Add warning about the local HTTP server
* Update package.json
* Update example to use Next.js v3
* Ad... | examples/with-electron/README.md | @@ -0,0 +1,25 @@
+# Electron application example
+
+## How to use
+
+Download the example [or clone the repo](https://github.com/zeit/next.js):
+
+```bash
+curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-electron
+cd with-electron
+```
+
+Install it and run:
... | true |
Other | vercel | next.js | 4b0467ed42952c02065c9ed1d0a19040abd7a68e.json | Add Electron example (#1430)
* Add Electron usage example
* Remove the deploy part
* Only allow GET request to our HTTP server
* Only allow request from an electron app (checking the user agent)
* Add warning about the local HTTP server
* Update package.json
* Update example to use Next.js v3
* Ad... | examples/with-electron/main/index.js | @@ -0,0 +1,36 @@
+// Native
+const { join } = require('path')
+const { format } = require('url')
+
+// Packages
+const { BrowserWindow, app, ipcMain } = require('electron')
+const isDev = require('electron-is-dev')
+const prepareNext = require('electron-next')
+
+// Prepare the renderer once the app is ready
+app.on('r... | true |
Other | vercel | next.js | 4b0467ed42952c02065c9ed1d0a19040abd7a68e.json | Add Electron example (#1430)
* Add Electron usage example
* Remove the deploy part
* Only allow GET request to our HTTP server
* Only allow request from an electron app (checking the user agent)
* Add warning about the local HTTP server
* Update package.json
* Update example to use Next.js v3
* Ad... | examples/with-electron/package.json | @@ -0,0 +1,31 @@
+{
+ "name": "electron-next-skeleton",
+ "productName": "ElectronNext",
+ "version": "1.0.0",
+ "main": "main/index.js",
+ "scripts": {
+ "start": "electron .",
+ "build": "next build renderer && next export renderer",
+ "dist": "npm run build && build --dir"
+ },
+ "build": {
+ "asa... | true |
Other | vercel | next.js | 4b0467ed42952c02065c9ed1d0a19040abd7a68e.json | Add Electron example (#1430)
* Add Electron usage example
* Remove the deploy part
* Only allow GET request to our HTTP server
* Only allow request from an electron app (checking the user agent)
* Add warning about the local HTTP server
* Update package.json
* Update example to use Next.js v3
* Ad... | examples/with-electron/renderer/next.config.js | @@ -0,0 +1,14 @@
+module.exports = {
+ webpack (config, { dev }) {
+ config.target = 'electron-renderer'
+ return config
+ },
+ exportPathMap () {
+ // Let Next.js know where to find the entry page
+ // when it's exporting the static bundle for the use
+ // in the production version of your app
+ r... | true |
Other | vercel | next.js | 4b0467ed42952c02065c9ed1d0a19040abd7a68e.json | Add Electron example (#1430)
* Add Electron usage example
* Remove the deploy part
* Only allow GET request to our HTTP server
* Only allow request from an electron app (checking the user agent)
* Add warning about the local HTTP server
* Update package.json
* Update example to use Next.js v3
* Ad... | examples/with-electron/renderer/pages/start.js | @@ -0,0 +1,57 @@
+import { Component } from 'react'
+import { ipcRenderer } from 'electron'
+
+export default class extends Component {
+ state = {
+ input: '',
+ message: null
+ }
+
+ componentDidMount () {
+ // start listening the channel message
+ ipcRenderer.on('message', this.handleMessage)
+ }
+
+... | true |
Other | vercel | next.js | 67697afa44fde09430faefa7bb567542b5d3e0e8.json | Remove the extra plugin (#2670) | package.json | @@ -91,7 +91,6 @@
"strip-ansi": "4.0.0",
"styled-jsx": "^1.0.8",
"touch": "3.1.0",
- "uglifyjs-webpack-plugin": "0.4.6",
"unfetch": "3.0.0",
"url": "0.11.0",
"uuid": "3.1.0", | true |
Other | vercel | next.js | 67697afa44fde09430faefa7bb567542b5d3e0e8.json | Remove the extra plugin (#2670) | server/build/webpack.js | @@ -5,7 +5,6 @@ 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 | cf130c70f0b6a002d437fc175ad513ed30a6244a.json | Prefix process.env to avoid inconsistency (#2647) | examples/with-universal-configuration/env-config.js | @@ -1,5 +1,5 @@
const prod = process.env.NODE_ENV === 'production'
module.exports = {
- 'BACKEND_URL': prod ? 'https://api.example.com' : 'https://localhost:8080'
+ 'process.env.BACKEND_URL': prod ? 'https://api.example.com' : 'https://localhost:8080'
} | true |
Other | vercel | next.js | cf130c70f0b6a002d437fc175ad513ed30a6244a.json | Prefix process.env to avoid inconsistency (#2647) | examples/with-universal-configuration/pages/index.js | @@ -1,5 +1,3 @@
-/* global BACKEND_URL */
-
export default () => (
- <div>Loading data from { BACKEND_URL }</div>
+ <div>Loading data from { process.env.BACKEND_URL }</div>
) | true |
Other | vercel | next.js | 58c2d138d0896ec39e4dcdfef90d00230c150409.json | examples(material-ui): change the wrapping strategy (#2648)
By creating an intermediary component (with the HOC)
we save some React rendering logic.
That's also addressing an issue with JssProvider (react-jss)
that generate a new index at each render. | examples/with-material-ui-next/components/App.js | @@ -1,53 +0,0 @@
-import React, { Component } from 'react'
-import PropTypes from 'prop-types'
-import { JssProvider } from 'react-jss'
-import { withStyles, createStyleSheet, MuiThemeProvider } from 'material-ui/styles'
-import { getContext } from '../styles/context'
-
-// Apply some reset
-const styleSheet = createSt... | true |
Other | vercel | next.js | 58c2d138d0896ec39e4dcdfef90d00230c150409.json | examples(material-ui): change the wrapping strategy (#2648)
By creating an intermediary component (with the HOC)
we save some React rendering logic.
That's also addressing an issue with JssProvider (react-jss)
that generate a new index at each render. | examples/with-material-ui-next/components/withRoot.js | @@ -0,0 +1,62 @@
+import React, { Component } from 'react'
+import { JssProvider } from 'react-jss'
+import { withStyles, createStyleSheet, MuiThemeProvider } from 'material-ui/styles'
+import { getContext } from '../styles/context'
+
+// Apply some reset
+const styleSheet = createStyleSheet(theme => ({
+ '@global': {... | true |
Other | vercel | next.js | 58c2d138d0896ec39e4dcdfef90d00230c150409.json | examples(material-ui): change the wrapping strategy (#2648)
By creating an intermediary component (with the HOC)
we save some React rendering logic.
That's also addressing an issue with JssProvider (react-jss)
that generate a new index at each render. | examples/with-material-ui-next/pages/index.js | @@ -7,7 +7,7 @@ import Dialog, {
DialogActions
} from 'material-ui/Dialog'
import Typography from 'material-ui/Typography'
-import App from '../components/App'
+import withRoot from '../components/withRoot'
const styles = {
container: {
@@ -35,26 +35,24 @@ class Index extends Component {
render () {
... | true |
Other | vercel | next.js | 34830a05c940ec2bbabe3358df50c2d48593ca74.json | Add a missing slash (#2634)
Improving `next.js`, one slash at a time | readme.md | @@ -339,7 +339,7 @@ export default () => (
// pages/index.js
import Link from 'next/link'
export default () => (
- <div>Click <Link href='/about'><img src="/static/image.png"></Link></div>
+ <div>Click <Link href='/about'><img src="/static/image.png" /></Link></div>
)
```
| false |
Other | vercel | next.js | 564dbdd237db0e1507ca99102e1fe54be216b26c.json | Add a test case to prevent issue #2617 to happen again. | server/index.js | @@ -199,11 +199,17 @@ export default class Server {
await renderScript(req, res, page, this.renderOpts)
},
+ // It's very important keep this route's param optional.
+ // Othewise this will lead to a pretty simple DOS attack.
+ // See more: https://github.com/zeit/next.js/issues/2617
... | true |
Other | vercel | next.js | 564dbdd237db0e1507ca99102e1fe54be216b26c.json | Add a test case to prevent issue #2617 to happen again. | test/integration/production/test/index.test.js | @@ -101,6 +101,13 @@ describe('Production Usage', () => {
const html = await app.renderToHTML({}, res, '/finish-response', {})
expect(html).toBeFalsy()
})
+
+ it('should allow to access /static/ and /_next/', async () => {
+ // This is a test case which prevent the following issue happening a... | true |
Other | vercel | next.js | 337471d6846b905b996fd7873dbd5254b5b07cc4.json | Add page transitions example (#2613) | examples/page-transitions/README.md | @@ -0,0 +1,29 @@
+[](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/page-transitions)
+
+# Example app with custom page transitions
+
+## How to use
+
+Download the example [or clone the repo](https://github.com/zeit/next.js):
+
... | true |
Other | vercel | next.js | 337471d6846b905b996fd7873dbd5254b5b07cc4.json | Add page transitions example (#2613) | examples/page-transitions/package.json | @@ -0,0 +1,19 @@
+{
+ "name": "page-transitions",
+ "version": "1.0.0",
+ "scripts": {
+ "dev": "NODE_ENV=development node server.js",
+ "build": "next build",
+ "start": "NODE_ENV=production node server.js"
+ },
+ "dependencies": {
+ "compression": "^1.7.0",
+ "express": "^4.15.3",
+ "next": "la... | true |
Other | vercel | next.js | 337471d6846b905b996fd7873dbd5254b5b07cc4.json | Add page transitions example (#2613) | examples/page-transitions/pages/_document.js | @@ -0,0 +1,21 @@
+import React from 'react'
+import Document, { Head, Main, NextScript } from 'next/document'
+
+// ---------------------------------------------
+
+export default class CustomDocument extends Document {
+ render () {
+ return (<html lang='en-US'>
+ <Head>
+ <meta name='viewport' content... | true |
Other | vercel | next.js | 337471d6846b905b996fd7873dbd5254b5b07cc4.json | Add page transitions example (#2613) | examples/page-transitions/pages/index.js | @@ -0,0 +1,39 @@
+import { PureComponent } from 'react'
+import raf from 'raf'
+import { Router } from '../routes'
+import Main from './main'
+
+// -----------------------------------------------
+
+Router.onRouteChangeStart = () => {
+ const $container = document.getElementById('container')
+ const $clone = $contain... | true |
Other | vercel | next.js | 337471d6846b905b996fd7873dbd5254b5b07cc4.json | Add page transitions example (#2613) | examples/page-transitions/pages/main.js | @@ -0,0 +1,38 @@
+import { PureComponent } from 'react'
+import PropTypes from 'prop-types'
+import Head from 'next/head'
+import { Link } from '../routes'
+
+// -----------------------------------------------
+
+export default class Main extends PureComponent {
+ render () {
+ return (<div>
+ <Head>
+ ... | true |
Other | vercel | next.js | 337471d6846b905b996fd7873dbd5254b5b07cc4.json | Add page transitions example (#2613) | examples/page-transitions/routes.js | @@ -0,0 +1,6 @@
+const nextRoutes = require('next-routes')
+const routes = nextRoutes()
+
+routes.add('main', '/:slug/:child?', '')
+
+module.exports = routes | true |
Other | vercel | next.js | 337471d6846b905b996fd7873dbd5254b5b07cc4.json | Add page transitions example (#2613) | examples/page-transitions/server.js | @@ -0,0 +1,12 @@
+const next = require('next')
+const routes = require('./routes')
+const express = require('express')
+const compression = require('compression')
+
+const port = process.env.PORT || 3000
+const dev = process.env.NODE_ENV !== 'production'
+
+const app = next({ dev })
+const handle = routes.getRequestHan... | true |
Other | vercel | next.js | 337471d6846b905b996fd7873dbd5254b5b07cc4.json | Add page transitions example (#2613) | examples/page-transitions/static/style.css | @@ -0,0 +1,99 @@
+body, html {
+ margin: 0;
+ padding: 0;
+}
+
+body {
+ background: #000;
+}
+
+/* ------------------------------------------- */
+
+header {
+ z-index: 100;
+ position: fixed;
+ right: 0;
+ top: 20px;
+ left: 0;
+ text-align: center;
+ padding: 15px;
+}
+
+ header a {
+ color: blue;
+ }
+
+ header a:... | true |
Other | vercel | next.js | 1d218979823bfa35555a5803661e2e10157282d2.json | Update start script in preact example (#11763)
As far as I understand using preact in Next.js no longer requires a custom server. The current start command `"start": "NODE_ENV=production node server.js"` references a file that no longer exists. | examples/using-preact/package.json | @@ -4,7 +4,7 @@
"scripts": {
"dev": "node server.js",
"build": "next build",
- "start": "NODE_ENV=production node server.js"
+ "start": "next start"
},
"dependencies": {
"next": "^9.2.3-canary.21", | false |
Other | vercel | next.js | 2704387d2e96e1e727d87417942bf46bc36dbade.json | Add New Provider (#11757) | packages/next/build/index.ts | @@ -1,14 +1,13 @@
-import chalk from 'next/dist/compiled/chalk'
-import ciEnvironment from 'next/dist/compiled/ci-info'
import crypto from 'crypto'
+import fs from 'fs'
+import Worker from 'jest-worker'
+import chalk from 'next/dist/compiled/chalk'
import devalue from 'next/dist/compiled/devalue'
import escapeString... | true |
Other | vercel | next.js | 2704387d2e96e1e727d87417942bf46bc36dbade.json | Add New Provider (#11757) | packages/next/telemetry/ci-info.ts | @@ -4,5 +4,9 @@ const { isCI: _isCI, name: _name } = ciEnvironment
const isZeitNow = !!process.env.NOW_BUILDER
-export const isCI = isZeitNow || _isCI
-export const name = isZeitNow ? 'ZEIT Now' : _name
+const envStack = process.env.STACK
+const isHeroku =
+ typeof envStack === 'string' && envStack.toLowerCase().... | true |
Other | vercel | next.js | cc9678056e3e32fe37be418d0c9c1c85e3efecb0.json | Fix inconsistent handling for /index (#11643)
* Fix inconsistent handling for /index
* Add more test cases
* Add pages/index/index.js test
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | packages/next/next-server/server/require.ts | @@ -37,7 +37,7 @@ export function getPagePath(
}
if (!pagesManifest[page]) {
- const cleanedPage = page.replace(/\/index$/, '') || '/'
+ const cleanedPage = page.replace(/^\/index$/, '') || '/'
if (!pagesManifest[cleanedPage]) {
throw pageNotFoundError(page)
} else { | true |
Other | vercel | next.js | cc9678056e3e32fe37be418d0c9c1c85e3efecb0.json | Fix inconsistent handling for /index (#11643)
* Fix inconsistent handling for /index
* Add more test cases
* Add pages/index/index.js test
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | packages/next/server/lib/find-page-file.ts | @@ -14,8 +14,15 @@ export async function findPageFile(
const relativePagePath = `${normalizedPagePath}.${extension}`
const pagePath = join(rootDir, relativePagePath)
- if (await isWriteable(pagePath)) {
- foundPagePaths.push(relativePagePath)
+ // only /index and /sub/index when /sub/index/index.... | true |
Other | vercel | next.js | cc9678056e3e32fe37be418d0c9c1c85e3efecb0.json | Fix inconsistent handling for /index (#11643)
* Fix inconsistent handling for /index
* Add more test cases
* Add pages/index/index.js test
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | test/integration/client-navigation/test/index.test.js | @@ -52,7 +52,7 @@ describe('Client Navigation', () => {
'/nav/as-path-using-router',
'/nav/url-prop-change',
- '/nested-cdm/index',
+ '/nested-cdm',
]
await Promise.all(
prerender.map(route => renderViaHTTP(context.appPort, route)) | true |
Other | vercel | next.js | cc9678056e3e32fe37be418d0c9c1c85e3efecb0.json | Fix inconsistent handling for /index (#11643)
* Fix inconsistent handling for /index
* Add more test cases
* Add pages/index/index.js test
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | test/integration/conflicting-public-file-page/test/index.test.js | @@ -16,7 +16,7 @@ describe('Errors on conflict between public file and page file', () => {
it('Throws error during development', async () => {
const appPort = await findPort()
const app = await launchApp(appDir, appPort)
- const conflicts = ['/another/conflict', '/another/index', '/hello']
+ const co... | true |
Other | vercel | next.js | cc9678056e3e32fe37be418d0c9c1c85e3efecb0.json | Fix inconsistent handling for /index (#11643)
* Fix inconsistent handling for /index
* Add more test cases
* Add pages/index/index.js test
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | test/integration/custom-server/server.js | @@ -29,7 +29,7 @@ app.prepare().then(() => {
}
if (/dashboard/.test(req.url)) {
- return app.render(req, res, '/dashboard/index')
+ return app.render(req, res, '/dashboard')
}
if (/static\/hello\.text/.test(req.url)) { | true |
Other | vercel | next.js | cc9678056e3e32fe37be418d0c9c1c85e3efecb0.json | Fix inconsistent handling for /index (#11643)
* Fix inconsistent handling for /index
* Add more test cases
* Add pages/index/index.js test
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | test/integration/route-index/pages/index/index.js | @@ -0,0 +1,2 @@
+const page = () => 'hello from index'
+export default page | true |
Other | vercel | next.js | cc9678056e3e32fe37be418d0c9c1c85e3efecb0.json | Fix inconsistent handling for /index (#11643)
* Fix inconsistent handling for /index
* Add more test cases
* Add pages/index/index.js test
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | test/integration/route-index/test/index.test.js | @@ -0,0 +1,60 @@
+/* eslint-env jest */
+/* global jasmine */
+import { join } from 'path'
+import {
+ findPort,
+ launchApp,
+ killApp,
+ nextBuild,
+ nextStart,
+ fetchViaHTTP,
+} from 'next-test-utils'
+
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 2
+
+let app
+let appPort
+const appDir = join(__dirname, '... | true |
Other | vercel | next.js | cc9678056e3e32fe37be418d0c9c1c85e3efecb0.json | Fix inconsistent handling for /index (#11643)
* Fix inconsistent handling for /index
* Add more test cases
* Add pages/index/index.js test
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | test/integration/route-indexes/pages/api/sub/[id].js | @@ -0,0 +1 @@
+export default (req, res) => res.end('hi from sub id') | true |
Other | vercel | next.js | cc9678056e3e32fe37be418d0c9c1c85e3efecb0.json | Fix inconsistent handling for /index (#11643)
* Fix inconsistent handling for /index
* Add more test cases
* Add pages/index/index.js test
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | test/integration/route-indexes/pages/api/sub/index.js | @@ -0,0 +1 @@
+export default (req, res) => res.end('hi from sub index') | true |
Other | vercel | next.js | cc9678056e3e32fe37be418d0c9c1c85e3efecb0.json | Fix inconsistent handling for /index (#11643)
* Fix inconsistent handling for /index
* Add more test cases
* Add pages/index/index.js test
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | test/integration/route-indexes/pages/index.js | @@ -0,0 +1,2 @@
+const page = () => 'hello from index'
+export default page | true |
Other | vercel | next.js | cc9678056e3e32fe37be418d0c9c1c85e3efecb0.json | Fix inconsistent handling for /index (#11643)
* Fix inconsistent handling for /index
* Add more test cases
* Add pages/index/index.js test
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | test/integration/route-indexes/pages/nested-index/index/index.js | @@ -0,0 +1 @@
+export default () => 'hello from nested index' | true |
Other | vercel | next.js | cc9678056e3e32fe37be418d0c9c1c85e3efecb0.json | Fix inconsistent handling for /index (#11643)
* Fix inconsistent handling for /index
* Add more test cases
* Add pages/index/index.js test
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | test/integration/route-indexes/pages/sub/[id].js | @@ -0,0 +1,3 @@
+const page = () => 'hello from sub id'
+page.getInitialProps = () => ({ hello: 'hi' })
+export default page | true |
Other | vercel | next.js | cc9678056e3e32fe37be418d0c9c1c85e3efecb0.json | Fix inconsistent handling for /index (#11643)
* Fix inconsistent handling for /index
* Add more test cases
* Add pages/index/index.js test
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | test/integration/route-indexes/pages/sub/index.js | @@ -0,0 +1,3 @@
+const page = () => 'hello from sub index'
+page.getInitialProps = () => ({ hello: 'hi' })
+export default page | true |
Other | vercel | next.js | cc9678056e3e32fe37be418d0c9c1c85e3efecb0.json | Fix inconsistent handling for /index (#11643)
* Fix inconsistent handling for /index
* Add more test cases
* Add pages/index/index.js test
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | test/integration/route-indexes/test/index.test.js | @@ -0,0 +1,138 @@
+/* eslint-env jest */
+/* global jasmine */
+import { join } from 'path'
+import {
+ findPort,
+ launchApp,
+ killApp,
+ nextBuild,
+ nextStart,
+ fetchViaHTTP,
+} from 'next-test-utils'
+
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 2
+
+let app
+let appPort
+const appDir = join(__dirname, ... | true |
Other | vercel | next.js | 9f27259425e23f137a14df6f1707e44f837cba1c.json | chore(deps): remove next-css from examples/antd (#10804)
* chore(deps): remove next-css
* Update examples/with-ant-design/package.json
Co-Authored-By: Jack <jacklee82814@gmail.com>
* Update examples/with-ant-design/pages/_app.js
Co-Authored-By: Jack <jacklee82814@gmail.com>
* chore(lint): fix a linting ... | examples/with-ant-design/.babelrc | @@ -1,12 +0,0 @@
-{
- "presets": ["next/babel"],
- "plugins": [
- [
- "import",
- {
- "libraryName": "antd",
- "style": "css"
- }
- ]
- ]
-} | true |
Other | vercel | next.js | 9f27259425e23f137a14df6f1707e44f837cba1c.json | chore(deps): remove next-css from examples/antd (#10804)
* chore(deps): remove next-css
* Update examples/with-ant-design/package.json
Co-Authored-By: Jack <jacklee82814@gmail.com>
* Update examples/with-ant-design/pages/_app.js
Co-Authored-By: Jack <jacklee82814@gmail.com>
* chore(lint): fix a linting ... | examples/with-ant-design/next.config.js | @@ -1,28 +0,0 @@
-/* eslint-disable */
-const withCss = require('@zeit/next-css')
-
-module.exports = withCss({
- webpack: (config, { isServer }) => {
- if (isServer) {
- const antStyles = /antd\/.*?\/style\/css.*?/
- const origExternals = [...config.externals]
- config.externals = [
- (contex... | true |
Other | vercel | next.js | 9f27259425e23f137a14df6f1707e44f837cba1c.json | chore(deps): remove next-css from examples/antd (#10804)
* chore(deps): remove next-css
* Update examples/with-ant-design/package.json
Co-Authored-By: Jack <jacklee82814@gmail.com>
* Update examples/with-ant-design/pages/_app.js
Co-Authored-By: Jack <jacklee82814@gmail.com>
* chore(lint): fix a linting ... | examples/with-ant-design/package.json | @@ -8,10 +8,8 @@
},
"dependencies": {
"@zeit/next-css": "^1.0.1",
- "antd": "^3.9.2",
- "babel-plugin-import": "^1.9.1",
+ "antd": "^4.0.1",
"next": "latest",
- "null-loader": "2.0.0",
"react": "^16.7.0",
"react-dom": "^16.7.0"
}, | true |
Other | vercel | next.js | 9f27259425e23f137a14df6f1707e44f837cba1c.json | chore(deps): remove next-css from examples/antd (#10804)
* chore(deps): remove next-css
* Update examples/with-ant-design/package.json
Co-Authored-By: Jack <jacklee82814@gmail.com>
* Update examples/with-ant-design/pages/_app.js
Co-Authored-By: Jack <jacklee82814@gmail.com>
* chore(lint): fix a linting ... | examples/with-ant-design/pages/_app.js | @@ -0,0 +1,5 @@
+import 'antd/dist/antd.css'
+
+export default function MyApp({ Component, pageProps }) {
+ return <Component {...pageProps} />
+} | true |
Other | vercel | next.js | 8f4e265f76db4480576e9b7a3223853946f74f19.json | Fix Utility Types (#11077) | packages/next/build/plugins/collect-plugins.ts | @@ -134,11 +134,6 @@ async function collectPluginMeta(
}
}
-type SeparatedPlugins = {
- appMiddlewarePlugins: PluginMetaData[]
- documentMiddlewarePlugins: PluginMetaData[]
-}
-
// clean package name so it can be used as variable
export const getPluginId = (pkg: string): string => {
pkg = pkg.replace(/\W/g... | true |
Other | vercel | next.js | 8f4e265f76db4480576e9b7a3223853946f74f19.json | Fix Utility Types (#11077) | packages/next/next-server/lib/utils.ts | @@ -239,17 +239,19 @@ export type NextApiHandler<T = any> = (
/**
* Utils
*/
-export function execOnce(this: any, fn: (...args: any) => any) {
+export function execOnce<T extends (...args: any[]) => ReturnType<T>>(
+ fn: T
+): T {
let used = false
- let result: any = null
+ let result: ReturnType<T>
- ret... | true |
Other | vercel | next.js | bd85cbdf1770e3a85d43b58cb31fc75237d84905.json | Add repository URL to package.json (#10748)
Co-authored-by: Tim Neutkens <timneutkens@me.com> | packages/next-plugin-google-analytics/package.json | @@ -1,6 +1,10 @@
{
"name": "@next/plugin-google-analytics",
"version": "9.3.5-canary.3",
+ "repository": {
+ "url": "zeit/next.js",
+ "directory": "packages/next-plugin-google-analytics"
+ },
"nextjs": {
"name": "Google Analytics",
"required-env": [ | true |
Other | vercel | next.js | bd85cbdf1770e3a85d43b58cb31fc75237d84905.json | Add repository URL to package.json (#10748)
Co-authored-by: Tim Neutkens <timneutkens@me.com> | packages/next-plugin-material-ui/package.json | @@ -1,6 +1,10 @@
{
"name": "@next/plugin-material-ui",
"version": "9.3.5-canary.3",
+ "repository": {
+ "url": "zeit/next.js",
+ "directory": "packages/next-plugin-material-ui"
+ },
"nextjs": {
"name": "Material UI",
"required-env": [] | true |
Other | vercel | next.js | bd85cbdf1770e3a85d43b58cb31fc75237d84905.json | Add repository URL to package.json (#10748)
Co-authored-by: Tim Neutkens <timneutkens@me.com> | packages/next-plugin-sentry/package.json | @@ -1,6 +1,10 @@
{
"name": "@next/plugin-sentry",
"version": "9.3.5-canary.3",
+ "repository": {
+ "url": "zeit/next.js",
+ "directory": "packages/next-plugin-sentry"
+ },
"nextjs": {
"name": "Sentry",
"required-env": [ | true |
Other | vercel | next.js | bd85cbdf1770e3a85d43b58cb31fc75237d84905.json | Add repository URL to package.json (#10748)
Co-authored-by: Tim Neutkens <timneutkens@me.com> | packages/next-polyfill-nomodule/package.json | @@ -4,6 +4,10 @@
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
+ "repository": {
+ "url": "zeit/next.js",
+ "directory": "packages/next-polyfill-nomodule"
+ },
"scripts": {
"prepublish": "microbundle src/index.js -f iife --n... | true |
Other | vercel | next.js | 301cca3802c0c8f4ebe0d39a7324db35e87c4c4d.json | Update webpack and mkdirp (#11165)
* Update mkdirp to a version that no longer has a dependency on minimist: https://npmjs.com/advisories/1179
* Update webpack to the most recent minor version to remove minimist vulnerability.
* Update deps
Co-authored-by: Tim Neutkens <timneutkens@me.com> | packages/next/package.json | @@ -84,7 +84,7 @@
"jest-worker": "24.9.0",
"loader-utils": "2.0.0",
"mini-css-extract-plugin": "0.8.0",
- "mkdirp": "^0.5.3",
+ "mkdirp": "0.5.3",
"native-url": "0.3.1",
"pnp-webpack-plugin": "1.5.0",
"postcss": "7.0.27",
@@ -97,7 +97,7 @@
"styled-jsx": "3.2.5",
"use-subscr... | true |
Other | vercel | next.js | 301cca3802c0c8f4ebe0d39a7324db35e87c4c4d.json | Update webpack and mkdirp (#11165)
* Update mkdirp to a version that no longer has a dependency on minimist: https://npmjs.com/advisories/1179
* Update webpack to the most recent minor version to remove minimist vulnerability.
* Update deps
Co-authored-by: Tim Neutkens <timneutkens@me.com> | yarn.lock | @@ -2998,150 +2998,149 @@
semver "^6.3.0"
tsutils "^3.17.1"
-"@webassemblyjs/ast@1.8.5":
- version "1.8.5"
- resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359"
- integrity sha512-aJMfngIZ65+t71C3y2nBBg5FFG0Okt9m0XEgWZ7Ywgn1oMAT8cNwx00Uv1cQy... | true |
Other | vercel | next.js | 20f2b0b3b2decc6544a29ddd90c19e2fdbe8b009.json | Add example for polyfilling DOMParser in Node (#10782)
This change updates the README of the `react-intl` example to show how to use
the FormattedHTMLMessage component from `react-intl` in Node environments when
using pre-v4 versions. | examples/with-react-intl/README.md | @@ -57,4 +57,17 @@ $ npm start
You can then switch your browser's language preferences to French and refresh the page to see the UI update accordingly.
+### FormattedHTMLMessage support (react-intl pre-v4)
+
+Out of the box, this example does not support the use of the `FormattedHTMLMessage` component on the serve... | true |
Other | vercel | next.js | 20f2b0b3b2decc6544a29ddd90c19e2fdbe8b009.json | Add example for polyfilling DOMParser in Node (#10782)
This change updates the README of the `react-intl` example to show how to use
the FormattedHTMLMessage component from `react-intl` in Node environments when
using pre-v4 versions. | examples/with-react-intl/server.js | @@ -4,6 +4,12 @@ const IntlPolyfill = require('intl')
Intl.NumberFormat = IntlPolyfill.NumberFormat
Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat
+// Polyfill DOMParser for **pre-v4** react-intl used by formatjs.
+// Only needed when using FormattedHTMLMessage. Make sure to install `xmldom`.
+// See: https://gi... | true |
Other | vercel | next.js | 6e84c0c12ac89071c9bae7cc2e57c5769b05867a.json | Add dependencies used by compiled files (#11699)
* Add dependencies used by compiled files
* Update utils.ts | packages/next/package.json | @@ -79,10 +79,12 @@
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
"browserslist": "4.8.3",
"css-loader": "3.3.0",
+ "find-cache-dir": "3.3.1",
"fork-ts-checker-webpack-plugin": "3.1.1",
"jest-worker": "24.9.0",
"loader-utils": "2.0.0",
"mini-css-extract-plugin": "0.8.... | true |
Other | vercel | next.js | 6e84c0c12ac89071c9bae7cc2e57c5769b05867a.json | Add dependencies used by compiled files (#11699)
* Add dependencies used by compiled files
* Update utils.ts | yarn.lock | @@ -4164,7 +4164,7 @@ browserify-zlib@^0.2.0:
dependencies:
pako "~1.0.5"
-browserslist@4.8.3, browserslist@^1.3.6, browserslist@^1.5.2, browserslist@^1.7.6, browserslist@^4.0.0, browserslist@^4.3.6, browserslist@^4.6.0, browserslist@^4.6.4, browserslist@^4.8.0, browserslist@^4.8.2, browserslist@^4.8.3:
+brow... | true |
Other | vercel | next.js | 7b0802eb40c64c23fb47bd4d353b81cd5e3fac9e.json | Use function for function components (#11695) | packages/create-next-app/templates/default/pages/index.js | @@ -1,203 +1,204 @@
import Head from 'next/head'
-const Home = () => (
- <div className="container">
- <Head>
- <title>Create Next App</title>
- <link rel="icon" href="/favicon.ico" />
- </Head>
-
- <main>
- <h1 className="title">
- Welcome to <a href="https://nextjs.org">Next.js!</a>... | false |
Other | vercel | next.js | e3a35b2a3e711972078d2a4a509530b62a51dec1.json | Update Automatic Static Optimization docs (#11618) | docs/advanced-features/automatic-static-optimization.md | @@ -4,7 +4,7 @@ description: Next.js automatically optimizes your app to be static HTML whenever
# Automatic Static Optimization
-Next.js automatically determines that a page is static (can be prerendered) if it has no blocking data requirements. This determination is made by the absence of `getInitialProps` in th... | false |
Other | vercel | next.js | 89b69865fb2a41d65a8e827ea829f2ff8ce83a1f.json | Fix documentation link in Basic API routes example (#11671)
Link to description of API Routes in the main README of the repo is broken. Replaced with a link to the documentation. | examples/api-routes/README.md | @@ -1,6 +1,6 @@
# Basic API routes example
-Next.js ships with [API routes](https://github.com/zeit/next.js#api-routes) which provides an easy solution to build your own `API`. This example shows how to create multiple `API` endpoints with serverless functions, which can execute independently.
+Next.js ships with [A... | false |
Other | vercel | next.js | 2bfbfea635847ecf76c1aa805cb49b8a6c8b515b.json | Update FAQ link (#11636)
to new Data fetching documentation | docs/faq.md | @@ -46,7 +46,7 @@ description: Get to know more about Next.js with the frequently asked questions.
<details>
<summary>How do I fetch data?</summary>
- <p>It's up to you. You can use the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch">fetch API</a> inside your React components, or... | false |
Other | vercel | next.js | b747a366abe9e2971e749c0a726b55f10cf82f68.json | Fix Preview Mode in `<iframe>` (#11638) | packages/next/next-server/server/api-utils.ts | @@ -391,15 +391,17 @@ function setPreviewData<T>(
: []),
serialize(COOKIE_NAME_PRERENDER_BYPASS, options.previewModeId, {
httpOnly: true,
- sameSite: 'lax',
+ sameSite: process.env.NODE_ENV !== 'development' ? 'none' : 'lax',
+ secure: process.env.NODE_ENV !== 'development',
pat... | true |
Other | vercel | next.js | b747a366abe9e2971e749c0a726b55f10cf82f68.json | Fix Preview Mode in `<iframe>` (#11638) | packages/next/package.json | @@ -115,7 +115,7 @@
"@types/ci-info": "2.0.0",
"@types/compression": "0.0.36",
"@types/content-type": "1.1.3",
- "@types/cookie": "0.3.2",
+ "@types/cookie": "0.3.3",
"@types/cross-spawn": "6.0.0",
"@types/dotenv": "8.2.0",
"@types/etag": "1.8.0", | true |
Other | vercel | next.js | b747a366abe9e2971e749c0a726b55f10cf82f68.json | Fix Preview Mode in `<iframe>` (#11638) | test/integration/getserversideprops-preview/test/index.test.js | @@ -68,16 +68,16 @@ function runTests(startServer = nextStart) {
const res = await fetchViaHTTP(appPort, '/api/preview', { lets: 'goooo' })
expect(res.status).toBe(200)
- const cookies = res.headers
- .get('set-cookie')
- .split(',')
- .map(cookie.parse)
+ const originalCookies = res.he... | true |
Other | vercel | next.js | b747a366abe9e2971e749c0a726b55f10cf82f68.json | Fix Preview Mode in `<iframe>` (#11638) | test/integration/prerender-preview/test/index.test.js | @@ -74,16 +74,16 @@ function runTests(startServer = nextStart) {
const res = await fetchViaHTTP(appPort, '/api/preview', { lets: 'goooo' })
expect(res.status).toBe(200)
- const cookies = res.headers
- .get('set-cookie')
- .split(',')
- .map(cookie.parse)
+ const originalCookies = res.he... | true |
Other | vercel | next.js | b747a366abe9e2971e749c0a726b55f10cf82f68.json | Fix Preview Mode in `<iframe>` (#11638) | yarn.lock | @@ -2524,10 +2524,10 @@
resolved "https://registry.yarnpkg.com/@types/content-type/-/content-type-1.1.3.tgz#3688bd77fc12f935548eef102a4e34c512b03a07"
integrity sha512-pv8VcFrZ3fN93L4rTNIbbUzdkzjEyVMp5mPVjsFfOYTDOZMZiZ8P1dhu+kEv3faYyKzZgLlSvnyQNFg+p/v5ug==
-"@types/cookie@0.3.2":
- version "0.3.2"
- resolved "... | true |
Other | vercel | next.js | 641976a471d64a99ca997af70f5add55509937b6.json | Replace getInitialProps with getServerSideProps (#11586) | examples/with-firebase-authentication/pages/index.js | @@ -5,16 +5,21 @@ import 'firebase/firestore'
import 'isomorphic-unfetch'
import clientCredentials from '../credentials/client'
-export default class Index extends Component {
- static async getInitialProps({ req, query }) {
- const user = req && req.session ? req.session.decodedToken : null
- // don't fetch... | false |
Other | vercel | next.js | c97aca50e509fac66ef380f6435c556d25290d27.json | Show webpack errors in all pages. (#2588)
* Show webpack errors in all pages.
When there's a webpack error that means HMR failed too.
So, showing other pages won't makes sense since user
can't edit them and get changes via HMR.
That's why now we show the error on all pages.
* Remove exact propType checks from t... | lib/error.js | @@ -1,6 +1,5 @@
import React from 'react'
import PropTypes from 'prop-types'
-import exact from 'prop-types-exact'
import HTTPStatus from 'http-status'
import Head from './head'
@@ -10,9 +9,9 @@ export default class Error extends React.Component {
return { statusCode }
}
- static propTypes = exact({
+ ... | true |
Other | vercel | next.js | c97aca50e509fac66ef380f6435c556d25290d27.json | Show webpack errors in all pages. (#2588)
* Show webpack errors in all pages.
When there's a webpack error that means HMR failed too.
So, showing other pages won't makes sense since user
can't edit them and get changes via HMR.
That's why now we show the error on all pages.
* Remove exact propType checks from t... | lib/router/router.js | @@ -299,19 +299,29 @@ export default class Router {
cancelled = true
}
- const Component = await this.fetchRoute(route)
+ try {
+ const Component = await this.fetchRoute(route)
- if (cancelled) {
- const error = new Error(`Abort fetching component for route: "${route}"`)
- error.... | true |
Other | vercel | next.js | c97aca50e509fac66ef380f6435c556d25290d27.json | Show webpack errors in all pages. (#2588)
* Show webpack errors in all pages.
When there's a webpack error that means HMR failed too.
So, showing other pages won't makes sense since user
can't edit them and get changes via HMR.
That's why now we show the error on all pages.
* Remove exact propType checks from t... | server/index.js | @@ -12,7 +12,6 @@ import {
renderScriptError
} from './render'
import Router from './router'
-import { resolveFromList } from './resolve'
import { getAvailableChunks } from './utils'
import getConfig from './config'
// We need to go up one more level since we are in the `dist` directory
@@ -190,7 +189,7 @@ expo... | true |
Other | vercel | next.js | b1b0b889457600cb55f939d640924f4122f899d4.json | Move react-dom into commons.js always. (#2572) | server/build/webpack.js | @@ -1,4 +1,4 @@
-import { resolve, join } from 'path'
+import { resolve, join, sep } from 'path'
import { createHash } from 'crypto'
import webpack from 'webpack'
import glob from 'glob-promise'
@@ -103,6 +103,13 @@ export default async function createCompiler (dir, { dev = false, quiet = false,
return mo... | false |
Other | vercel | next.js | f25055c9f774e20bb1cbc89023b58cd3f5cd40bf.json | Load the hot-reloader when only needed. (#2566)
This reduce the server boot-up time a lot.
With a 2015 MacBook Pro, it went down from 1000ms to 200ms | server/index.js | @@ -12,7 +12,6 @@ import {
renderScriptError
} from './render'
import Router from './router'
-import HotReloader from './hot-reloader'
import { resolveFromList } from './resolve'
import { getAvailableChunks } from './utils'
import getConfig from './config'
@@ -35,7 +34,7 @@ export default class Server {
th... | false |
Other | vercel | next.js | b47395ab2f3116f44aafa50a2a23058d99fcbd79.json | Fix non valid trailing comma (#2560) | examples/with-static-export/package.json | @@ -15,5 +15,5 @@
"export": "next export",
"prestart": "npm run export",
"start": "serve out"
- },
+ }
} | false |
Other | vercel | next.js | b253479a94091bb79ea30d759b73532d7a29849a.json | Fix the build of with-material-ui-next (#2550) | examples/with-material-ui-next/styles/createDefaultContext.js | @@ -1,7 +1,7 @@
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'
import createPalette from 'material-ui/styles/palette'
import createMuiTheme from 'material-ui/styles/theme'
-import { purple, green } from 'material-ui/styles/colors'
+import { purple, green } from 'material-ui/colors'
const creat... | false |
Other | vercel | next.js | c9b4add394970743fdfee3b4c8a84636a54c7f6e.json | Fix spelling of built-in (#2546) | readme.md | @@ -792,9 +792,9 @@ export default class Error extends React.Component {
}
```
-### Reusing the build in error page
+### Reusing the built-in error page
-If you want to render the build in error page you can by using `next/error`:
+If you want to render the built-in error page you can by using `next/error`:
``... | false |
Other | vercel | next.js | 24c2e9954aaf4bd8316dc941a4fff05c19d70b01.json | Add stringify advice to MobX example readme. (#2541) | examples/with-mobx/README.md | @@ -37,6 +37,9 @@ This example is a mobx port of the [with-redux](https://github.com/zeit/next.js/
}
```
+### Rehydrating with server data
+Be aware that data that was used on the server (and provided via `getInitialProps`) will be stringified in order to rehydrate the client with it. That means, if you create a st... | false |
Other | vercel | next.js | ee29abb8d155b93a05d25fa672c64bc2b3ae9c06.json | Add propType check with validation (#2516) | lib/error.js | @@ -1,4 +1,6 @@
import React from 'react'
+import PropTypes from 'prop-types'
+import exact from 'prop-types-exact'
import HTTPStatus from 'http-status'
import Head from './head'
@@ -8,6 +10,10 @@ export default class Error extends React.Component {
return { statusCode }
}
+ static propTypes = exact({
+... | true |
Other | vercel | next.js | ee29abb8d155b93a05d25fa672c64bc2b3ae9c06.json | Add propType check with validation (#2516) | lib/link.js | @@ -3,6 +3,7 @@
import { resolve, format, parse } from 'url'
import React, { Component, Children } from 'react'
import PropTypes from 'prop-types'
+import exact from 'prop-types-exact'
import Router, { _rewriteUrlForNextExport } from './router'
import { warn, execOnce, getLocationOrigin } from './utils'
@@ -13,7... | true |
Other | vercel | next.js | ee29abb8d155b93a05d25fa672c64bc2b3ae9c06.json | Add propType check with validation (#2516) | package.json | @@ -83,6 +83,7 @@
"path-match": "1.2.4",
"pkg-up": "2.0.0",
"prop-types": "15.5.10",
+ "prop-types-exact": "^1.1.1",
"react-hot-loader": "3.0.0-beta.7",
"recursive-copy": "^2.0.6",
"send": "^0.15.3", | true |
Other | vercel | next.js | ee29abb8d155b93a05d25fa672c64bc2b3ae9c06.json | Add propType check with validation (#2516) | yarn.lock | @@ -4003,10 +4003,18 @@ object-assign@^4.0.1, object-assign@^4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
-object-keys@^1.0.8:
+object-keys@^1.0.10, object-keys@^1.0.8:
version "1.0.11"
resolved "https://reg... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.