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 | 4b257483e2974cfde843447380ebdf77fb83029c.json | Add Apollo example (#780)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the Apol... | examples/with-apollo/lib/withData.js | @@ -0,0 +1,49 @@
+import { ApolloProvider, getDataFromTree } from 'react-apollo'
+import React from 'react'
+import 'isomorphic-fetch'
+import { initClient } from './initClient'
+import { initStore } from './initStore'
+
+export default (Component) => (
+ class extends React.Component {
+ static async getInitialPro... | true |
Other | vercel | next.js | 4b257483e2974cfde843447380ebdf77fb83029c.json | Add Apollo example (#780)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the Apol... | examples/with-apollo/package.json | @@ -0,0 +1,21 @@
+{
+ "name": "with-apollo",
+ "version": "1.0.0",
+ "scripts": {
+ "dev": "next",
+ "build": "next build",
+ "start": "next start"
+ },
+ "dependencies": {
+ "apollo-client": "^0.7.3",
+ "graphql": "^0.8.2",
+ "graphql-tag": "^1.2.3",
+ "next": "^2.0.0-beta",
+ "react-apoll... | true |
Other | vercel | next.js | 4b257483e2974cfde843447380ebdf77fb83029c.json | Add Apollo example (#780)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the Apol... | examples/with-apollo/pages/about.js | @@ -0,0 +1,23 @@
+import App from '../components/App'
+import Header from '../components/Header'
+
+export default (props) => (
+ <App>
+ <Header pathname={props.url.pathname} />
+ <article>
+ <h1>The Idea Behind This Example</h1>
+ <p>
+ <a href='http://dev.apollodata.com'>Apollo</a> is a Graph... | true |
Other | vercel | next.js | 4b257483e2974cfde843447380ebdf77fb83029c.json | Add Apollo example (#780)
* Add minimal apollo example
* Update apollo example README
* Update apollo example demo link in README
* Fix button styles
* Fix show more button
* Alias demo url
* Include the data field on the Apollo store when hydrating
* Revert
* Include the data field on the Apol... | examples/with-apollo/pages/index.js | @@ -0,0 +1,13 @@
+import App from '../components/App'
+import Header from '../components/Header'
+import Submit from '../components/Submit'
+import PostList from '../components/PostList'
+import withData from '../lib/withData'
+
+export default withData((props) => (
+ <App>
+ <Header pathname={props.url.pathname} /... | true |
Other | vercel | next.js | 513a7d5b5c44a1a288b68a9c06616e3356808098.json | Update head-manager to compress better (#10687)
* Update head-manager to compress better
* Decrease size limit test | packages/next/client/head-manager.js | @@ -5,90 +5,6 @@ const DOMAttributeNames = {
httpEquiv: 'http-equiv',
}
-export default class HeadManager {
- constructor() {
- this.updatePromise = null
- }
-
- updateHead = head => {
- const promise = (this.updatePromise = Promise.resolve().then(() => {
- if (promise !== this.updatePromise) return... | true |
Other | vercel | next.js | 513a7d5b5c44a1a288b68a9c06616e3356808098.json | Update head-manager to compress better (#10687)
* Update head-manager to compress better
* Decrease size limit test | packages/next/client/index.js | @@ -1,7 +1,7 @@
/* global location */
import React from 'react'
import ReactDOM from 'react-dom'
-import HeadManager from './head-manager'
+import initHeadManager from './head-manager'
import { createRouter, makePublicRouterInstance } from 'next/router'
import mitt from '../next-server/lib/mitt'
import { loadGetI... | true |
Other | vercel | next.js | 513a7d5b5c44a1a288b68a9c06616e3356808098.json | Update head-manager to compress better (#10687)
* Update head-manager to compress better
* Decrease size limit test | test/integration/size-limit/test/index.test.js | @@ -80,7 +80,7 @@ describe('Production response size', () => {
)
// These numbers are without gzip compression!
- const delta = responseSizesBytes - 238 * 1024
+ const delta = responseSizesBytes - 237 * 1024
expect(delta).toBeLessThanOrEqual(1024) // don't increase size more than 1kb
expect(... | true |
Other | vercel | next.js | a81913f1ba019c767da0d876a0b18f2922bd9d5e.json | Fix apollo example (#10696) | examples/with-apollo/lib/apollo.js | @@ -1,5 +1,6 @@
import React from 'react'
import App from 'next/app'
+import Head from 'next/head'
import { ApolloProvider } from '@apollo/react-hooks'
import createApolloClient from '../apolloClient'
@@ -153,6 +154,10 @@ export const withApollo = ({ ssr = false } = {}) => PageComponent => {
// https... | false |
Other | vercel | next.js | c3d914919aee8a08268f4bbed13f06abfde00d46.json | Fix Double URL Encoding for Serverless (#10663) | packages/next/build/webpack/loaders/next-serverless-loader.ts | @@ -301,7 +301,7 @@ const nextServerlessLoader: loader.Loader = function() {
return Object.keys(obj).reduce(
(prev, key) =>
Object.assign(prev, {
- [key]: encodeURIComponent(obj[key])
+ ... | true |
Other | vercel | next.js | c3d914919aee8a08268f4bbed13f06abfde00d46.json | Fix Double URL Encoding for Serverless (#10663) | test/integration/serverless/pages/catchall/[...slug].js | @@ -0,0 +1,5 @@
+const SlugPage = ({ query }) => <div>{JSON.stringify(query)}</div>
+
+SlugPage.getInitialProps = ({ query }) => ({ query })
+
+export default SlugPage | true |
Other | vercel | next.js | c3d914919aee8a08268f4bbed13f06abfde00d46.json | Fix Double URL Encoding for Serverless (#10663) | test/integration/serverless/test/index.test.js | @@ -251,10 +251,30 @@ describe('Serverless', () => {
expect(data.query).toEqual({ slug: paramRaw })
})
- it('should have the correct query string for a spr route', async () => {
+ it('should have the correct query string for a now route', async () => {
const paramRaw = 'test % 123'
const html = aw... | true |
Other | vercel | next.js | 156a77409bed5f18947ece8572a24ae6808199ee.json | Fix typo in invalid getStaticPaths value example (#10657) | errors/invalid-getstaticpaths-value.md | @@ -9,7 +9,7 @@ In one of the page's `unstable_getStaticPaths` the return value had the incorrec
Make sure to return the following shape from `unstable_getStaticPaths`:
```js
-export async function unstable_getStaticProps() {
+export async function unstable_getStaticPaths() {
return {
paths: Array<string | ... | false |
Other | vercel | next.js | 43a70c7ef15fdcdefe1930259045713e24076f5d.json | Fix Cookie Expiration (#10634) | packages/next/next-server/server/api-utils.ts | @@ -414,13 +414,19 @@ function clearPreviewData<T>(res: NextApiResponse<T>): NextApiResponse<T> {
? previous
: []),
serialize(COOKIE_NAME_PRERENDER_BYPASS, '', {
- maxAge: 0,
+ // To delete a cookie, set `expires` to a date in the past:
+ // https://tools.ietf.org/html/rfc6265#section-... | true |
Other | vercel | next.js | 43a70c7ef15fdcdefe1930259045713e24076f5d.json | Fix Cookie Expiration (#10634) | test/integration/prerender-preview/test/index.test.js | @@ -106,22 +106,25 @@ function runTests() {
const cookies = res.headers
.get('set-cookie')
+ .replace(/(=\w{3}),/g, '$1')
.split(',')
.map(cookie.parse)
expect(cookies.length).toBe(2)
expect(cookies[0]).toMatchObject({
Path: '/',
SameSite: 'Strict',
- 'Max... | true |
Other | vercel | next.js | ee7ea03a59a6012a73b275313d2a41efd0fea280.json | Remove deprecated static folder (#10632) | examples/custom-server-typescript/nodemon.json | @@ -1,5 +1,5 @@
{
- "watch": ["server", "static"],
+ "watch": ["server"],
"exec": "ts-node --project tsconfig.server.json server/index.ts",
"ext": "js ts"
} | false |
Other | vercel | next.js | 95071730b6c57e86e944ddacbac0be0858712d85.json | Add err.sh for getStaticProps error (#10619)
* Add err.sh for getStaticProps error
* Prettify error
Co-authored-by: Joe Haddad <timer150@gmail.com> | errors/invalid-getstaticprops-value.md | @@ -0,0 +1,17 @@
+# Invalid unstable_getStaticProps Return Value
+
+#### Why This Error Occurred
+
+In one of the page's `unstable_getStaticProps` the return value had the incorrect shape.
+
+#### Possible Ways to Fix It
+
+Make sure to return the following shape from `unstable_getStaticProps`:
+
+```js
+export async f... | true |
Other | vercel | next.js | 95071730b6c57e86e944ddacbac0be0858712d85.json | Add err.sh for getStaticProps error (#10619)
* Add err.sh for getStaticProps error
* Prettify error
Co-authored-by: Joe Haddad <timer150@gmail.com> | packages/next/cli/next-build.ts | @@ -45,7 +45,7 @@ const nextBuild: cliCommand = argv => {
build(dir)
.then(() => process.exit(0))
.catch(err => {
- // tslint:disable-next-line
+ console.error('')
console.error('> Build error occurred')
printAndExit(err)
}) | true |
Other | vercel | next.js | 95071730b6c57e86e944ddacbac0be0858712d85.json | Add err.sh for getStaticProps error (#10619)
* Add err.sh for getStaticProps error
* Prettify error
Co-authored-by: Joe Haddad <timer150@gmail.com> | packages/next/export/worker.js | @@ -264,8 +264,8 @@ export default async function({
return results
} catch (error) {
console.error(
- `\nError occurred prerendering page "${path}" https://err.sh/zeit/next.js/prerender-error:`,
- error
+ `\nError occurred prerendering page "${path}" https://err.sh/next.js/prerender-error:\n... | true |
Other | vercel | next.js | 95071730b6c57e86e944ddacbac0be0858712d85.json | Add err.sh for getStaticProps error (#10619)
* Add err.sh for getStaticProps error
* Prettify error
Co-authored-by: Joe Haddad <timer150@gmail.com> | packages/next/next-server/server/render.tsx | @@ -246,7 +246,8 @@ const invalidKeysMsg = (methodName: string, invalidKeys: string[]) => {
return (
`Additional keys were returned from \`${methodName}\`. Properties intended for your component must be nested under the \`props\` key, e.g.:` +
`\n\n\treturn { props: { title: 'My Title', content: '...' } }`... | true |
Other | vercel | next.js | a8b39889f33524ad1f1a0334d3092e3532a8c313.json | Update legacy safari test for GitHub actions (#10618) | test/integration/production-nav/test/index.test.js | @@ -1,12 +1,7 @@
/* eslint-env jest */
/* global jasmine */
-import {
- nextBuild,
- findPort,
- nextStart,
- killApp,
- waitFor,
-} from 'next-test-utils'
+import { nextBuild, nextStart, killApp, waitFor } from 'next-test-utils'
+import getPort from 'get-port'
import webdriver from 'next-webdriver'
import { j... | true |
Other | vercel | next.js | a8b39889f33524ad1f1a0334d3092e3532a8c313.json | Update legacy safari test for GitHub actions (#10618) | test/jest-environment.js | @@ -76,7 +76,11 @@ class CustomEnvironment extends NodeEnvironment {
this.server.close()
}
if (this.global.wd) {
- await this.global.wd.quit()
+ try {
+ await this.global.wd.quit()
+ } catch (err) {
+ console.log(`Failed to quit webdriver instance`, err)
+ }
}
... | true |
Other | vercel | next.js | a8b39889f33524ad1f1a0334d3092e3532a8c313.json | Update legacy safari test for GitHub actions (#10618) | test/lib/next-webdriver.js | @@ -105,16 +105,6 @@ let browser = new Builder()
global.wd = browser
-/*
- # Methods to match
-
- - elementByCss
- - elementsByCss
- - waitForElementByCss
- - elementByCss.text
- - elementByCss.click
-*/
-
let initialWindow
let deviceIP = 'localhost'
@@ -166,7 +156,7 @@ export default async (appPort, pat... | true |
Other | vercel | next.js | 00855de60a76045b6d93b563a175940017aa6679.json | Add navigation test specific for Safari 10 (#10616)
* Add testing in Safari 10.1 on merge
* Add nav test specific for Safari 10 | .github/workflows/build_test_deploy.yml | @@ -82,8 +82,8 @@ jobs:
runs-on: ubuntu-latest
needs: build
env:
- NEXT_TELEMETRY_DISABLED: 1
BROWSERSTACK: true
+ NEXT_TELEMETRY_DISABLED: 1
SKIP_LOCAL_SELENIUM_SERVER: true
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ sec... | true |
Other | vercel | next.js | 00855de60a76045b6d93b563a175940017aa6679.json | Add navigation test specific for Safari 10 (#10616)
* Add testing in Safari 10.1 on merge
* Add nav test specific for Safari 10 | test/integration/production-nav/pages/another.js | @@ -0,0 +1,9 @@
+import Link from 'next/link'
+
+export default () => (
+ <>
+ <Link href="/">
+ <a id="to-index">Index</a>
+ </Link>
+ </>
+) | true |
Other | vercel | next.js | 00855de60a76045b6d93b563a175940017aa6679.json | Add navigation test specific for Safari 10 (#10616)
* Add testing in Safari 10.1 on merge
* Add nav test specific for Safari 10 | test/integration/production-nav/pages/index.js | @@ -0,0 +1,9 @@
+import Link from 'next/link'
+
+export default () => (
+ <>
+ <Link href="/another">
+ <a id="to-another">Another</a>
+ </Link>
+ </>
+) | true |
Other | vercel | next.js | 00855de60a76045b6d93b563a175940017aa6679.json | Add navigation test specific for Safari 10 (#10616)
* Add testing in Safari 10.1 on merge
* Add nav test specific for Safari 10 | test/integration/production-nav/test/index.test.js | @@ -0,0 +1,37 @@
+/* eslint-env jest */
+/* global jasmine */
+import {
+ nextBuild,
+ findPort,
+ nextStart,
+ killApp,
+ waitFor,
+} from 'next-test-utils'
+import webdriver from 'next-webdriver'
+import { join } from 'path'
+
+const appDir = join(__dirname, '../')
+let appPort
+let app
+jasmine.DEFAULT_TIMEOUT_... | true |
Other | vercel | next.js | 00855de60a76045b6d93b563a175940017aa6679.json | Add navigation test specific for Safari 10 (#10616)
* Add testing in Safari 10.1 on merge
* Add nav test specific for Safari 10 | test/lib/next-webdriver.js | @@ -15,6 +15,7 @@ const {
BROWSERSTACK_ACCESS_KEY,
HEADLESS,
CHROME_BIN,
+ LEGACY_SAFARI,
} = process.env
let capabilities = {}
@@ -37,6 +38,12 @@ if (isBrowserStack) {
os_version: 'Mojave',
browser: 'Safari',
}
+ const safariLegacyOpts = {
+ os: 'OS X',
+ os_version: 'Sierra',
+ br... | true |
Other | vercel | next.js | 00855de60a76045b6d93b563a175940017aa6679.json | Add navigation test specific for Safari 10 (#10616)
* Add testing in Safari 10.1 on merge
* Add nav test specific for Safari 10 | yarn.lock | @@ -4145,7 +4145,7 @@ browserify-zlib@^0.2.0:
dependencies:
pako "~1.0.5"
-browserslist@4.8.3, 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:
+browserslist@4.8.3, browserslist@^1.3.6, browserslist@^1.5.2, brows... | true |
Other | vercel | next.js | 80bdf73929b4531482631ff3ac766af09873a9ef.json | Remove extra whitespace | errors/invalid-getstaticpaths-value.md | @@ -15,4 +15,3 @@ export async function unstable_getStaticProps() {
}
}
```
- | false |
Other | vercel | next.js | db445db790a9a7038025a6847fc61cde9e977610.json | Add err.sh for invalid getStaticPaths return value (#10605)
* Add err.sh for invalid getStaticPaths return value
* Update error link
* Apply suggestions from code review
Co-authored-by: Tim Neutkens <tim@timneutkens.nl> | errors/invalid-getstaticpaths-value.md | @@ -0,0 +1,18 @@
+# Invalid unstable_getStaticPaths Return Value
+
+#### Why This Error Occurred
+
+In one of the page's `unstable_getStaticPaths` the return value had the incorrect shape.
+
+#### Possible Ways to Fix It
+
+Make sure to return the following shape from `unstable_getStaticPaths`:
+
+```js
+export async f... | true |
Other | vercel | next.js | db445db790a9a7038025a6847fc61cde9e977610.json | Add err.sh for invalid getStaticPaths return value (#10605)
* Add err.sh for invalid getStaticPaths return value
* Update error link
* Apply suggestions from code review
Co-authored-by: Tim Neutkens <tim@timneutkens.nl> | packages/next/build/utils.ts | @@ -562,7 +562,9 @@ export async function isPageStatic(
const staticPathsResult = await (mod.unstable_getStaticPaths as Unstable_getStaticPaths)()
- const expectedReturnVal = `Expected: { paths: [] }`
+ const expectedReturnVal =
+ `Expected: { paths: [] }\n` +
+ `See here for more inf... | true |
Other | vercel | next.js | 1c64c1e93c5e6e0855b1cff987889886b155e34a.json | fix: Improve grammar of apollo.js comments (#10601) | examples/with-apollo/lib/apollo.js | @@ -3,12 +3,12 @@ import App from 'next/app'
import { ApolloProvider } from '@apollo/react-hooks'
import createApolloClient from '../apolloClient'
-// On the client we store the apollo client in the following variable
-// this prevents the client from reinitializing between page transitions.
+// On the client, we s... | false |
Other | vercel | next.js | d7167e28e0d5fc4ef437a608f1dd0d85f21fe209.json | Fix AMP Validator Version (#10600) | packages/next/package.json | @@ -74,7 +74,7 @@
"@babel/runtime": "7.7.2",
"@babel/types": "7.7.4",
"@next/polyfill-nomodule": "9.2.3-canary.4",
- "amphtml-validator": "1.0.23",
+ "amphtml-validator": "1.0.30",
"async-retry": "1.2.3",
"async-sema": "3.0.0",
"autodll-webpack-plugin": "0.4.2", | true |
Other | vercel | next.js | d7167e28e0d5fc4ef437a608f1dd0d85f21fe209.json | Fix AMP Validator Version (#10600) | yarn.lock | @@ -3326,15 +3326,6 @@ amdefine@>=0.0.4:
resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=
-amphtml-validator@1.0.23:
- version "1.0.23"
- resolved "https://registry.yarnpkg.com/amphtml-validator/-/amphtml... | true |
Other | vercel | next.js | b3fad60d7d49fee1ef6f2f60f6be5f520f4456a8.json | use clearInterval instead of clearTimer on a timer (#10597)
Co-authored-by: JJ Kasper <jj@jjsweb.site> | packages/next/client/dev/error-overlay/eventsource.js | @@ -46,7 +46,7 @@ function EventSourceWrapper(options) {
return {
close: () => {
- clearTimeout(timer)
+ clearInterval(timer)
source.close()
},
addMessageListener: function(fn) { | false |
Other | vercel | next.js | 5e12e5f56aa40f2633d11371b69466c622dfd934.json | Emit ES5 Friendly Code in Program#exit Visitor (#10591)
* Emit ES5 Friendly Code in Program#exit Visitor
* Document reasoning
* updt
* Update next-ssg-transform.ts | packages/next/build/babel/plugins/next-ssg-transform.ts | @@ -42,9 +42,13 @@ function decorateSsgExport(
// @ts-ignore invalid return type
const [pageCompPath] = path.replaceWithMultiple([
- t.variableDeclaration('const', [
- t.variableDeclarator(t.identifier(pageComponentVar), prev as any),
- ]),
+ t.variableDeclaration(
+ ... | true |
Other | vercel | next.js | 5e12e5f56aa40f2633d11371b69466c622dfd934.json | Emit ES5 Friendly Code in Program#exit Visitor (#10591)
* Emit ES5 Friendly Code in Program#exit Visitor
* Document reasoning
* updt
* Update next-ssg-transform.ts | test/unit/babel-plugin-next-ssg-transform.test.js | @@ -40,7 +40,7 @@ describe('babel plugin (next-ssg-transform)', () => {
}
`)
expect(output).toMatchInlineSnapshot(
- `"const __NEXT_COMP=function Test(){return __jsx(\\"div\\",null);};__NEXT_COMP.__N_SSG=true export default __NEXT_COMP;"`
+ `"var __NEXT_COMP=function Test(){return _... | true |
Other | vercel | next.js | 5e12e5f56aa40f2633d11371b69466c622dfd934.json | Emit ES5 Friendly Code in Program#exit Visitor (#10591)
* Emit ES5 Friendly Code in Program#exit Visitor
* Document reasoning
* updt
* Update next-ssg-transform.ts | test/unit/next-babel-loader.test.js | @@ -303,7 +303,7 @@ describe('next-babel-loader', () => {
{ resourcePath: pageFile, isServer: false }
)
expect(code).toMatchInlineSnapshot(
- `"import\\"core-js\\";import{bar}from\\"a\\";import baz from\\"b\\";import*as React from\\"react\\";import{yeet}from\\"c\\";import baz3,{cats}from\\... | true |
Other | vercel | next.js | 0a5cc30ee8320c808d09bd5e8f0460333a891f40.json | Add NextApiHandler type (#10573)
* Add NextApiHandler type
* Fix formatting
Co-authored-by: Joe Haddad <timer150@gmail.com> | packages/next/next-server/lib/utils.ts | @@ -219,6 +219,14 @@ export type NextApiResponse<T = any> = ServerResponse & {
clearPreviewData: () => NextApiResponse<T>
}
+/**
+ * Next `API` route handler
+ */
+export type NextApiHandler<T = any> = (
+ req: NextApiRequest,
+ res: NextApiResponse<T>
+) => void
+
/**
* Utils
*/ | true |
Other | vercel | next.js | 0a5cc30ee8320c808d09bd5e8f0460333a891f40.json | Add NextApiHandler type (#10573)
* Add NextApiHandler type
* Fix formatting
Co-authored-by: Joe Haddad <timer150@gmail.com> | packages/next/types/index.d.ts | @@ -9,6 +9,7 @@ import {
NextComponentType,
NextApiResponse,
NextApiRequest,
+ NextApiHandler,
// @ts-ignore This path is generated at build time and conflicts otherwise
} from '../dist/next-server/lib/utils'
@@ -53,6 +54,12 @@ export type PageConfig = {
}
}
-export { NextPageContext, NextComponen... | true |
Other | vercel | next.js | 2c0ff4b92599e5dc93a50d010afbe8fdfbb59c46.json | Fix failing linter tests (#5257)
Wonder how that one got through 🤔 | examples/with-redux-code-splitting/containers/about.js | @@ -8,7 +8,7 @@ const DEFAULT_STATE = {version: 1}
const {actionCreator, getState: getAboutState} = namespaceConfig('about', DEFAULT_STATE)
-const bumpVersion = actionCreator('bumpVersion', function(state, increment) {
+const bumpVersion = actionCreator('bumpVersion', function (state, increment) {
return {...st... | false |
Other | vercel | next.js | 758ad9ce84c98470b71698639f8e4e92842a2434.json | Remove Fragment from Main component (#5222)
Since `__next-error` is no longer necessary, there is no need to wrap the `__next` div in `Fragment`. | server/document.js | @@ -126,9 +126,7 @@ export class Main extends Component {
render () {
const { html } = this.context._documentProps
return (
- <Fragment>
- <div id='__next' dangerouslySetInnerHTML={{ __html: html }} />
- </Fragment>
+ <div id='__next' dangerouslySetInnerHTML={{ __html: html }} />
... | false |
Other | vercel | next.js | e2d331dbcc521c5765a4fe29cacd4ffb345444c6.json | add mocha example (#5182)
Adding an example of testing with Mocha
#4767 | examples/with-mocha/.babelrc | @@ -0,0 +1,13 @@
+{
+ "env": {
+ "development": {
+ "presets": ["next/babel"]
+ },
+ "production": {
+ "presets": ["next/babel"]
+ },
+ "test": {
+ "presets": [["next/babel", { "preset-env": { "modules": "commonjs" } }]]
+ }
+ }
+}
\ No newline at end of file | true |
Other | vercel | next.js | e2d331dbcc521c5765a4fe29cacd4ffb345444c6.json | add mocha example (#5182)
Adding an example of testing with Mocha
#4767 | examples/with-mocha/README.md | @@ -0,0 +1,50 @@
+[](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/with-mocha)
+
+# Example app with Mocha tests
+
+## How to use
+
+### Using `create-next-app`
+
+Execute [`create-next-app`](https://github.com/segmentio/create-... | true |
Other | vercel | next.js | e2d331dbcc521c5765a4fe29cacd4ffb345444c6.json | add mocha example (#5182)
Adding an example of testing with Mocha
#4767 | examples/with-mocha/mocha.setup.js | @@ -0,0 +1,4 @@
+import Enzyme from 'enzyme'
+import Adapter from 'enzyme-adapter-react-16'
+
+Enzyme.configure({ adapter: new Adapter() }) | true |
Other | vercel | next.js | e2d331dbcc521c5765a4fe29cacd4ffb345444c6.json | add mocha example (#5182)
Adding an example of testing with Mocha
#4767 | examples/with-mocha/package.json | @@ -0,0 +1,23 @@
+{
+ "name": "with-mocha",
+ "version": "1.0.0",
+ "scripts": {
+ "test": "NODE_ENV=test mocha",
+ "dev": "next",
+ "build": "next build",
+ "start": "next start"
+ },
+ "dependencies": {
+ "next": "latest",
+ "react": "^16.5.0",
+ "react-dom": "^16.5.0"
+ },
+ "devDependenc... | true |
Other | vercel | next.js | e2d331dbcc521c5765a4fe29cacd4ffb345444c6.json | add mocha example (#5182)
Adding an example of testing with Mocha
#4767 | examples/with-mocha/pages/index.js | @@ -0,0 +1,10 @@
+export default () => (
+ <div>
+ <style jsx>{`
+ p {
+ color: red;
+ }
+ `}</style>
+ <p>Hello World!</p>
+ </div>
+) | true |
Other | vercel | next.js | e2d331dbcc521c5765a4fe29cacd4ffb345444c6.json | add mocha example (#5182)
Adding an example of testing with Mocha
#4767 | examples/with-mocha/test/index.test.js | @@ -0,0 +1,14 @@
+/* global describe, it */
+import { shallow } from 'enzyme'
+import React from 'react'
+import expect from 'expect.js'
+
+import App from '../pages/index.js'
+
+describe('With Enzyme', () => {
+ it('App shows "Hello world!"', () => {
+ const app = shallow(<App />)
+
+ expect(app.find('p').text(... | true |
Other | vercel | next.js | e2d331dbcc521c5765a4fe29cacd4ffb345444c6.json | add mocha example (#5182)
Adding an example of testing with Mocha
#4767 | examples/with-mocha/test/mocha.opts | @@ -0,0 +1,2 @@
+--require @babel/register
+--file mocha.setup.js
\ No newline at end of file | true |
Other | vercel | next.js | 864ea5d0a18ed260c5679fa1764465216288b4ec.json | Remove reference to ./css.js from npm files list (#5179)
./css.js has been removed with [e093441](https://github.com/zeit/next.js/commit/e093441bad588e98765a05df90f76f75283eda07#diff-b9cfc7f2cdf78a7f4b91a753d10865a2) | package.json | @@ -15,7 +15,6 @@
"client.js",
"config.js",
"constants.js",
- "css.js",
"document.js",
"dynamic.js",
"error.js", | false |
Other | vercel | next.js | 34cb05a86074182bc04accf43937d297ececc18e.json | Remove obsolete webpack plugins (#5158)
Since we are now using webpacks `mode` flag we can get rid of:
* `webpack.optimize.ModuleConcatenationPlugin`
* `webpack.DefinePlugin` (`process.env.NODE_ENV`)
https://webpack.js.org/concepts/mode/ | build/webpack.js | @@ -267,14 +267,10 @@ export default async function getBaseWebpackConfig (dir: string, {dev = false, i
// required not to cache removed files
useHashIndex: false
}),
- new webpack.DefinePlugin({
- 'process.env.NODE_ENV': JSON.stringify(dev ? 'development' : 'production')
- }),
... | true |
Other | vercel | next.js | 34cb05a86074182bc04accf43937d297ececc18e.json | Remove obsolete webpack plugins (#5158)
Since we are now using webpacks `mode` flag we can get rid of:
* `webpack.optimize.ModuleConcatenationPlugin`
* `webpack.DefinePlugin` (`process.env.NODE_ENV`)
https://webpack.js.org/concepts/mode/ | test/integration/basic/pages/process-env.js | @@ -0,0 +1,3 @@
+export default () => (
+ <div id='node-env'>{process.env.NODE_ENV}</div>
+) | true |
Other | vercel | next.js | 34cb05a86074182bc04accf43937d297ececc18e.json | Remove obsolete webpack plugins (#5158)
Since we are now using webpacks `mode` flag we can get rid of:
* `webpack.optimize.ModuleConcatenationPlugin`
* `webpack.DefinePlugin` (`process.env.NODE_ENV`)
https://webpack.js.org/concepts/mode/ | test/integration/basic/test/index.test.js | @@ -16,6 +16,7 @@ import hmr from './hmr'
import errorRecovery from './error-recovery'
import dynamic from './dynamic'
import asset from './asset'
+import processEnv from './process-env'
const context = {}
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 5
@@ -42,6 +43,7 @@ describe('Basic Features', () => {
... | true |
Other | vercel | next.js | 34cb05a86074182bc04accf43937d297ececc18e.json | Remove obsolete webpack plugins (#5158)
Since we are now using webpacks `mode` flag we can get rid of:
* `webpack.optimize.ModuleConcatenationPlugin`
* `webpack.DefinePlugin` (`process.env.NODE_ENV`)
https://webpack.js.org/concepts/mode/ | test/integration/basic/test/process-env.js | @@ -0,0 +1,13 @@
+/* global describe, it, expect */
+import webdriver from 'next-webdriver'
+
+export default (context, render) => {
+ describe('process.env', () => {
+ it('should set process.env.NODE_ENV in development', async () => {
+ const browser = await webdriver(context.appPort, '/process-env')
+ c... | true |
Other | vercel | next.js | 34cb05a86074182bc04accf43937d297ececc18e.json | Remove obsolete webpack plugins (#5158)
Since we are now using webpacks `mode` flag we can get rid of:
* `webpack.optimize.ModuleConcatenationPlugin`
* `webpack.DefinePlugin` (`process.env.NODE_ENV`)
https://webpack.js.org/concepts/mode/ | test/integration/production/pages/process-env.js | @@ -0,0 +1,3 @@
+export default () => (
+ <div id='node-env'>{process.env.NODE_ENV}</div>
+) | true |
Other | vercel | next.js | 34cb05a86074182bc04accf43937d297ececc18e.json | Remove obsolete webpack plugins (#5158)
Since we are now using webpacks `mode` flag we can get rid of:
* `webpack.optimize.ModuleConcatenationPlugin`
* `webpack.DefinePlugin` (`process.env.NODE_ENV`)
https://webpack.js.org/concepts/mode/ | test/integration/production/test/index.test.js | @@ -14,6 +14,7 @@ import {
import webdriver from 'next-webdriver'
import fetch from 'node-fetch'
import dynamicImportTests from './dynamic'
+import processEnv from './process-env'
import security from './security'
import {BUILD_MANIFEST, REACT_LOADABLE_MANIFEST} from 'next/constants'
@@ -277,5 +278,6 @@ describe... | true |
Other | vercel | next.js | 34cb05a86074182bc04accf43937d297ececc18e.json | Remove obsolete webpack plugins (#5158)
Since we are now using webpacks `mode` flag we can get rid of:
* `webpack.optimize.ModuleConcatenationPlugin`
* `webpack.DefinePlugin` (`process.env.NODE_ENV`)
https://webpack.js.org/concepts/mode/ | test/integration/production/test/process-env.js | @@ -0,0 +1,13 @@
+/* global describe, it, expect */
+import webdriver from 'next-webdriver'
+
+export default (context) => {
+ describe('process.env', () => {
+ it('should set process.env.NODE_ENV in production', async () => {
+ const browser = await webdriver(context.appPort, '/process-env')
+ const node... | true |
Other | vercel | next.js | c2a7766a05c1c0cf402262d75fbd9b4d1abeb811.json | Remove code that is no longer in use (#5147)
* Remove handleBuildId as it’s being handled in the static files route
* Remove dead code | server/index.js | @@ -352,20 +352,6 @@ export default class Server {
return buildId.trim()
}
- handleBuildId (buildId, res) {
- if (this.dev) {
- res.setHeader('Cache-Control', 'no-store, must-revalidate')
- return true
- }
-
- if (buildId !== this.renderOpts.buildId) {
- return false
- }
-
- res... | false |
Other | vercel | next.js | 3f650e154923f4d03ff868a63891c5a89b91bf56.json | Update 404 static cache header to not cache (#5146) | server/index.js | @@ -310,6 +310,7 @@ export default class Server {
async render404 (req, res, parsedUrl = parseUrl(req.url, true)) {
const { pathname, query } = parsedUrl
res.statusCode = 404
+ res.setHeader('Cache-Control', 'no-cache, no-store, max-age=0, must-revalidate')
return this.renderError(null, req, res, p... | true |
Other | vercel | next.js | 3f650e154923f4d03ff868a63891c5a89b91bf56.json | Update 404 static cache header to not cache (#5146) | test/integration/production/test/index.test.js | @@ -91,6 +91,14 @@ describe('Production Usage', () => {
})
})
+ it('should set correct Cache-Control header for static 404s', async () => {
+ // this is to fix where 404 headers are set to 'public, max-age=31536000, immutable'
+ const res = await fetch(`http://localhost:${appPort}/_next//stat... | true |
Other | vercel | next.js | 873ac5dba8cfd62ce745c2f9a629c307111bcc17.json | Add test for cache-control in development | test/integration/basic/test/rendering.js | @@ -1,6 +1,8 @@
/* global describe, test, it, expect */
import cheerio from 'cheerio'
+import {BUILD_MANIFEST, REACT_LOADABLE_MANIFEST} from 'next/constants'
+import { join } from 'path'
export default function ({ app }, suiteName, render, fetch, appPort) {
async function get$ (path, query) {
@@ -164,6 +166,4... | false |
Other | vercel | next.js | d21603707edfaab292cb3190881efda9a07195cd.json | Set cwd on babel-loader (#5127)
Fixes #5125
I'm not sure if this is a bug in babel-loader / babel-core or not. But this will at least temporary fix it till I hear back from @loganfsmyth 🙏 | build/webpack.js | @@ -113,7 +113,7 @@ export default async function getBaseWebpackConfig (dir: string, {dev = false, i
const defaultLoaders = {
babel: {
loader: 'next-babel-loader',
- options: {dev, isServer}
+ options: {dev, isServer, cwd: dir}
},
hotSelfAccept: {
loader: 'hot-self-accept-loade... | true |
Other | vercel | next.js | d21603707edfaab292cb3190881efda9a07195cd.json | Set cwd on babel-loader (#5127)
Fixes #5125
I'm not sure if this is a bug in babel-loader / babel-core or not. But this will at least temporary fix it till I hear back from @loganfsmyth 🙏 | package.json | @@ -75,7 +75,7 @@
"ansi-html": "0.0.7",
"autodll-webpack-plugin": "0.4.2",
"babel-core": "7.0.0-bridge.0",
- "babel-loader": "8.0.0",
+ "babel-loader": "8.0.2",
"babel-plugin-react-require": "3.0.0",
"babel-plugin-transform-react-remove-prop-types": "0.4.15",
"case-sensitive-paths-we... | true |
Other | vercel | next.js | 8d304ed7ef312604bbc819fb73c5f01ee8a911e7.json | Make non-existent routes under `/_next` return 404 (#5120)
Fixes #5114
Also adds a test for it. | server/index.js | @@ -180,6 +180,11 @@ export default class Server {
}
}
+ // This path is needed because `render()` does a check for `/_next` and the calls the routing again
+ routes['/_next/:path*'] = async (req, res, params, parsedUrl) => {
+ await this.render404(req, res, parsedUrl)
+ }
+
... | true |
Other | vercel | next.js | 8d304ed7ef312604bbc819fb73c5f01ee8a911e7.json | Make non-existent routes under `/_next` return 404 (#5120)
Fixes #5114
Also adds a test for it. | test/integration/basic/test/rendering.js | @@ -2,7 +2,7 @@
import cheerio from 'cheerio'
-export default function ({ app }, suiteName, render, fetch) {
+export default function ({ app }, suiteName, render, fetch, appPort) {
async function get$ (path, query) {
const html = await render(path, query)
return cheerio.load(html)
@@ -123,6 +123,11 @@... | true |
Other | vercel | next.js | 8d304ed7ef312604bbc819fb73c5f01ee8a911e7.json | Make non-existent routes under `/_next` return 404 (#5120)
Fixes #5114
Also adds a test for it. | test/integration/production/test/index.test.js | @@ -54,6 +54,12 @@ describe('Production Usage', () => {
expect(res2.status).toBe(304)
})
+ it('should render 404 for _next routes that do not exist', async () => {
+ const url = `http://localhost:${appPort}/_next/abcdef`
+ const res = await fetch(url)
+ expect(res.status).toBe(404)
+ ... | true |
Other | vercel | next.js | a9b1383b5d27aea18b5509b09f118a9be69dfdab.json | Fix @babel/env modules config (#5119)
Probably an oversight but currently env preset's `modules` option always evaluates to 'auto'. We probably want it to be set to false, especially in prod, to have Webpack handle modules natively. | build/babel/preset.js | @@ -33,7 +33,7 @@ module.exports = (context, opts = {}) => ({
[require('@babel/preset-env').default, {
// In the test environment `modules` is often needed to be set to true, babel figures that out by itself using the `'auto'` option
// In production/development this option is set to `false` so that ... | false |
Other | vercel | next.js | 777aab2b428b0e4ac50d3609e57f1df9e14f40ed.json | Remove unused flow definitions (#5094)
The `with-flow` sample has some obsolete definitions which are unused by the sample code. Removing the un-imported declarations is the easiest approach. | examples/with-flow/flow-typed/next.js.flow | @@ -24,19 +24,6 @@ declare module "next/error" {
declare module.exports: Class<React$Component<{statusCode: number}, any>>;
}
-declare module "next/router" {
- declare module.exports: {
- route: string;
- pathname: string;
- query: Object;
- onRouteChangeStart: ?((url: string) => void);
- onRouteC... | false |
Other | vercel | next.js | d6c7050816ca364aa42cf82a4b583c2fa7086f9a.json | Remove module.exports from client bundles (#5093)
Removes `module.exports` so that `module` is no longer required
Ref: https://github.com/zeit/next.js/pull/4943#discussion_r213232263
This saves 15 bytes from every client bundle + 9 bytes from the initial HTML. | build/webpack.js | @@ -185,7 +185,7 @@ export default async function getBaseWebpackConfig (dir: string, {dev = false, i
}
return '[name]'
},
- libraryTarget: 'commonjs2',
+ libraryTarget: isServer ? 'commonjs2' : 'jsonp',
hotUpdateChunkFilename: 'static/webpack/[id].[hash].hot-update.js',
... | true |
Other | vercel | next.js | d6c7050816ca364aa42cf82a4b583c2fa7086f9a.json | Remove module.exports from client bundles (#5093)
Removes `module.exports` so that `module` is no longer required
Ref: https://github.com/zeit/next.js/pull/4943#discussion_r213232263
This saves 15 bytes from every client bundle + 9 bytes from the initial HTML. | server/document.js | @@ -182,7 +182,6 @@ export class NextScript extends Component {
return `
__NEXT_DATA__ = ${htmlescape(__NEXT_DATA__)}
- module={}
__NEXT_LOADED_PAGES__ = []
__NEXT_REGISTER_PAGE = function (route, fn) { | true |
Other | vercel | next.js | 885eee802116b3ac9aa3ba0bf92aa0ad114c107b.json | Fix HMR when parent directory starts with '.' (#4589)
@timneutkens
This simple change seems to work for me:
```
const ignored = [
'**/.*',
'node_modules'
]
```
I believe the regex is used here to try and work on windows as well. So, I wasted a bunch of time trying to figure out how to use a rege... | server/hot-reloader.js | @@ -292,8 +292,10 @@ export default class HotReloader {
this.prevChunkHashes = chunkHashes
})
+ // We don’t watch .git .next/ and node_modules for changes
const ignored = [
- /(^|[/\\])\../, // .dotfiles
+ /\.git/,
+ /\.next\//,
/node_modules/
]
| false |
Other | vercel | next.js | d8be2a037996e0b5f8ecb4fde47943f69c3d584c.json | Add example of process.env runtimeConfig (#4759) | readme.md | @@ -1370,7 +1370,8 @@ module.exports = {
mySecret: 'secret'
},
publicRuntimeConfig: { // Will be available on both server and client
- staticFolder: '/static'
+ staticFolder: '/static',
+ mySecret: process.env.MY_SECRET // Pass through env variables
}
}
``` | false |
Other | vercel | next.js | d51245b877598d1cc4e83f002dc2c3a976111cce.json | Improve documentation on runtime configuration (#4756)
* Remove nesting of runtime configuration under the babel section, since it's not related to babel.
* Clean up confusing verbiage relating to "keys." | readme.md | @@ -62,7 +62,7 @@ Next.js is a minimalistic framework for server-rendered React applications.
- [Configuring the build ID](#configuring-the-build-id)
- [Customizing webpack config](#customizing-webpack-config)
- [Customizing babel config](#customizing-babel-config)
- - [Exposing configuration to the serve... | false |
Other | vercel | next.js | 728871b005d5b5b5a1730b02150f7d966f33d45a.json | Apollo example: avoid double render in browser (#4734)
Apollo's getDataFromTree is supposed to be called during the server side rendering.
Being called in browser it fires an unnecessary fake render process and blocks components from rendering with loading=true.
Also there was a mistake in this code:
// `ge... | examples/with-apollo/lib/with-apollo-client.js | @@ -18,32 +18,34 @@ export default (App) => {
// Run all GraphQL queries in the component tree
// and extract the resulting data
const apollo = initApollo()
- try {
- // Run all GraphQL queries
- await getDataFromTree(
- <App
- {...appProps}
- Compo... | false |
Other | vercel | next.js | 71fe4984bf7e04dbb106b79b4c749b072a93e0e3.json | Upgrade styled-jsx to 2.2.7 (#4714)
Fixes #4713
I ran into this issue, when re-installing :
```
error upath@1.0.4: The engine "node" is incompatible with this module. Expected version ">=4 <=9".
error Found incompatible module
```
I used `yarn install --ignore-engines` as a workaround. | package.json | @@ -94,7 +94,7 @@
"send": "0.16.1",
"source-map": "0.5.7",
"strip-ansi": "3.0.1",
- "styled-jsx": "2.2.6",
+ "styled-jsx": "2.2.7",
"touch": "3.1.0",
"uglifyjs-webpack-plugin": "1.1.6",
"unfetch": "3.0.0", | true |
Other | vercel | next.js | 71fe4984bf7e04dbb106b79b4c749b072a93e0e3.json | Upgrade styled-jsx to 2.2.7 (#4714)
Fixes #4713
I ran into this issue, when re-installing :
```
error upath@1.0.4: The engine "node" is incompatible with this module. Expected version ">=4 <=9".
error Found incompatible module
```
I used `yarn install --ignore-engines` as a workaround. | yarn.lock | @@ -1272,7 +1272,7 @@ babel-register@^6.26.0:
mkdirp "^0.5.1"
source-map-support "^0.4.15"
-babel-runtime@^6.22.0, babel-runtime@^6.26.0:
+babel-runtime@6.26.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tg... | true |
Other | vercel | next.js | de6bf4e75f89a672ecd41d91b7a7aac3381e4fe9.json | Fix typescript examples (#4704)
Update @zeit/next-typescript version on examples using it | examples/custom-server-typescript/package.json | @@ -6,7 +6,7 @@
},
"dependencies": {
"@babel/core": "^7.0.0-beta.48",
- "@zeit/next-typescript": "1.0.1",
+ "@zeit/next-typescript": "1.1.0",
"babel-loader": "^7.1.4",
"next": "latest",
"react": "^16.4.0", | true |
Other | vercel | next.js | de6bf4e75f89a672ecd41d91b7a7aac3381e4fe9.json | Fix typescript examples (#4704)
Update @zeit/next-typescript version on examples using it | examples/with-firebase-hosting-and-typescript/package.json | @@ -17,7 +17,7 @@
"install-deps": "cd \"dist/functions\" && npm i"
},
"dependencies": {
- "@zeit/next-typescript": "1.0.1",
+ "@zeit/next-typescript": "1.1.0",
"firebase-admin": "~5.12.1",
"firebase-functions": "^1.0.1",
"next": "^6.0.3", | true |
Other | vercel | next.js | de6bf4e75f89a672ecd41d91b7a7aac3381e4fe9.json | Fix typescript examples (#4704)
Update @zeit/next-typescript version on examples using it | examples/with-jest-typescript/package.json | @@ -17,7 +17,7 @@
"@types/next": "^2.4.8",
"@types/react": "^16.0.41",
"@types/react-dom": "^16.0.4",
- "@zeit/next-typescript": "1.0.1",
+ "@zeit/next-typescript": "1.1.0",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "23.0.1",
"enzyme": "^3.3.0", | true |
Other | vercel | next.js | de6bf4e75f89a672ecd41d91b7a7aac3381e4fe9.json | Fix typescript examples (#4704)
Update @zeit/next-typescript version on examples using it | examples/with-typescript/package.json | @@ -7,7 +7,7 @@
"start": "next start"
},
"dependencies": {
- "@zeit/next-typescript": "1.0.1",
+ "@zeit/next-typescript": "1.1.0",
"next": "latest",
"react": "^16.2.0",
"react-dom": "^16.2.0" | true |
Other | vercel | next.js | 17e410a1d0b8971e791908aeebe9f4315288902e.json | Fix Typescript HMR (#4689)
Fixes #4686
Adds tests for @zeit/next-typescript so that we don't regress on this again.
I've fixed an issue in the `next` CLI too which caused lingering processes when the process gets force killed, which is what we do in the test suite, so it kept running if there was no manual quit. | bin/next | @@ -88,6 +88,15 @@ const startProcess = () => {
let proc = startProcess()
+const wrapper = () => {
+ if (proc) {
+ proc.kill()
+ }
+}
+process.on('SIGINT', wrapper)
+process.on('SIGTERM', wrapper)
+process.on('exit', wrapper)
+
if (cmd === 'dev') {
const {watchFile} = require('fs')
watchFile(`${process... | true |
Other | vercel | next.js | 17e410a1d0b8971e791908aeebe9f4315288902e.json | Fix Typescript HMR (#4689)
Fixes #4686
Adds tests for @zeit/next-typescript so that we don't regress on this again.
I've fixed an issue in the `next` CLI too which caused lingering processes when the process gets force killed, which is what we do in the test suite, so it kept running if there was no manual quit. | build/webpack.js | @@ -137,7 +137,7 @@ export default async function getBaseWebpackConfig (dir: string, {dev = false, i
module: {
rules: [
dev && !isServer && {
- test: /\.(js|jsx)$/,
+ test: defaultLoaders.hotSelfAccept.options.extensions,
include: defaultLoaders.hotSelfAccept.options.in... | true |
Other | vercel | next.js | 17e410a1d0b8971e791908aeebe9f4315288902e.json | Fix Typescript HMR (#4689)
Fixes #4686
Adds tests for @zeit/next-typescript so that we don't regress on this again.
I've fixed an issue in the `next` CLI too which caused lingering processes when the process gets force killed, which is what we do in the test suite, so it kept running if there was no manual quit. | package.json | @@ -115,6 +115,7 @@
"@taskr/esnext": "1.1.0",
"@taskr/watch": "1.1.0",
"@zeit/next-css": "0.0.7",
+ "@zeit/next-typescript": "1.1.0",
"babel-eslint": "8.2.2",
"babel-jest": "21.2.0",
"babel-plugin-istanbul": "4.1.5", | true |
Other | vercel | next.js | 17e410a1d0b8971e791908aeebe9f4315288902e.json | Fix Typescript HMR (#4689)
Fixes #4686
Adds tests for @zeit/next-typescript so that we don't regress on this again.
I've fixed an issue in the `next` CLI too which caused lingering processes when the process gets force killed, which is what we do in the test suite, so it kept running if there was no manual quit. | test/integration/app-aspath/test/index.test.js | @@ -18,7 +18,7 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 5
describe('App asPath', () => {
beforeAll(async () => {
appPort = await findPort()
- server = await launchApp(join(__dirname, '../'), appPort, true)
+ server = await launchApp(join(__dirname, '../'), appPort)
// pre-build all pages ... | true |
Other | vercel | next.js | 17e410a1d0b8971e791908aeebe9f4315288902e.json | Fix Typescript HMR (#4689)
Fixes #4686
Adds tests for @zeit/next-typescript so that we don't regress on this again.
I've fixed an issue in the `next` CLI too which caused lingering processes when the process gets force killed, which is what we do in the test suite, so it kept running if there was no manual quit. | test/integration/app-document/test/index.test.js | @@ -19,7 +19,7 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 5
describe('Document and App', () => {
beforeAll(async () => {
context.appPort = await findPort()
- context.server = await launchApp(join(__dirname, '../'), context.appPort, true)
+ context.server = await launchApp(join(__dirname, '../'), c... | true |
Other | vercel | next.js | 17e410a1d0b8971e791908aeebe9f4315288902e.json | Fix Typescript HMR (#4689)
Fixes #4686
Adds tests for @zeit/next-typescript so that we don't regress on this again.
I've fixed an issue in the `next` CLI too which caused lingering processes when the process gets force killed, which is what we do in the test suite, so it kept running if there was no manual quit. | test/integration/babel/test/index.test.js | @@ -18,7 +18,7 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 5
describe('Babel', () => {
beforeAll(async () => {
context.appPort = await findPort()
- context.server = await launchApp(join(__dirname, '../'), context.appPort, true)
+ context.server = await launchApp(join(__dirname, '../'), context.appP... | true |
Other | vercel | next.js | 17e410a1d0b8971e791908aeebe9f4315288902e.json | Fix Typescript HMR (#4689)
Fixes #4686
Adds tests for @zeit/next-typescript so that we don't regress on this again.
I've fixed an issue in the `next` CLI too which caused lingering processes when the process gets force killed, which is what we do in the test suite, so it kept running if there was no manual quit. | test/integration/basic/test/index.test.js | @@ -23,7 +23,7 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 5
describe('Basic Features', () => {
beforeAll(async () => {
context.appPort = await findPort()
- context.server = await launchApp(join(__dirname, '../'), context.appPort, true)
+ context.server = await launchApp(join(__dirname, '../'), con... | true |
Other | vercel | next.js | 17e410a1d0b8971e791908aeebe9f4315288902e.json | Fix Typescript HMR (#4689)
Fixes #4686
Adds tests for @zeit/next-typescript so that we don't regress on this again.
I've fixed an issue in the `next` CLI too which caused lingering processes when the process gets force killed, which is what we do in the test suite, so it kept running if there was no manual quit. | test/integration/config/test/index.test.js | @@ -19,7 +19,7 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 5
describe('Configuration', () => {
beforeAll(async () => {
context.appPort = await findPort()
- context.server = await launchApp(join(__dirname, '../'), context.appPort, true)
+ context.server = await launchApp(join(__dirname, '../'), cont... | true |
Other | vercel | next.js | 17e410a1d0b8971e791908aeebe9f4315288902e.json | Fix Typescript HMR (#4689)
Fixes #4686
Adds tests for @zeit/next-typescript so that we don't regress on this again.
I've fixed an issue in the `next` CLI too which caused lingering processes when the process gets force killed, which is what we do in the test suite, so it kept running if there was no manual quit. | test/integration/page-extensions/.babelrc | @@ -0,0 +1,6 @@
+{
+ "presets": [
+ "next/babel",
+ "@zeit/next-typescript/babel"
+ ]
+}
\ No newline at end of file | true |
Other | vercel | next.js | 17e410a1d0b8971e791908aeebe9f4315288902e.json | Fix Typescript HMR (#4689)
Fixes #4686
Adds tests for @zeit/next-typescript so that we don't regress on this again.
I've fixed an issue in the `next` CLI too which caused lingering processes when the process gets force killed, which is what we do in the test suite, so it kept running if there was no manual quit. | test/integration/page-extensions/next.config.js | @@ -0,0 +1,7 @@
+const withTypescript = require('@zeit/next-typescript')
+module.exports = withTypescript({
+ onDemandEntries: {
+ // Make sure entries are not getting disposed.
+ maxInactiveAge: 1000 * 60 * 60
+ }
+}) | true |
Other | vercel | next.js | 17e410a1d0b8971e791908aeebe9f4315288902e.json | Fix Typescript HMR (#4689)
Fixes #4686
Adds tests for @zeit/next-typescript so that we don't regress on this again.
I've fixed an issue in the `next` CLI too which caused lingering processes when the process gets force killed, which is what we do in the test suite, so it kept running if there was no manual quit. | test/integration/page-extensions/pages/hmr/some-page.tsx | @@ -0,0 +1,23 @@
+import React from 'react'
+
+if(typeof window !== 'undefined' && !window['HMR_RANDOM_NUMBER']) {
+ window['HMR_RANDOM_NUMBER'] = Math.random()
+}
+
+export default class Counter extends React.Component {
+ state = { count: 0 }
+
+ incr () {
+ const { count } = this.state
+ this.setState({ cou... | true |
Other | vercel | next.js | 17e410a1d0b8971e791908aeebe9f4315288902e.json | Fix Typescript HMR (#4689)
Fixes #4686
Adds tests for @zeit/next-typescript so that we don't regress on this again.
I've fixed an issue in the `next` CLI too which caused lingering processes when the process gets force killed, which is what we do in the test suite, so it kept running if there was no manual quit. | test/integration/page-extensions/test/.babelrc | @@ -0,0 +1,9 @@
+{
+ "presets": [
+ ["next/babel", {
+ "preset-env": {
+ "modules": "commonjs"
+ }
+ }]
+ ]
+}
\ No newline at end of file | true |
Other | vercel | next.js | 17e410a1d0b8971e791908aeebe9f4315288902e.json | Fix Typescript HMR (#4689)
Fixes #4686
Adds tests for @zeit/next-typescript so that we don't regress on this again.
I've fixed an issue in the `next` CLI too which caused lingering processes when the process gets force killed, which is what we do in the test suite, so it kept running if there was no manual quit. | test/integration/page-extensions/test/hmr.js | @@ -0,0 +1,40 @@
+/* global describe, it, expect */
+import webdriver from 'next-webdriver'
+import { readFileSync, writeFileSync } from 'fs'
+import { join } from 'path'
+import { waitFor } from 'next-test-utils'
+
+export default (context, renderViaHTTP) => {
+ describe('Hot Module Reloading', () => {
+ it('shoul... | true |
Other | vercel | next.js | 17e410a1d0b8971e791908aeebe9f4315288902e.json | Fix Typescript HMR (#4689)
Fixes #4686
Adds tests for @zeit/next-typescript so that we don't regress on this again.
I've fixed an issue in the `next` CLI too which caused lingering processes when the process gets force killed, which is what we do in the test suite, so it kept running if there was no manual quit. | test/integration/page-extensions/test/index.test.js | @@ -0,0 +1,30 @@
+/* global jasmine, describe, beforeAll, afterAll */
+
+import { join } from 'path'
+import {
+ renderViaHTTP,
+ findPort,
+ launchApp,
+ killApp
+} from 'next-test-utils'
+
+// test suits
+import hmr from './hmr'
+
+const context = {}
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 5
+
+describe('... | true |
Other | vercel | next.js | 17e410a1d0b8971e791908aeebe9f4315288902e.json | Fix Typescript HMR (#4689)
Fixes #4686
Adds tests for @zeit/next-typescript so that we don't regress on this again.
I've fixed an issue in the `next` CLI too which caused lingering processes when the process gets force killed, which is what we do in the test suite, so it kept running if there was no manual quit. | test/lib/next-test-utils.js | @@ -113,7 +113,7 @@ export async function startApp (app) {
return server
}
-export async function stopApp (app) {
+export async function stopApp (server) {
if (server.__app) {
await server.__app.close()
} | true |
Other | vercel | next.js | 17e410a1d0b8971e791908aeebe9f4315288902e.json | Fix Typescript HMR (#4689)
Fixes #4686
Adds tests for @zeit/next-typescript so that we don't regress on this again.
I've fixed an issue in the `next` CLI too which caused lingering processes when the process gets force killed, which is what we do in the test suite, so it kept running if there was no manual quit. | yarn.lock | @@ -349,6 +349,12 @@
dependencies:
"@babel/helper-plugin-utils" "7.0.0-beta.42"
+"@babel/plugin-syntax-typescript@7.0.0-beta.42":
+ version "7.0.0-beta.42"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.0.0-beta.42.tgz#ffc42945ca15e5ab369de6b9f5d9324499... | true |
Other | vercel | next.js | 54ab3bc5be3f2e1313a3af6f6d7461cf1c61778d.json | Fix code splitting on Windows (#4685)
Closes #4684 | build/webpack.js | @@ -207,8 +207,9 @@ export default async function getBaseWebpackConfig (dir: string, {dev = false, i
// Because _app.js is used on every page we don't want to
// duplicate them in other bundles.
const chunks = module.getChunks()
+ const appBundlePath = path.normalize('bundles/p... | false |
Other | vercel | next.js | e70c59517bba73874c06cc426fd927e618f03219.json | Add example to `Recipes` section (#4661) | readme.md | @@ -1581,6 +1581,7 @@ For the production deployment, you can use the [path alias](https://zeit.co/docs
- [Setting up 301 redirects](https://www.raygesualdo.com/posts/301-redirects-with-nextjs/)
- [Dealing with SSR and server only modules](https://arunoda.me/blog/ssr-and-server-only-modules)
- [Building with React-Ma... | false |
Other | vercel | next.js | 36c82fd1275f761232f652c6b8da6c7b03a2fb1b.json | Fix incorrect wording (#4658)
I can't use a functional component with `_document.js`.
[is-react](https://www.npmjs.com/package/is-react) can be used for another potential implementation of the warning logic, but maybe relying on `React.createElement()` internal checks is enough. | server/render.js | @@ -114,7 +114,7 @@ async function doRender (req, res, pathname, query, {
if (isResSent(res)) return
- if (!Document.prototype || !Document.prototype.isReactComponent) throw new Error('_document.js is not exporting a React element')
+ if (!Document.prototype || !Document.prototype.isReactComponent) throw new E... | false |
Other | vercel | next.js | f4af03b9c8f684662c473f60c11349c82deaecf2.json | Remove unneeded async (#4635)
Unless I'm missing something, we don't need this async. The transpiled JavaScript is much smaller 🚀 | lib/router/router.js | @@ -53,7 +53,7 @@ export default class Router {
}
}
- async onPopState (e) {
+ onPopState (e) {
if (!e.state) {
// We get state as undefined for two reasons.
// 1. With older safari (< 8) and older chrome (< 34) | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.