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
26a4eb827c384288a4185bdbe14233c025c96dbd.json
Add dropping of custom scripts in AMP mode (#6830) Drops user `<script>` tags and shows a warning in AMP mode. Right now they are only dropped in production mode and left in dev mode so the validator shows its warning since it looks like conflicting props log messages are being cleared causing them to not show. Cl...
test/integration/amphtml/test/index.test.js
@@ -107,6 +107,12 @@ describe('AMP Usage', () => { 'amp-boilerplate' ]) }) + + it('should drop custom scripts', async () => { + const html = await renderViaHTTP(appPort, '/custom-scripts') + expect(html).not.toMatch(/src='\/im-not-allowed\.js'/) + expect(html).not.toMatch(/console...
true
Other
vercel
next.js
b6b0db186ad9b0c5db23be790681b43580f7c4e0.json
Update env variables for CircleCi (#6834)
.circleci/config.yml
@@ -41,6 +41,9 @@ jobs: - run: name: Production Tests command: '[[ ! -z $BROWSERSTACK_USERNAME ]] && yarn testall test/integration/production/ || echo "Not running for PR"' + environment: + BROWSERSTACK: 'true' + BROWSER_NAME: 'ie' deploy: docker: ...
false
Other
vercel
next.js
8b5906c888eb7b30be6e37384462c2c681afaef2.json
Add error catching to firefox url query workaround (#6833) It appears this workaround sometimes throws a `NS_ERROR_NOT_AVAILABLE` so we add error handling for it
packages/next-server/lib/router/router.ts
@@ -82,7 +82,9 @@ export default class Router implements IRouterInterface { // TODO: let's remove this once the Firefox bug is resolved if (navigator.userAgent && navigator.userAgent.match(/firefox/i)) { window.addEventListener('unload', () => { - if (window.location.search) window.locat...
false
Other
vercel
next.js
b871e43601ab57eb4e7ab213ab4824e0829eb1fd.json
Add a leading slash to passed pages (#6808)
packages/next/build/index.ts
@@ -67,7 +67,7 @@ export default async function build( if (pages && pages.length) { // TODO: smart resolve these pages and check for them pagePaths = pages.map(page => - pathIsAbsolute(page) ? pathRelative(pagesDir, page) : page + '/'.concat(pathIsAbsolute(page) ? pathRelative(pagesDir, page) : p...
false
Other
vercel
next.js
20768ff3725c3a3b5c822525f36868b513410a70.json
Upgrade unfetch to v4.1.0 (#6807) `unfetch` ^4.0.0 is already used by `isomorphic-unfetch` so this simplifies the dependency tree a tiny bit. Release notes https://github.com/developit/unfetch/releases/tag/4.0.0 https://github.com/developit/unfetch/releases/tag/4.1.0
packages/next/package.json
@@ -76,7 +76,7 @@ "styled-jsx": "3.2.1", "terser": "3.16.1", "tty-aware-progress": "1.0.3", - "unfetch": "3.0.0", + "unfetch": "4.1.0", "url": "0.11.0", "webpack": "4.29.0", "webpack-dev-middleware": "3.6.0",
true
Other
vercel
next.js
20768ff3725c3a3b5c822525f36868b513410a70.json
Upgrade unfetch to v4.1.0 (#6807) `unfetch` ^4.0.0 is already used by `isomorphic-unfetch` so this simplifies the dependency tree a tiny bit. Release notes https://github.com/developit/unfetch/releases/tag/4.0.0 https://github.com/developit/unfetch/releases/tag/4.1.0
yarn.lock
@@ -12293,15 +12293,10 @@ umask@^1.1.0: resolved "https://registry.yarnpkg.com/umask/-/umask-1.1.0.tgz#f29cebf01df517912bb58ff9c4e50fde8e33320d" integrity sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0= -unfetch@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-3.0.0.tgz#8d1e0513a4ecd0e5ff...
true
Other
vercel
next.js
1b4b9a34ade310299c52744e0a3859a4776499a9.json
Add a viewport meta tag by default (#6754) * Add default viewport meta tag (fixes #6698) * Do not inject default viewport when rendering an AMP document * Remove redundant viewport on error page * Plumb withSideEffect() to pass through props, then use that for isAmp. * Add tests for viewport meta tag. *...
packages/next-server/lib/head.tsx
@@ -1,11 +1,22 @@ import React from "react"; import withSideEffect from "./side-effect"; +import {IsAmpContext} from './amphtml-context'; import { HeadManagerContext } from "./head-manager-context"; -export function defaultHead(className = 'next-head') { - return [ +type WithIsAmp = { + isAmp?: boolean; +} + +ex...
true
Other
vercel
next.js
1b4b9a34ade310299c52744e0a3859a4776499a9.json
Add a viewport meta tag by default (#6754) * Add default viewport meta tag (fixes #6698) * Do not inject default viewport when rendering an AMP document * Remove redundant viewport on error page * Plumb withSideEffect() to pass through props, then use that for isAmp. * Add tests for viewport meta tag. *...
packages/next-server/lib/side-effect.tsx
@@ -1,26 +1,26 @@ -import React, { Component } from 'react' +import React, { Component, ReactNode } from 'react' const isServer = typeof window === 'undefined' type State = Array<React.ReactElement<any>> | undefined type SideEffectProps = { - reduceComponentsToState: (components: Array<React.ReactElement<any>...
true
Other
vercel
next.js
1b4b9a34ade310299c52744e0a3859a4776499a9.json
Add a viewport meta tag by default (#6754) * Add default viewport meta tag (fixes #6698) * Do not inject default viewport when rendering an AMP document * Remove redundant viewport on error page * Plumb withSideEffect() to pass through props, then use that for isAmp. * Add tests for viewport meta tag. *...
packages/next/pages/_error.js
@@ -24,10 +24,6 @@ export default class Error extends React.Component { return ( <div style={styles.error}> <Head> - <meta - name='viewport' - content='width=device-width, initial-scale=1.0' - /> <title> {statusCode}: {title} ...
true
Other
vercel
next.js
1b4b9a34ade310299c52744e0a3859a4776499a9.json
Add a viewport meta tag by default (#6754) * Add default viewport meta tag (fixes #6698) * Do not inject default viewport when rendering an AMP document * Remove redundant viewport on error page * Plumb withSideEffect() to pass through props, then use that for isAmp. * Add tests for viewport meta tag. *...
test/integration/client-navigation/pages/head.js
@@ -8,6 +8,11 @@ export default () => <div> {/* this will get rendered */} <meta charSet='iso-8859-5' /> + {/* this not render */} + <meta name='viewport' content='width=device-width' /> + {/* this will override the default */} + <meta name='viewport' content='width=device-width,initial-scale=1'...
true
Other
vercel
next.js
1b4b9a34ade310299c52744e0a3859a4776499a9.json
Add a viewport meta tag by default (#6754) * Add default viewport meta tag (fixes #6698) * Do not inject default viewport when rendering an AMP document * Remove redundant viewport on error page * Plumb withSideEffect() to pass through props, then use that for isAmp. * Add tests for viewport meta tag. *...
test/integration/client-navigation/test/rendering.js
@@ -39,17 +39,26 @@ export default function (render, fetch) { expect(html.includes('next-head, but only once.')).toBeTruthy() }) + test('header renders default viewport', async () => { + const html = await (render('/default-head')) + expect(html).toContain('<meta name="viewport" content="widt...
true
Other
vercel
next.js
244b0e700eed61924b1790ebf4b83e611d9e6fd7.json
Add AMP validation on export (#6794) * Add err.sh link and pool validation results to wait to show error until export is finished * Fix wording in amp-export-validation err.sh * Update validation error message Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com> * Update ways to fix text Co-Au...
errors/amp-export-validation.md
@@ -0,0 +1,15 @@ +# AMP Export Validation + +#### Why This Error Occurred + +During export we validate AMP pages using [amphtml-validator](https://www.npmjs.com/package/amphtml-validator). Errors received from the validator will fail the export. + +Validation errors will cause pages to not be [indexed by AMP Caches](ht...
true
Other
vercel
next.js
244b0e700eed61924b1790ebf4b83e611d9e6fd7.json
Add AMP validation on export (#6794) * Add err.sh link and pool validation results to wait to show error until export is finished * Fix wording in amp-export-validation err.sh * Update validation error message Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com> * Update ways to fix text Co-Au...
packages/next/build/output/index.ts
@@ -58,7 +58,7 @@ function getWebpackStatusPhase(status: WebpackStatus): WebpackStatusPhase { return WebpackStatusPhase.COMPILED } -function formatAmpMessages(amp: AmpPageStatus) { +export function formatAmpMessages(amp: AmpPageStatus) { let output = chalk.bold('Amp Validation') + '\n\n' let messages: strin...
true
Other
vercel
next.js
244b0e700eed61924b1790ebf4b83e611d9e6fd7.json
Add AMP validation on export (#6794) * Add err.sh link and pool validation results to wait to show error until export is finished * Fix wording in amp-export-validation err.sh * Update validation error message Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com> * Update ways to fix text Co-Au...
packages/next/export/index.js
@@ -11,6 +11,7 @@ import { PHASE_EXPORT, SERVER_DIRECTORY, PAGES_MANIFEST, CONFIG_FILE, BUILD_ID_F import createProgress from 'tty-aware-progress' import { promisify } from 'util' import { recursiveDelete } from '../lib/recursive-delete' +import { formatAmpMessages } from '../build/output/index' const mkdirp = pr...
true
Other
vercel
next.js
244b0e700eed61924b1790ebf4b83e611d9e6fd7.json
Add AMP validation on export (#6794) * Add err.sh link and pool validation results to wait to show error until export is finished * Fix wording in amp-export-validation err.sh * Update validation error message Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com> * Update ways to fix text Co-Au...
packages/next/export/worker.js
@@ -5,6 +5,7 @@ import { cleanAmpPath } from 'next-server/dist/server/utils' import { renderToHTML } from 'next-server/dist/server/render' import { writeFile } from 'fs' import Sema from 'async-sema' +import AmpHtmlValidator from 'amphtml-validator' import { loadComponents } from 'next-server/dist/server/load-compo...
true
Other
vercel
next.js
244b0e700eed61924b1790ebf4b83e611d9e6fd7.json
Add AMP validation on export (#6794) * Add err.sh link and pool validation results to wait to show error until export is finished * Fix wording in amp-export-validation err.sh * Update validation error message Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com> * Update ways to fix text Co-Au...
test/integration/amp-export-validation/next.config.js
@@ -0,0 +1,6 @@ +module.exports = { + // exportPathMap + experimental: { + amp: true + } +}
true
Other
vercel
next.js
244b0e700eed61924b1790ebf4b83e611d9e6fd7.json
Add AMP validation on export (#6794) * Add err.sh link and pool validation results to wait to show error until export is finished * Fix wording in amp-export-validation err.sh * Update validation error message Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com> * Update ways to fix text Co-Au...
test/integration/amp-export-validation/pages/cat.amp.js
@@ -0,0 +1,6 @@ +export default () => ( + <div> + {/* I show a warning since the amp-video script isn't added */} + <amp-video src='/cats.mp4' height={400} width={800} /> + </div> +)
true
Other
vercel
next.js
244b0e700eed61924b1790ebf4b83e611d9e6fd7.json
Add AMP validation on export (#6794) * Add err.sh link and pool validation results to wait to show error until export is finished * Fix wording in amp-export-validation err.sh * Update validation error message Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com> * Update ways to fix text Co-Au...
test/integration/amp-export-validation/pages/dog-cat.amp.js
@@ -0,0 +1,8 @@ +export default () => ( + <div> + {/* I throw an error since <amp-img/> should be used instead */} + <img src='/dog.gif' height={400} width={800} /> + {/* I show a warning since the amp-video script isn't added */} + <amp-video src='/cats.mp4' height={400} width={800} /> + </div> +)
true
Other
vercel
next.js
244b0e700eed61924b1790ebf4b83e611d9e6fd7.json
Add AMP validation on export (#6794) * Add err.sh link and pool validation results to wait to show error until export is finished * Fix wording in amp-export-validation err.sh * Update validation error message Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com> * Update ways to fix text Co-Au...
test/integration/amp-export-validation/pages/dog.amp.js
@@ -0,0 +1,6 @@ +export default () => ( + <div> + {/* I throw an error since <amp-img/> should be used instead */} + <img src='/dog.gif' height={400} width={800} /> + </div> +)
true
Other
vercel
next.js
244b0e700eed61924b1790ebf4b83e611d9e6fd7.json
Add AMP validation on export (#6794) * Add err.sh link and pool validation results to wait to show error until export is finished * Fix wording in amp-export-validation err.sh * Update validation error message Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com> * Update ways to fix text Co-Au...
test/integration/amp-export-validation/test/index.test.js
@@ -0,0 +1,93 @@ +/* eslint-env jest */ +/* global jasmine */ +import fs from 'fs' +import { join } from 'path' +import { promisify } from 'util' +import { + File, + nextBuild, + runNextCommand +} from 'next-test-utils' + +jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 5 +const access = promisify(fs.access) +const a...
true
Other
vercel
next.js
0249b331c2fb0d39ced94ea1182322568461a360.json
Use a shared module cache (#6791) * [WIP] Use a shared module cache * ID modules in development * Revert "ID modules in development" This reverts commit 0613d92fa2c8c7fa11a5ff5b7770d784af1cec63. * Remove context replacement * Only enable shared runtime in prod * Sort settings * Add shared runtime ...
packages/next-server/server/config.js
@@ -27,8 +27,9 @@ const defaultConfig = { (Number(process.env.CIRCLE_NODE_TOTAL) || (os.cpus() || { length: 1 }).length) - 1 ), + exportTrailingSlash: true, profiling: false, - exportTrailingSlash: true + sharedRuntime: false } }
true
Other
vercel
next.js
0249b331c2fb0d39ced94ea1182322568461a360.json
Use a shared module cache (#6791) * [WIP] Use a shared module cache * ID modules in development * Revert "ID modules in development" This reverts commit 0613d92fa2c8c7fa11a5ff5b7770d784af1cec63. * Remove context replacement * Only enable shared runtime in prod * Sort settings * Add shared runtime ...
packages/next/build/webpack-config.ts
@@ -12,6 +12,7 @@ import { NEXT_PROJECT_ROOT, NEXT_PROJECT_ROOT_NODE_MODULES, NEXT_PROJECT_ROOT_DI import {TerserPlugin} from './webpack/plugins/terser-webpack-plugin/src/index' import { ServerlessPlugin } from './webpack/plugins/serverless-plugin' import { AllModulesIdentifiedPlugin } from './webpack/plugins/all-mo...
true
Other
vercel
next.js
0249b331c2fb0d39ced94ea1182322568461a360.json
Use a shared module cache (#6791) * [WIP] Use a shared module cache * ID modules in development * Revert "ID modules in development" This reverts commit 0613d92fa2c8c7fa11a5ff5b7770d784af1cec63. * Remove context replacement * Only enable shared runtime in prod * Sort settings * Add shared runtime ...
packages/next/build/webpack/plugins/all-modules-identified-plugin.ts
@@ -14,11 +14,7 @@ export class AllModulesIdentifiedPlugin implements Plugin { return } - const identifier = m - .identifier() - // Ensure the context isn't included in the hash (this normally - // isn't present) - ...
true
Other
vercel
next.js
0249b331c2fb0d39ced94ea1182322568461a360.json
Use a shared module cache (#6791) * [WIP] Use a shared module cache * ID modules in development * Revert "ID modules in development" This reverts commit 0613d92fa2c8c7fa11a5ff5b7770d784af1cec63. * Remove context replacement * Only enable shared runtime in prod * Sort settings * Add shared runtime ...
packages/next/build/webpack/plugins/hashed-chunk-ids-plugin.ts
@@ -19,7 +19,16 @@ export class HashedChunkIdsPlugin implements Plugin { .update(id) .digest('hex') .substr(0, 4) + continue } + + const ids = [...chunk.modulesIterable] + .map(m => m.id) + .sort() as string[] + + ...
true
Other
vercel
next.js
0249b331c2fb0d39ced94ea1182322568461a360.json
Use a shared module cache (#6791) * [WIP] Use a shared module cache * ID modules in development * Revert "ID modules in development" This reverts commit 0613d92fa2c8c7fa11a5ff5b7770d784af1cec63. * Remove context replacement * Only enable shared runtime in prod * Sort settings * Add shared runtime ...
packages/next/build/webpack/plugins/shared-runtime-plugin.ts
@@ -0,0 +1,35 @@ +import { Compiler, Plugin } from 'webpack' + +export class SharedRuntimePlugin implements Plugin { + apply(compiler: Compiler) { + const installedModules = [ + '// The module cache', + 'var installedModules = {};', + ].join('\n') + const nextInstalledModules = [ + '// The Next...
true
Other
vercel
next.js
affe356a9057220a22ec762260aaa5acaf3374a8.json
Pass mapDispatchToProps as an object (#6786) wrapping `startClock` in `bindActionsCreator` there's no need to pass `dispatch` in: ``` this.props.startClock(dispatch) ``` Furthermore `bindActionsCreator` is not needed because following already bind actions: ``` const mapDispatchToProps = { startClock }; ```
examples/with-redux/pages/index.js
@@ -1,21 +1,21 @@ import React from 'react' import { connect } from 'react-redux' -import { bindActionCreators } from 'redux' import { startClock, serverRenderClock } from '../store' import Examples from '../components/examples' class Index extends React.Component { static getInitialProps ({ reduxStore, req }...
false
Other
vercel
next.js
a60da574532bbc5344e667071b16c64b12bdd0d2.json
Clarify params and query merging (#7744) * Clarify params and query merging * Tweak README per @ijjk
packages/next/README.md
@@ -298,6 +298,9 @@ The matched path parameter will be sent as a query parameter to the page. For example, the route `/post/1` will have the following `query` object: `{ pid: '1' }`. Similarly, the route `/post/abc?foo=bar` will have the `query` object: `{ foo: 'bar', pid: 'abc' }`. +However, if a query and route p...
false
Other
vercel
next.js
6ce7c06d9c03705e6ffbca51e60fe5dddaf24bba.json
Add initial static indicator (#7682) * Add initial static indicator * Update indicator text to pre-rendered * Update naming from static to prerender * Update to not re-use nextExport var * Update positioning of indicator to prevent overlap
packages/next-server/lib/router/router.ts
@@ -304,6 +304,13 @@ export default class Router implements BaseRouter { this.changeState(method, url, as, options) const hash = window.location.hash.substring(1) + if (process.env.NODE_ENV !== 'production') { + const appComp: any = this.components['/_app'].Component + ;(win...
true
Other
vercel
next.js
6ce7c06d9c03705e6ffbca51e60fe5dddaf24bba.json
Add initial static indicator (#7682) * Add initial static indicator * Update indicator text to pre-rendered * Update naming from static to prerender * Update to not re-use nextExport var * Update positioning of indicator to prevent overlap
packages/next/client/dev/dev-build-watcher.js
@@ -6,7 +6,7 @@ export default function initializeBuildWatcher () { // Make sure container is fixed and on a high zIndex so it shows shadowHost.style.position = 'fixed' shadowHost.style.bottom = '10px' - shadowHost.style.right = '10px' + shadowHost.style.right = '20px' shadowHost.style.width = 0 shadow...
true
Other
vercel
next.js
6ce7c06d9c03705e6ffbca51e60fe5dddaf24bba.json
Add initial static indicator (#7682) * Add initial static indicator * Update indicator text to pre-rendered * Update naming from static to prerender * Update to not re-use nextExport var * Update positioning of indicator to prevent overlap
packages/next/client/dev/prerender-indicator.js
@@ -0,0 +1,152 @@ +import Router from '../router' + +export default function initializeBuildWatcher () { + const shadowHost = document.createElement('div') + shadowHost.id = '__next-prerender-indicator' + // Make sure container is fixed and on a high zIndex so it shows + shadowHost.style.position = 'fixed' + shado...
true
Other
vercel
next.js
6ce7c06d9c03705e6ffbca51e60fe5dddaf24bba.json
Add initial static indicator (#7682) * Add initial static indicator * Update indicator text to pre-rendered * Update naming from static to prerender * Update to not re-use nextExport var * Update positioning of indicator to prevent overlap
packages/next/client/next-dev.js
@@ -3,6 +3,7 @@ import EventSourcePolyfill from './dev/event-source-polyfill' import initOnDemandEntries from './dev/on-demand-entries-client' import initWebpackHMR from './dev/webpack-hot-middleware-client' import initializeBuildWatcher from './dev/dev-build-watcher' +import initializePrerenderIndicator from './dev...
true
Other
vercel
next.js
7439a773b0d293173ac8e193f8c6e9ffead91ff8.json
Nit: Change Pre-render to Prerender (#7733)
packages/next-server/lib/router/router.ts
@@ -377,7 +377,7 @@ export default class Router implements BaseRouter { return new Promise((resolve, reject) => { const ctx = { pathname, query, asPath: as } this.getInitialProps(Component, ctx).then(props => { - // if data is inlined during pre-render it is a string + ...
true
Other
vercel
next.js
7439a773b0d293173ac8e193f8c6e9ffead91ff8.json
Nit: Change Pre-render to Prerender (#7733)
packages/next/README.md
@@ -73,7 +73,7 @@ - [Runtime configuration](#runtime-configuration) - [Starting the server on alternative hostname](#starting-the-server-on-alternative-hostname) - [CDN support with Asset Prefix](#cdn-support-with-asset-prefix) -- [Automatic Pre-rendering](#automatic-pre-rendering) +- [Automatic Prerendering...
true
Other
vercel
next.js
7439a773b0d293173ac8e193f8c6e9ffead91ff8.json
Nit: Change Pre-render to Prerender (#7733)
packages/next/build/utils.ts
@@ -121,7 +121,7 @@ export function printTreeView( [ chalk.bold('⚡'), '(Static File)', - 'page was pre-rendered as static HTML', + 'page was prerendered as static HTML', ], ], {
true
Other
vercel
next.js
7439a773b0d293173ac8e193f8c6e9ffead91ff8.json
Nit: Change Pre-render to Prerender (#7733)
test/integration/prerender/pages/another.js
@@ -1,4 +1,4 @@ -const Page = ({ name }) => <p>Pre-render page {name}</p> +const Page = ({ name }) => <p>Prerender page {name}</p> Page.getInitialProps = async () => ({ name: 'John Deux' })
true
Other
vercel
next.js
7439a773b0d293173ac8e193f8c6e9ffead91ff8.json
Nit: Change Pre-render to Prerender (#7733)
test/integration/prerender/test/index.test.js
@@ -17,7 +17,7 @@ let buildId let appPort let app -describe('Pre-rendering pages', () => { +describe('Prerendering pages', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() @@ -62,7 +62,7 @@ describe('Pre-rendering pages', () => { } }) - it('should have calle...
true
Other
vercel
next.js
7439a773b0d293173ac8e193f8c6e9ffead91ff8.json
Nit: Change Pre-render to Prerender (#7733)
test/integration/production/test/index.test.js
@@ -468,15 +468,15 @@ describe('Production Usage', () => { } }) - it('should pre-render pages with data correctly', async () => { + it('should prerender pages with data correctly', async () => { const toSomething = await renderViaHTTP(appPort, '/to-something') expect(toSomething).toMatch(/some int...
true
Other
vercel
next.js
7439a773b0d293173ac8e193f8c6e9ffead91ff8.json
Nit: Change Pre-render to Prerender (#7733)
test/integration/serverless/test/index.test.js
@@ -113,15 +113,15 @@ describe('Serverless', () => { } }) - it('should pre-render pages with data correctly', async () => { + it('should prerender pages with data correctly', async () => { const toSomething = await renderViaHTTP(appPort, '/to-something') expect(toSomething).toMatch(/some interesti...
true
Other
vercel
next.js
15bcdab55c05637692ea3572a69374a107e4dd90.json
Add path to exportPathMap query missing message (#7708) * Add path to exportPathMap query missing message * Path to Url
packages/next/server/next-dev-server.js
@@ -81,7 +81,7 @@ export default class DevServer extends Server { .filter(key => query[key] === undefined) .forEach(key => console.warn( - `Url defines a query parameter '${key}' that is missing in exportPathMap` + `Url '${path}' defines a...
false
Other
vercel
next.js
356636c80fd15a63906a738983a1ff8f1a0d7007.json
Add updated de-duping logic for next/dynamic (#7705)
packages/next-server/lib/utils.ts
@@ -2,7 +2,7 @@ import { format, UrlObject, URLFormatOptions } from 'url' import { ServerResponse, IncomingMessage } from 'http' import { ComponentType } from 'react' import { ParsedUrlQuery } from 'querystring' -import { ManifestItem } from '../server/get-dynamic-import-bundles' +import { ManifestItem } from '../se...
true
Other
vercel
next.js
356636c80fd15a63906a738983a1ff8f1a0d7007.json
Add updated de-duping logic for next/dynamic (#7705)
packages/next-server/server/get-dynamic-import-bundles.ts
@@ -1,28 +0,0 @@ -export type ManifestItem = { - id: number | string - name: string - file: string - publicPath: string -} - -export type Manifest = { [moduleId: string]: ManifestItem[] } - -type DynamicImportBundles = Set<ManifestItem> - -// Based on https://github.com/jamiebuilds/react-loadable/pull/132 -export f...
true
Other
vercel
next.js
356636c80fd15a63906a738983a1ff8f1a0d7007.json
Add updated de-duping logic for next/dynamic (#7705)
packages/next-server/server/render.tsx
@@ -24,17 +24,21 @@ import { RequestContext } from '../lib/request-context' import { LoadableContext } from '../lib/loadable-context' import { RouterContext } from '../lib/router-context' import { DataManager } from '../lib/data-manager' -import { - ManifestItem, - getDynamicImportBundles, - Manifest as ReactLoad...
true
Other
vercel
next.js
356636c80fd15a63906a738983a1ff8f1a0d7007.json
Add updated de-duping logic for next/dynamic (#7705)
packages/next/build/webpack/plugins/react-loadable-plugin.ts
@@ -61,6 +61,15 @@ function buildManifest( manifest[request] = [] } + // Avoid duplicate files + if ( + manifest[request].some( + item => item.id === id && item.file === file + ) + ) { + continue + ...
true
Other
vercel
next.js
e35053e8c3788d75a74aa8dce7a8437b8c86166c.json
Improve prefetch docs (#7692) * added docs for disabling prefetch * Update packages/next/README.md Co-Authored-By: JJ Kasper <jj@jjsweb.site>
packages/next/README.md
@@ -839,7 +839,13 @@ Since Next.js server-renders your pages, this allows all the future interaction #### With `<Link>` -`<Link>` will automatically prefetch pages in the background as they appear in the view. +`<Link>` will automatically prefetch pages in the background as they appear in the view. If certain page...
false
Other
vercel
next.js
cf9762e089ef8fa0a0dafe16ba216bdf0b3a5c53.json
Expand automatic pre-rendering docs (#7702) * Expand automatic pre-rendering docs * Apply suggestions from code review Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>
packages/next/README.md
@@ -1764,11 +1764,13 @@ module.exports = { ## Automatic Pre-rendering -Next.js will automatically choose between a `dynamic` or `static` page at build time with `next build`, this is based on whether or not `getInitialProps` is set in the page, if set Next.js will assume that your page is `dynamic`, or `static` ot...
false
Other
vercel
next.js
830281fecd25dd91a96c94f817dc4a0310183c5d.json
Update typescript example (#7684)
examples/with-typescript/next-env.d.ts
@@ -0,0 +1,2 @@ +/// <reference types="next" /> +/// <reference types="next/types/global" />
true
Other
vercel
next.js
830281fecd25dd91a96c94f817dc4a0310183c5d.json
Update typescript example (#7684)
examples/with-typescript/package.json
@@ -8,14 +8,15 @@ "type-check": "tsc" }, "dependencies": { - "next": "^8.1.1-canary.28", + "next": "8.1.1-canary.61", "react": "^16.7.0", "react-dom": "^16.7.0" }, "devDependencies": { "@types/node": "^11.13.9", "@types/react": "^16.8.15", - "@types/react-dom": "^16.0.11" +...
true
Other
vercel
next.js
6a2e8cd81f62dd2b4f3a82f066fc440d29393a24.json
Fix memory leak from requiring pages (#7659)
packages/next/build/utils.ts
@@ -274,6 +274,15 @@ export function isPageStatic( try { nextEnvConfig.setConfig(runtimeEnvConfig) const Comp = require(serverBundle).default + + // clear cache to prevent memory leak + const mod = require.cache[serverBundle] + delete require.cache[serverBundle] + if (mod.parent) { + const...
false
Other
vercel
next.js
e360c105ab685caa62ef99c8227540a4c010df21.json
Update prefetch check to prevent re-prefetching (#7654) * Update page-loader prefetch checking * Add test for re-prefetching same bundle
packages/next/client/page-loader.js
@@ -165,8 +165,12 @@ export default class PageLoader { async prefetch (route) { route = this.normalizeRoute(route) - const scriptRoute = route === '/' ? '/index.js' : `${route}.js` - if (this.prefetchCache.has(scriptRoute)) { + const scriptRoute = `${route === '/' ? '/index' : route}.js` + + if ( ...
true
Other
vercel
next.js
e360c105ab685caa62ef99c8227540a4c010df21.json
Update prefetch check to prevent re-prefetching (#7654) * Update page-loader prefetch checking * Add test for re-prefetching same bundle
test/integration/flying-shuttle/test/index.test.js
@@ -148,6 +148,22 @@ describe('Flying Shuttle', () => { } }) + it('should not re-prefetch for the page its already on', async () => { + const browser = await webdriver(appPort, '/') + const links = await browser.elementsByCss('link[rel=preload]') + let found = false + + for (const link of links) ...
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-apollo-and-redux-saga/lib/initApollo.js
@@ -6,15 +6,16 @@ import fetch from 'isomorphic-unfetch' let apolloClient = null // Polyfill fetch() on the server (used by apollo-client) -if (!process.browser) { +if (typeof window === 'undefined') { global.fetch = fetch } function create (initialState) { + const isBrowser = typeof window !== 'undefined' ...
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-apollo-and-redux-saga/lib/withApollo.js
@@ -34,7 +34,7 @@ export default ComposedComponent => { // Run all GraphQL queries in the component tree // and extract the resulting data - if (!process.browser) { + if (typeof window === 'undefined') { const apollo = initApollo() try {
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-apollo-and-redux/lib/initApollo.js
@@ -6,15 +6,16 @@ import fetch from 'isomorphic-unfetch' let apolloClient = null // Polyfill fetch() on the server (used by apollo-client) -if (!process.browser) { +if (typeof window === 'undefined') { global.fetch = fetch } function create (initialState) { // Check out https://github.com/zeit/next.js/pul...
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-apollo-and-redux/lib/withApollo.js
@@ -34,7 +34,7 @@ export default ComposedComponent => { // Run all GraphQL queries in the component tree // and extract the resulting data - if (!process.browser) { + if (typeof window === 'undefined') { const apollo = initApollo() try {
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-apollo-auth/lib/initApollo.js
@@ -6,7 +6,7 @@ import fetch from 'isomorphic-unfetch' let apolloClient = null // Polyfill fetch() on the server (used by apollo-client) -if (!process.browser) { +if (typeof window === 'undefined') { global.fetch = fetch } @@ -28,9 +28,10 @@ function create (initialState, { getToken, fetchOptions }) { }) ...
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-apollo-auth/lib/withApollo.js
@@ -43,7 +43,7 @@ export default App => { return {} } - if (!process.browser) { + if (typeof window === 'undefined') { // Run all graphql queries in the component tree // and extract the resulting data try {
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-apollo/lib/init-apollo.js
@@ -5,14 +5,15 @@ let apolloClient = null function create (initialState) { // Check out https://github.com/zeit/next.js/pull/4611 if you want to use the AWSAppSyncClient + const isBrowser = typeof window !== 'undefined' return new ApolloClient({ - connectToDevTools: process.browser, - ssrMode: !process....
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-apollo/lib/with-apollo-client.js
@@ -17,7 +17,7 @@ export default App => { // Run all GraphQL queries in the component tree // and extract the resulting data const apollo = initApollo() - if (!process.browser) { + if (typeof window === 'undefined') { try { // Run all GraphQL queries await g...
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-cookie-auth/www/pages/profile.js
@@ -44,7 +44,7 @@ Profile.getInitialProps = async ctx => { const url = `${process.env.API_URL}/api/profile.js` const redirectOnError = () => - process.browser + typeof window !== 'undefined' ? Router.push('/login') : ctx.res.writeHead(302, { Location: '/login' }).end()
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-graphql-hooks/lib/init-graphql.js
@@ -6,17 +6,17 @@ let graphQLClient = null function create (initialState = {}) { return new GraphQLClient({ - ssrMode: !process.browser, + ssrMode: typeof window === 'undefined', url: 'https://api.graph.cool/simple/v1/cixmkt2ul01q00122mksg82pn', cache: memCache({ initialState }), - fetch: proce...
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-graphql-hooks/lib/with-graphql-client.js
@@ -18,7 +18,7 @@ export default App => { // and extract the resulting data const graphQLClient = initGraphQL() let graphQLState = {} - if (!process.browser) { + if (typeof window === 'undefined') { try { // Run all GraphQL queries graphQLState = await getIn...
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-mobx-react-lite/store.js
@@ -2,7 +2,7 @@ import { action } from 'mobx' import { useObservable, useStaticRendering } from 'mobx-react-lite' import { createContext, useCallback } from 'react' -const isServer = !process.browser +const isServer = typeof window === 'undefined' useStaticRendering(isServer) let StoreContext = createContext()
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-mobx/pages/_app.js
@@ -21,7 +21,7 @@ class MyMobxApp extends App { constructor(props) { super(props) - const isServer = !process.browser + const isServer = typeof window === 'undefined' this.mobxStore = isServer ? props.initialMobxState : initializeStore(props.initialMobxState)
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-mobx/store.js
@@ -1,7 +1,7 @@ import { action, observable } from 'mobx' import { useStaticRendering } from 'mobx-react' -const isServer = !process.browser +const isServer = typeof window === 'undefined' useStaticRendering(isServer) class Store {
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-overmind/pages/_app.js
@@ -24,7 +24,7 @@ class MyApp extends App { const mutations = props.pageProps.mutations || [] - if (process.browser) { + if (typeof window !== 'undefined') { // On the client we just instantiate the Overmind instance and run // the "changePage" action this.overmind = createOvermind(c...
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-portals-ssr/pages/_app.js
@@ -2,7 +2,7 @@ import React from 'react' import App, { Container } from 'next/app' import { prepareClientPortals } from '@jesstelford/react-portal-universal' -if (process.browser) { +if (typeof window !== 'undefined') { // On the client, we have to run this once before React attempts a render. // Here in _ap...
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-react-esi/src/components/BreakingNews.js
@@ -11,8 +11,9 @@ const BreakingNews = props => ( <p>{breaking.body}</p> </article> ))} - We are <b>{process.browser ? 'client-side' : 'server-side'}</b> (now, check - the source of this page) + We are{' '} + <b>{typeof window !== 'undefined' ? 'client-side' : 'server-side'}</b> (...
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-react-esi/src/components/Weather.js
@@ -7,7 +7,7 @@ export default class TopArticles extends React.Component { static async getInitialProps ({ props, req, res }) { // Fetch the weather from a remote API, it may take some time... return new Promise(resolve => { - console.log(process.browser ? 'client-side' : 'server-side') + console...
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-react-multi-carousel/src/getPageContext.js
@@ -43,7 +43,7 @@ let pageContext export default function getPageContext () { // Make sure to create a new context for every server-side request so that data // isn't shared between connections (which would be bad). - if (!process.browser) { + if (typeof window === 'undefined') { return createPageContext(...
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-react-relay-network-modern/lib/createEnvironment/index.js
@@ -1,6 +1,7 @@ import 'isomorphic-fetch' -export const { initEnvironment, createEnvironment } = (!process.browser +export const { initEnvironment, createEnvironment } = (typeof window === +'undefined' ? require('./server') : require('./client') ).default
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-react-uwp/pages/index.js
@@ -9,7 +9,7 @@ import { Button, ColorPicker, DatePicker, ProgressRing } from 'react-uwp' class Index extends Component { static async getInitialProps ({ req }) { let userAgent - if (process.browser) { + if (typeof window !== 'undefined') { userAgent = navigator.userAgent } else { user...
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-relay-modern-server-express/lib/createRelayEnvironment.js
@@ -7,7 +7,8 @@ let relayEnvironment = null // and returns its results as a Promise: function fetchQuery (operation, variables, cacheConfig, uploadables) { // Because we implement the graphql server, the client must to point to the same host - const relayServer = process.browser ? '' : process.env.RELAY_SERVER + ...
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-relay-modern/lib/createRelayEnvironment.js
@@ -26,7 +26,7 @@ export default function initEnvironment ({ records = {} } = {}) { // Make sure to create a new Relay environment for every server-side request so that data // isn't shared between connections (which would be bad) - if (!process.browser) { + if (typeof window === 'undefined') { return ne...
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-sentry/utils/sentry.js
@@ -1,5 +1,4 @@ // NOTE: This require will be replaced with `@sentry/browser` when -// process.browser === true thanks to the webpack config in next.config.js const Sentry = require('@sentry/node') const SentryIntegrations = require('@sentry/integrations') const Cookie = require('js-cookie') @@ -53,7 +52,7 @@ modul...
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
examples/with-unstated/pages/_app.js
@@ -6,7 +6,7 @@ import { counterStore } from '../containers/CounterContainer' class MyApp extends App { static async getInitialProps () { // do your server state here - if (!process.browser) { + if (typeof window === 'undefined') { // reset state for each request counterStore.resetState() ...
true
Other
vercel
next.js
c03e94bebddff570e2181bf3b8c34adf0c704470.json
Remove usage of `process.browser` (#7651)
packages/next/lib/data.ts
@@ -47,7 +47,7 @@ export function createHook( } // @ts-ignore webpack optimization - if (process.browser) { + if (typeof window !== 'undefined') { const res = fetch(router.route + '?' + stringify(router.query), { headers: { accept: 'application/amp.bind+json',
true
Other
vercel
next.js
353e50517231b0c6cd0de40a4dfa8c2712a5f7fb.json
Fix TypeScript typings (#7648) * Fix TypeScript typing This correctly defines `process.browser` instead of `process.env.browser`. It also removes `process.crossOrigin` because it's not found in our documentation anywhere and is mostly used for internal purposes. * Make sure `process.browser` doesn't throw a typ...
examples/with-typescript/next-env.d.ts
@@ -1 +0,0 @@ -/// <reference types="next" />
true
Other
vercel
next.js
353e50517231b0c6cd0de40a4dfa8c2712a5f7fb.json
Fix TypeScript typings (#7648) * Fix TypeScript typing This correctly defines `process.browser` instead of `process.env.browser`. It also removes `process.crossOrigin` because it's not found in our documentation anywhere and is mostly used for internal purposes. * Make sure `process.browser` doesn't throw a typ...
packages/next/bin/next.ts
@@ -84,7 +84,7 @@ if (args['--help']) { } const defaultEnv = command === 'dev' ? 'development' : 'production' -process.env.NODE_ENV = process.env.NODE_ENV || defaultEnv +;(process.env as any).NODE_ENV = process.env.NODE_ENV || defaultEnv // this needs to come after we set the correct NODE_ENV or // else it migh...
true
Other
vercel
next.js
353e50517231b0c6cd0de40a4dfa8c2712a5f7fb.json
Fix TypeScript typings (#7648) * Fix TypeScript typing This correctly defines `process.browser` instead of `process.env.browser`. It also removes `process.crossOrigin` because it's not found in our documentation anywhere and is mostly used for internal purposes. * Make sure `process.browser` doesn't throw a typ...
packages/next/lib/verifyTypeScriptSetup.ts
@@ -252,7 +252,7 @@ export async function verifyTypeScriptSetup(dir: string): Promise<void> { } if (parsedTsConfig.include == null) { - appTsConfig.include = ['**/*.ts', '**/*.tsx'] + appTsConfig.include = ['next-env.d.ts', '**/*.ts', '**/*.tsx'] } if (messages.length > 0) { @@ -286,7 +286,10 @@ e...
true
Other
vercel
next.js
353e50517231b0c6cd0de40a4dfa8c2712a5f7fb.json
Fix TypeScript typings (#7648) * Fix TypeScript typing This correctly defines `process.browser` instead of `process.env.browser`. It also removes `process.crossOrigin` because it's not found in our documentation anywhere and is mostly used for internal purposes. * Make sure `process.browser` doesn't throw a typ...
packages/next/package.json
@@ -36,7 +36,8 @@ "router.d.ts", "amp.js", "amp.d.ts", - "types/index.d.ts" + "types/index.d.ts", + "types/global.d.ts" ], "bin": { "next": "./dist/bin/next"
true
Other
vercel
next.js
353e50517231b0c6cd0de40a4dfa8c2712a5f7fb.json
Fix TypeScript typings (#7648) * Fix TypeScript typing This correctly defines `process.browser` instead of `process.env.browser`. It also removes `process.crossOrigin` because it's not found in our documentation anywhere and is mostly used for internal purposes. * Make sure `process.browser` doesn't throw a typ...
packages/next/types/global.d.ts
@@ -0,0 +1,12 @@ +/// <reference types="node" /> + +// Extend the NodeJS namespace with Next.js-defined properties +declare namespace NodeJS { + interface Process { + readonly browser: boolean + } + + interface ProcessEnv { + readonly NODE_ENV: 'development' | 'production' | 'test' + } +}
true
Other
vercel
next.js
353e50517231b0c6cd0de40a4dfa8c2712a5f7fb.json
Fix TypeScript typings (#7648) * Fix TypeScript typing This correctly defines `process.browser` instead of `process.env.browser`. It also removes `process.crossOrigin` because it's not found in our documentation anywhere and is mostly used for internal purposes. * Make sure `process.browser` doesn't throw a typ...
packages/next/types/index.d.ts
@@ -1,3 +1,7 @@ +/// <reference types="node" /> +/// <reference types="react" /> +/// <reference types="react-dom" /> + import React from 'react' import { @@ -7,18 +11,6 @@ import { NextApiRequest, } from 'next-server/dist/lib/utils' -/// <reference types="node" /> -/// <reference types="react" /> -/// <refer...
true
Other
vercel
next.js
353e50517231b0c6cd0de40a4dfa8c2712a5f7fb.json
Fix TypeScript typings (#7648) * Fix TypeScript typing This correctly defines `process.browser` instead of `process.env.browser`. It also removes `process.crossOrigin` because it's not found in our documentation anywhere and is mostly used for internal purposes. * Make sure `process.browser` doesn't throw a typ...
test/integration/typescript/pages/hello.tsx
@@ -3,6 +3,7 @@ import { hello } from '../components/hello' import { World } from '../components/world' export default function HelloPage(): JSX.Element { + console.log(process.browser) return ( <div> {hello()} <World />
true
Other
vercel
next.js
353e50517231b0c6cd0de40a4dfa8c2712a5f7fb.json
Fix TypeScript typings (#7648) * Fix TypeScript typing This correctly defines `process.browser` instead of `process.env.browser`. It also removes `process.crossOrigin` because it's not found in our documentation anywhere and is mostly used for internal purposes. * Make sure `process.browser` doesn't throw a typ...
test/integration/typescript/tsconfig.json
@@ -4,5 +4,5 @@ "module": "esnext", "jsx": "preserve" }, - "include": ["components", "pages"] + "include": ["next-env.d.ts", "components", "pages"] }
true
Other
vercel
next.js
a30870bd37390543c3e1b0512241b0569788c940.json
Fix typo in with-redux-reselect-recompose example (#7642)
examples/with-redux-reselect-recompose/reducers/index.js
@@ -1,7 +1,7 @@ import { combineReducers } from 'redux' import count, { initialState as countState } from './count' -export const intitialState = { +export const initialState = { count: countState }
false
Other
vercel
next.js
17cc77f00a156b7c498eff3384ff2d0d282b156f.json
Add appveyor.yml file (#1984)
appveyor.yml
@@ -0,0 +1,23 @@ +# Test against the latest version of this Node.js version +environment: + nodejs_version: "6" + +# Install scripts. (runs after repo cloning) +install: + # Install Google Chrome for e2e testing + - choco install googlechrome + # Get the latest stable version of Node.js or io.js + - ps: Install-Pr...
false
Other
vercel
next.js
5f9e9828de7e6ea7c3bf40fa3e973d7451eb84e9.json
Change dynamic imports to dynamic import (#1980) Fix problem with anchor by changing link and changing text to section title.
readme.md
@@ -37,7 +37,7 @@ For the documentation of the latest **stable** release, [visit here](https://git - [With `<Link>`](#with-link-1) - [Imperatively](#imperatively-1) - [Custom server and routing](#custom-server-and-routing) - - [Dynamic Imports](#dynamic-imports) + - [Dynamic Import](#dynamic-import) -...
false
Other
vercel
next.js
00ed2b985ac55c7b7aa19c662fb81a554bc3c76b.json
Move dependency that is not a devDep
package.json
@@ -83,6 +83,7 @@ "pkg-up": "2.0.0", "prop-types": "15.5.10", "react-hot-loader": "3.0.0-beta.6", + "recursive-copy": "^2.0.6", "send": "0.15.2", "source-map-support": "0.4.15", "strip-ansi": "3.0.1", @@ -122,7 +123,6 @@ "nyc": "10.3.2", "react": "15.5.3", "react-dom": "1...
false
Other
vercel
next.js
fd95a94aee4824d6a01df1b7784fd2b6b2af404d.json
Change the output dir to 'out'.
bin/next-export
@@ -34,7 +34,7 @@ if (argv.help) { Options -h - list this help - -o - set the output dir (defaults to 'next-static-out') + -o - set the output dir (defaults to 'out') -s - do not print any messages to console `) process.exit(0) @@ -57,7 +57,7 @@ if (!existsSync(join(dir, 'pages'))) ...
false
Other
vercel
next.js
90991f176c5043e8bed388dfe651b0a9e2d12f2f.json
Add <page>/index.html url re-writes to next/router.
lib/router/router.js
@@ -1,3 +1,5 @@ +/* global __NEXT_DATA__ */ + import { parse, format } from 'url' import mitt from 'mitt' import shallowEquals from '../shallow-equals' @@ -118,7 +120,17 @@ export default class Router { // If url and as provided as an object representation, // we'll format them into the string version here...
false
Other
vercel
next.js
c40ded0c12f4642b13123ba0e5d7170676ab850d.json
Copy the static directory for static file serving.
server/export.js
@@ -35,6 +35,15 @@ export default async function (dir, options) { join(outDir, '_next', buildStats['app.js'].hash, 'app.js') ) + // Copy static directory + if (existsSync(join(dir, 'static'))) { + log(' copying "static" directory') + await cp( + join(dir, 'static'), + join(outDir, 'static')...
false
Other
vercel
next.js
14fa6f5893d692395fffa126f9038e946d6c26b8.json
Add browser tests for next-export
test/integration/static/pages/counter.js
@@ -23,6 +23,7 @@ export default class Counter extends React.Component { </div> <p>Counter: {count}</p> <button + id='counter-increase' onClick={() => this.increaseCounter()} > Increase
true
Other
vercel
next.js
14fa6f5893d692395fffa126f9038e946d6c26b8.json
Add browser tests for next-export
test/integration/static/pages/dynamic.js
@@ -1,7 +1,7 @@ import Link from 'next/link' const DynamicPage = ({ text }) => ( - <div id='about-page'> + <div id='dynamic-page'> <div> <Link href='/'> <a>Go Back</a>
true
Other
vercel
next.js
14fa6f5893d692395fffa126f9038e946d6c26b8.json
Add browser tests for next-export
test/integration/static/pages/index.js
@@ -9,8 +9,8 @@ function routeToAbout (e) { export default () => ( <div id='home-page'> <div> - <Link href='/about' id='about-via-link'> - <a>About via Link</a> + <Link href='/about'> + <a id='about-via-link'>About via Link</a> </Link> <a href='#' @@ -19,28 +19,25...
true
Other
vercel
next.js
14fa6f5893d692395fffa126f9038e946d6c26b8.json
Add browser tests for next-export
test/integration/static/test/browser.js
@@ -0,0 +1,72 @@ +/* global describe, it, expect */ +import webdriver from 'next-webdriver' + +export default function (context) { + describe('Render via browser', () => { + it('should render the home page', async () => { + const browser = await webdriver(context.port, '/') + const text = await browser + ...
true
Other
vercel
next.js
14fa6f5893d692395fffa126f9038e946d6c26b8.json
Add browser tests for next-export
test/integration/static/test/index.test.js
@@ -1,4 +1,4 @@ -/* global jasmine, describe, it, expect, beforeAll, afterAll */ +/* global jasmine, describe, beforeAll, afterAll */ import { join } from 'path' import { @@ -7,9 +7,9 @@ import { startStaticServer, stopApp } from 'next-test-utils' -import webdriver from 'next-webdriver' import ssr from '....
true
Other
vercel
next.js
56dc85485f67ae5b8e1462bdeb1b3c6ca36e05df.json
Add ssr tests for next-export
test/integration/static/test/index.test.js
@@ -4,12 +4,13 @@ import { join } from 'path' import { nextBuild, nextExport, - renderViaHTTP, startStaticServer, stopApp } from 'next-test-utils' import webdriver from 'next-webdriver' +import ssr from './ssr' + jasmine.DEFAULT_TIMEOUT_INTERVAL = 40000 const appDir = join(__dirname, '../') const c...
true
Other
vercel
next.js
56dc85485f67ae5b8e1462bdeb1b3c6ca36e05df.json
Add ssr tests for next-export
test/integration/static/test/ssr.js
@@ -0,0 +1,21 @@ +/* global describe, it, expect */ +import { renderViaHTTP } from 'next-test-utils' + +export default function (context) { + describe('Render via SSR', () => { + it('should render the home page', async () => { + const html = await renderViaHTTP(context.port, '/') + expect(html).toMatch(/T...
true
Other
vercel
next.js
564ae2b98287d346ee2a9705858db5115448d46f.json
Remove the getting started section. Just add the https://learnnextjs.com link at the top of the page.
readme.md
@@ -6,12 +6,15 @@ Next.js is a minimalistic framework for server-rendered React applications. +**Visit https://learnnextjs.com to get started with Next.js.** + +--- + <!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --...
false
Other
vercel
next.js
7b193f1aa7b926b63296d5c7f5bb4c3f33494d76.json
Add basic test setup
.gitignore
@@ -6,7 +6,7 @@ dist node_modules # logs -npm-debug.log +*.log # coverage .nyc_output
true