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 | fd95d6c8bc3c6e89cdf8f84b11146bf86e377ee0.json | Fix AMP HMR for child components (#9736) | packages/next/build/babel/plugins/next-page-config.ts | @@ -81,7 +81,17 @@ export default function nextPageConfig({
}
if (config.amp === true) {
- replaceBundle(path, t)
+ if (
+ !(
+ state.file &&
+ state.file.opts &&
+ sta... | true |
Other | vercel | next.js | fd95d6c8bc3c6e89cdf8f84b11146bf86e377ee0.json | Fix AMP HMR for child components (#9736) | packages/next/build/webpack/loaders/next-babel-loader.js | @@ -130,6 +130,7 @@ module.exports = babelLoader.custom(babel => {
options.caller.isServer = isServer
options.caller.isModern = isModern
+ options.caller.isDev = development
options.plugins = options.plugins || []
| true |
Other | vercel | next.js | fd95d6c8bc3c6e89cdf8f84b11146bf86e377ee0.json | Fix AMP HMR for child components (#9736) | packages/next/server/hot-reloader.ts | @@ -1,7 +1,5 @@
-import fs from 'fs'
import { IncomingMessage, ServerResponse } from 'http'
import { join, normalize, relative as relativePath, sep } from 'path'
-import { promisify } from 'util'
import webpack from 'webpack'
import WebpackDevMiddleware from 'webpack-dev-middleware'
import WebpackHotMiddleware fro... | true |
Other | vercel | next.js | fd95d6c8bc3c6e89cdf8f84b11146bf86e377ee0.json | Fix AMP HMR for child components (#9736) | test/integration/amphtml/components/hello.js | @@ -0,0 +1 @@
+export default () => <p id="hello-comp">hello</p> | true |
Other | vercel | next.js | fd95d6c8bc3c6e89cdf8f84b11146bf86e377ee0.json | Fix AMP HMR for child components (#9736) | test/integration/amphtml/pages/hmr/comp.js | @@ -0,0 +1,10 @@
+import Hello from '../../components/hello'
+
+export const config = { amp: true }
+
+export default () => (
+ <>
+ <Hello />
+ <span>{new Date().getTime()}</span>
+ </>
+) | true |
Other | vercel | next.js | fd95d6c8bc3c6e89cdf8f84b11146bf86e377ee0.json | Fix AMP HMR for child components (#9736) | test/integration/amphtml/test/index.test.js | @@ -356,6 +356,23 @@ describe('AMP Usage', () => {
}
})
+ it('should detect changes to component and refresh an AMP page', async () => {
+ const browser = await webdriver(dynamicAppPort, '/hmr/comp')
+ const text = await browser.elementByCss('#hello-comp').text()
+ expect(text).toBe('hel... | true |
Other | vercel | next.js | 2ba056aa205016145e683ad443b8ae89cf799cba.json | Add check for invalid assetPrefix (#9759)
* Add check for invalid assetPrefix
* Update test/integration/invalid-config-values/test/index.test.js
Co-Authored-By: JJ Kasper <jj@jjsweb.site> | errors/invalid-assetprefix.md | @@ -0,0 +1,17 @@
+# Invalid assetPrefix
+
+#### Why This Error Occurred
+
+The value of `assetPrefix` in `next.config.js` is set to something that is not a `string`.
+
+#### Possible Ways to Fix It
+
+Ensure that `assetPrefix` is a `string`.
+
+Example:
+
+```js
+module.exports = {
+ assetPrefix: '/',
+}
+``` | true |
Other | vercel | next.js | 2ba056aa205016145e683ad443b8ae89cf799cba.json | Add check for invalid assetPrefix (#9759)
* Add check for invalid assetPrefix
* Update test/integration/invalid-config-values/test/index.test.js
Co-Authored-By: JJ Kasper <jj@jjsweb.site> | packages/next/next-server/server/config.ts | @@ -100,6 +100,12 @@ function assignDefaults(userConfig: { [key: string]: any }) {
})
const result = { ...defaultConfig, ...userConfig }
+
+ if (typeof result.assetPrefix !== 'string') {
+ throw new Error(
+ `Specified assetPrefix is not a string, found type "${typeof result.assetPrefix}" https://err.s... | true |
Other | vercel | next.js | 2ba056aa205016145e683ad443b8ae89cf799cba.json | Add check for invalid assetPrefix (#9759)
* Add check for invalid assetPrefix
* Update test/integration/invalid-config-values/test/index.test.js
Co-Authored-By: JJ Kasper <jj@jjsweb.site> | test/integration/invalid-config-values/pages/index.js | @@ -0,0 +1 @@
+export default () => 'hi' | true |
Other | vercel | next.js | 2ba056aa205016145e683ad443b8ae89cf799cba.json | Add check for invalid assetPrefix (#9759)
* Add check for invalid assetPrefix
* Update test/integration/invalid-config-values/test/index.test.js
Co-Authored-By: JJ Kasper <jj@jjsweb.site> | test/integration/invalid-config-values/test/index.test.js | @@ -0,0 +1,63 @@
+/* eslint-env jest */
+/* global jasmine */
+import fs from 'fs-extra'
+import { join } from 'path'
+import { nextBuild } from 'next-test-utils'
+
+const appDir = join(__dirname, '../')
+const nextConfigPath = join(appDir, 'next.config.js')
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 2
+
+const cl... | true |
Other | vercel | next.js | a32af59e9358daf96fd188b9695d067ab8b756fd.json | Fix Shared Sizes Missing Commons (#9752)
* Fix shared sizes missing commons
* Add tests | packages/next/build/index.ts | @@ -384,8 +384,9 @@ export default async function build(dir: string, conf = null): Promise<void> {
bundleRelative
)
- let isStatic = false
let isSsg = false
+ let isStatic = false
+ let isHybridAmp = false
let ssgPageRoutes: string[] | null = null
pagesManifest[pa... | true |
Other | vercel | next.js | a32af59e9358daf96fd188b9695d067ab8b756fd.json | Fix Shared Sizes Missing Commons (#9752)
* Fix shared sizes missing commons
* Add tests | packages/next/build/utils.ts | @@ -32,6 +32,7 @@ export function collectPages(
export interface PageInfo {
isAmp?: boolean
+ isHybridAmp?: boolean
size: number
static: boolean
isSsg: boolean
@@ -135,7 +136,12 @@ export async function printTreeView(
}
})
- const sharedData = await getSharedSizes(distPath, buildManifest, isM... | true |
Other | vercel | next.js | a32af59e9358daf96fd188b9695d067ab8b756fd.json | Fix Shared Sizes Missing Commons (#9752)
* Fix shared sizes missing commons
* Add tests | test/integration/build-output/fixtures/with-amp/pages/amp.js | @@ -0,0 +1,2 @@
+export const config = { amp: true }
+export default () => 'hi' | true |
Other | vercel | next.js | a32af59e9358daf96fd188b9695d067ab8b756fd.json | Fix Shared Sizes Missing Commons (#9752)
* Fix shared sizes missing commons
* Add tests | test/integration/build-output/fixtures/with-amp/pages/hybrid.js | @@ -0,0 +1,2 @@
+export const config = { amp: 'hybrid' }
+export default () => 'hi' | true |
Other | vercel | next.js | a32af59e9358daf96fd188b9695d067ab8b756fd.json | Fix Shared Sizes Missing Commons (#9752)
* Fix shared sizes missing commons
* Add tests | test/integration/build-output/fixtures/with-amp/pages/index.js | @@ -0,0 +1,3 @@
+export default function() {
+ return <div />
+} | true |
Other | vercel | next.js | a32af59e9358daf96fd188b9695d067ab8b756fd.json | Fix Shared Sizes Missing Commons (#9752)
* Fix shared sizes missing commons
* Add tests | test/integration/build-output/test/index.test.js | @@ -25,6 +25,7 @@ describe('Build Output', () => {
expect(stdout).toMatch(/\/ [ ]* \d{1,} B/)
expect(stdout).toMatch(/\+ shared by all [ 0-9.]* kB/)
expect(stdout).toMatch(/ runtime\/main\.js [ 0-9.]* kB/)
+ expect(stdout).toMatch(/ chunks\/commons\.js [ 0-9. ]* kB/)
expect(stdout).no... | true |
Other | vercel | next.js | 8267c8a6ebba3bce15b4ec079edf8d0450a88f9a.json | Normalize RegEx source between node versions (#9749) | test/integration/custom-routes/test/index.test.js | @@ -15,6 +15,7 @@ import {
renderViaHTTP,
getBrowserBodyText,
waitFor,
+ normalizeRegEx,
} from 'next-test-utils'
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 2
@@ -163,127 +164,129 @@ const runTests = (isDev = false) => {
source: '/docs/router-status/:code',
destination: '/doc... | true |
Other | vercel | next.js | 8267c8a6ebba3bce15b4ec079edf8d0450a88f9a.json | Normalize RegEx source between node versions (#9749) | test/integration/dynamic-routing/test/index.test.js | @@ -12,6 +12,7 @@ import {
waitFor,
nextBuild,
nextStart,
+ normalizeRegEx,
} from 'next-test-utils'
import cheerio from 'cheerio'
@@ -395,35 +396,39 @@ function runTests(dev) {
dynamicRoutes: [
{
page: '/blog/[name]/comment/[id]',
- regex: '^\\/blog\\/([^\\/]+?... | true |
Other | vercel | next.js | 8267c8a6ebba3bce15b4ec079edf8d0450a88f9a.json | Normalize RegEx source between node versions (#9749) | test/integration/prerender/test/index.test.js | @@ -15,6 +15,7 @@ import {
nextStart,
stopApp,
nextExport,
+ normalizeRegEx,
startStaticServer,
initNextServerScript,
} from 'next-test-utils'
@@ -326,18 +327,28 @@ const runTests = (dev = false) => {
expect(manifest.dynamicRoutes).toEqual({
'/blog/[post]': {
dataRoute: `/_ne... | true |
Other | vercel | next.js | 8267c8a6ebba3bce15b4ec079edf8d0450a88f9a.json | Normalize RegEx source between node versions (#9749) | test/lib/next-test-utils.js | @@ -399,3 +399,7 @@ export async function getReactErrorOverlayContent(browser) {
export function getBrowserBodyText(browser) {
return browser.eval('document.getElementsByTagName("body")[0].innerText')
}
+
+export function normalizeRegEx(src) {
+ return new RegExp(src).source
+} | true |
Other | vercel | next.js | 8267c8a6ebba3bce15b4ec079edf8d0450a88f9a.json | Normalize RegEx source between node versions (#9749) | yarn.lock | @@ -4172,7 +4172,7 @@ browserify-zlib@^0.2.0:
dependencies:
pako "~1.0.5"
-browserslist@^4.0.0, browserslist@^4.3.6, browserslist@^4.6.0, browserslist@^4.6.3, browserslist@^4.6.4, browserslist@^4.7.3:
+browserslist@^4.0.0, browserslist@^4.3.6, browserslist@^4.6.0, browserslist@^4.6.3, browserslist@^4.6.4, bro... | true |
Other | vercel | next.js | 950d67b72130373e0eeb7ab23601ea479578aee3.json | Add experiment for prefetching (#9747) | packages/next/build/webpack-config.ts | @@ -677,6 +677,9 @@ export default async function getBaseWebpackConfig(
'process.env.__NEXT_EXPORT_TRAILING_SLASH': JSON.stringify(
config.exportTrailingSlash
),
+ 'process.env.__NEXT_PREFETCH_PRELOAD': JSON.stringify(
+ config.experimental.prefetchPreload
+ ),
... | true |
Other | vercel | next.js | 950d67b72130373e0eeb7ab23601ea479578aee3.json | Add experiment for prefetching (#9747) | packages/next/client/page-loader.js | @@ -1,9 +1,13 @@
/* global document, window */
import mitt from '../next-server/lib/mitt'
+const prefetchOrPreload = process.env.__NEXT_PREFETCH_PRELOAD
+ ? 'prefetch'
+ : 'preload'
+
function supportsPreload(el) {
try {
- return el.relList.supports('preload')
+ return el.relList.supports(prefetchOrPrel... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | packages/next/build/webpack/loaders/next-serverless-loader.ts | @@ -104,7 +104,7 @@ const nextServerlessLoader: loader.Loader = function() {
export const config = ComponentInfo['confi' + 'g'] || {}
export const _app = App
- export async function renderReqToHTML(req, res, fromExport) {
+ export async function renderReqToHTML(req, res, fromExport, _renderOpts, _para... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | packages/next/export/index.ts | @@ -116,12 +116,6 @@ export default async function(
const subFolders = nextConfig.exportTrailingSlash
const isLikeServerless = nextConfig.target !== 'server'
- if (!options.buildExport && isLikeServerless) {
- throw new Error(
- 'Cannot export when target is not server. https://err.sh/zeit/next.js/next... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | packages/next/export/worker.js | @@ -1,5 +1,6 @@
import mkdirpModule from 'mkdirp'
import { promisify } from 'util'
+import url from 'url'
import { extname, join, dirname, sep } from 'path'
import { renderToHTML } from '../next-server/server/render'
import { writeFile, access } from 'fs'
@@ -40,14 +41,18 @@ export default async function({
co... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-default-map-serverless/next.config.js | @@ -0,0 +1,3 @@
+module.exports = {
+ target: 'serverless',
+} | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-default-map-serverless/pages/docs/index.js | @@ -0,0 +1,5 @@
+import { useAmp } from 'next/amp'
+
+export const config = { amp: 'hybrid' }
+
+export default () => <p>I'm an {useAmp() ? 'AMP' : 'normal'} page</p> | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-default-map-serverless/pages/index.js | @@ -0,0 +1,2 @@
+export default () => <p>Simple hybrid amp/non-amp page</p>
+export const config = { amp: 'hybrid' } | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-default-map-serverless/pages/info.js | @@ -0,0 +1,5 @@
+import { useAmp } from 'next/amp'
+
+export const config = { amp: 'hybrid' }
+
+export default () => <p>I'm an {useAmp() ? 'AMP' : 'normal'} page</p> | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-default-map-serverless/pages/just-amp/index.js | @@ -0,0 +1,2 @@
+export default () => <p>I am an AMP only page</p>
+export const config = { amp: true } | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-default-map-serverless/pages/some.js | @@ -0,0 +1,3 @@
+export const config = { amp: 'hybrid' }
+
+export default () => <p>I'm an AMP page</p> | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-default-map-serverless/pages/v1.12/docs.js | @@ -0,0 +1,3 @@
+export default function Docs(props) {
+ return <div>Hello again 👋</div>
+} | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-default-map-serverless/pages/v1.12/index.js | @@ -0,0 +1,3 @@
+export default function Index(props) {
+ return <div>Hello 👋</div>
+} | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-default-map-serverless/test/index.test.js | @@ -0,0 +1,68 @@
+/* eslint-env jest */
+/* global jasmine */
+import fs from 'fs'
+import { join } from 'path'
+import cheerio from 'cheerio'
+import { promisify } from 'util'
+import { nextBuild, nextExport } from 'next-test-utils'
+
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 5
+const readFile = promisify(fs.rea... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-dynamic-pages-serverless/next.config.js | @@ -0,0 +1,8 @@
+module.exports = {
+ target: 'serverless',
+ exportPathMap() {
+ return {
+ '/regression/jeff-is-cool': { page: '/regression/[slug]' },
+ }
+ },
+} | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-dynamic-pages-serverless/pages/regression/[slug].js | @@ -0,0 +1,13 @@
+import { useRouter } from 'next/router'
+
+function Regression() {
+ const { asPath } = useRouter()
+ if (typeof window !== 'undefined') {
+ window.__AS_PATHS = [...new Set([...(window.__AS_PATHS || []), asPath])]
+ }
+ return <div id="asPath">{asPath}</div>
+}
+
+Regression.getInitialProps = (... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-dynamic-pages-serverless/test/index.test.js | @@ -0,0 +1,52 @@
+/* eslint-env jest */
+/* global jasmine */
+import { join } from 'path'
+import cheerio from 'cheerio'
+import webdriver from 'next-webdriver'
+import {
+ nextBuild,
+ nextExport,
+ startCleanStaticServer,
+ stopApp,
+ renderViaHTTP,
+ waitFor,
+} from 'next-test-utils'
+
+jasmine.DEFAULT_TIMEO... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/.gitignore | @@ -0,0 +1 @@
+.next-dev | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/components/hello.js | @@ -0,0 +1 @@
+export default () => <p>Welcome to dynamic imports.</p> | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/next.config.js | @@ -0,0 +1,37 @@
+const { PHASE_DEVELOPMENT_SERVER } = require('next/constants')
+
+module.exports = phase => {
+ return {
+ target: 'serverless',
+ distDir: phase === PHASE_DEVELOPMENT_SERVER ? '.next-dev' : '.next',
+ exportTrailingSlash: true,
+ exportPathMap: function() {
+ return {
+ '/': ... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/pages/about.js | @@ -0,0 +1,18 @@
+import Link from 'next/link'
+
+const About = ({ bar }) => (
+ <div id="about-page">
+ <div>
+ <Link href="/">
+ <a>Go Back</a>
+ </Link>
+ </div>
+ <p>{`This is the About page foo${bar || ''}`}</p>
+ </div>
+)
+
+About.getInitialProps = async () => {
+ return { bar: typeo... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/pages/api/data.js | @@ -0,0 +1,3 @@
+export default (req, res) => {
+ res.send('Hello World')
+} | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/pages/blog/[post]/comment/[id].js | @@ -0,0 +1,16 @@
+import { useRouter } from 'next/router'
+
+const Page = () => {
+ const router = useRouter()
+ const { post, id } = router.query
+
+ return (
+ <>
+ <p>{`Blog post ${post} comment ${id || '(all)'}`}</p>
+ </>
+ )
+}
+
+Page.getInitialProps = () => ({})
+
+export default Page | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/pages/button-link.js | @@ -0,0 +1,12 @@
+import Link from 'next/link'
+
+export default () => (
+ <div id="button-link-page">
+ <div>
+ <Link href="/">
+ <button>Go Back</button>
+ </Link>
+ </div>
+ <p>This is the About page</p>
+ </div>
+) | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/pages/counter.js | @@ -0,0 +1,27 @@
+import React from 'react'
+import Link from 'next/link'
+
+let counter = 0
+
+export default class Counter extends React.Component {
+ increaseCounter() {
+ counter++
+ this.forceUpdate()
+ }
+
+ render() {
+ return (
+ <div id="counter-page">
+ <div>
+ <Link href="/">... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/pages/dynamic-imports.js | @@ -0,0 +1,15 @@
+import Link from 'next/link'
+import dynamic from 'next/dynamic'
+
+const DynamicComponent = dynamic(() => import('../components/hello'))
+
+export default () => (
+ <div id="dynamic-imports-page">
+ <div>
+ <Link href="/">
+ <a>Go Back</a>
+ </Link>
+ </div>
+ <DynamicCompo... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/pages/dynamic.js | @@ -0,0 +1,33 @@
+/* global location */
+import React from 'react'
+import Link from 'next/link'
+
+export default class DynamicPage extends React.Component {
+ static getInitialProps({ query }) {
+ return { text: query.text }
+ }
+
+ state = {}
+
+ componentDidMount() {
+ const [, hash] = location.href.split... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/pages/get-initial-props-with-no-query.js | @@ -0,0 +1,7 @@
+const Page = ({ query }) => <div>{`Query is: ${query}`}</div>
+
+Page.getInitialProps = ({ query }) => {
+ return { query: JSON.stringify(query) }
+}
+
+export default Page | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/pages/index.js | @@ -0,0 +1,53 @@
+import Link from 'next/link'
+import Router from 'next/router'
+
+function routeToAbout(e) {
+ e.preventDefault()
+ Router.push('/about')
+}
+
+export default () => (
+ <div id="home-page">
+ <div>
+ <Link href="/about">
+ <a id="about-via-link">About via Link</a>
+ </Link>
+ ... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/pages/level1/about.js | @@ -0,0 +1,12 @@
+import Link from 'next/link'
+
+export default () => (
+ <div id="level1-about-page">
+ <div>
+ <Link href="/">
+ <a>Go Back</a>
+ </Link>
+ </div>
+ <p>This is the Level1 about page</p>
+ </div>
+) | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/pages/level1/index.js | @@ -0,0 +1,12 @@
+import Link from 'next/link'
+
+export default () => (
+ <div id="level1-home-page">
+ <div>
+ <Link href="/">
+ <a>Go Back</a>
+ </Link>
+ </div>
+ <p>This is the Level1 home page</p>
+ </div>
+) | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/pages/query.js | @@ -0,0 +1,12 @@
+import { Component } from 'react'
+
+class Page extends Component {
+ static getInitialProps({ query }) {
+ return { query }
+ }
+ render() {
+ return JSON.stringify(this.props.query, null, 2)
+ }
+}
+
+export default Page | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/public/about/data.txt | @@ -0,0 +1 @@
+data
\ No newline at end of file | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/static/data/item.txt | @@ -0,0 +1 @@
+item
\ No newline at end of file | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/test/api-routes.js | @@ -0,0 +1,28 @@
+/* eslint-env jest */
+import { join } from 'path'
+import { File, runNextCommand } from 'next-test-utils'
+
+export default function(context) {
+ describe('API routes export', () => {
+ const nextConfig = new File(join(context.appDir, 'next.config.js'))
+
+ beforeEach(() => {
+ nextConfig... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/test/browser.js | @@ -0,0 +1,226 @@
+/* eslint-env jest */
+import webdriver from 'next-webdriver'
+import { check, waitFor, getBrowserBodyText } from 'next-test-utils'
+
+export default function(context) {
+ describe('Render via browser', () => {
+ it('should render the home page', async () => {
+ const browser = await webdriv... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/test/dev.js | @@ -0,0 +1,46 @@
+/* eslint-env jest */
+import webdriver from 'next-webdriver'
+import { renderViaHTTP, getBrowserBodyText, check } from 'next-test-utils'
+import cheerio from 'cheerio'
+
+const loadJSONInPage = pageContent => {
+ const page = cheerio.load(pageContent)
+ return JSON.parse(page('#__next').text())
+}
... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/test/dynamic.js | @@ -0,0 +1,27 @@
+/* eslint-env jest */
+import { join } from 'path'
+import { File, runNextCommand } from 'next-test-utils'
+
+export default function(context) {
+ describe('Dynamic routes export', () => {
+ const nextConfig = new File(join(context.appDir, 'next.config.js'))
+ beforeEach(() => {
+ nextConf... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/test/index.test.js | @@ -0,0 +1,101 @@
+/* eslint-env jest */
+/* global jasmine */
+import { join } from 'path'
+import {
+ nextBuild,
+ nextExport,
+ startStaticServer,
+ launchApp,
+ stopApp,
+ killApp,
+ findPort,
+ renderViaHTTP,
+ File,
+} from 'next-test-utils'
+
+import ssr from './ssr'
+import browser from './browser'
+im... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-serverless/test/ssr.js | @@ -0,0 +1,88 @@
+/* eslint-env jest */
+import { renderViaHTTP } from 'next-test-utils'
+import cheerio from 'cheerio'
+
+export default function(context) {
+ describe('Render via SSR', () => {
+ it('should render the home page', async () => {
+ const html = await renderViaHTTP(context.port, '/')
+ expec... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-subfolders-serverless/next.config.js | @@ -0,0 +1,3 @@
+module.exports = {
+ target: 'serverless',
+} | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-subfolders-serverless/pages/about.js | @@ -0,0 +1 @@
+export default () => <p>I am an about page</p> | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-subfolders-serverless/pages/index.js | @@ -0,0 +1 @@
+export default () => <p>I am a home page</p> | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-subfolders-serverless/pages/posts/index.js | @@ -0,0 +1 @@
+export default () => <p>I am a list of posts</p> | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-subfolders-serverless/pages/posts/single.js | @@ -0,0 +1 @@
+export default () => <p>I am a single post</p> | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/export-subfolders-serverless/test/index.test.js | @@ -0,0 +1,39 @@
+/* eslint-env jest */
+/* global jasmine */
+import fs from 'fs'
+import { join } from 'path'
+import cheerio from 'cheerio'
+import { promisify } from 'util'
+import { nextBuild, nextExport } from 'next-test-utils'
+
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 5
+const readFile = promisify(fs.rea... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/serverless-trace/test/index.test.js | @@ -68,7 +68,7 @@ describe('Serverless Trace', () => {
it('should have correct amphtml rel link', async () => {
const html = await renderViaHTTP(appPort, '/some-amp')
expect(html).toMatch(/Hi Im an AMP page/)
- expect(html).toMatch(/rel="amphtml" href="\/some-amp\?amp=1"/)
+ expect(html).toMatch(/rel... | true |
Other | vercel | next.js | 6fcb6230d26582a8f932e849e603e9b93f938dae.json | Add support for exporting from serverless build (#9744)
* Add support for exporting from serverless build
* Add more tests
* Update syntax
* Dont add dynamic params in worker
* Update amphtml rel for serverless tests
* Update tests again
* Update dynamic params populating
* Fix params parsing
*... | test/integration/serverless/test/index.test.js | @@ -109,7 +109,7 @@ describe('Serverless', () => {
it('should have correct amphtml rel link', async () => {
const html = await renderViaHTTP(appPort, '/some-amp')
expect(html).toMatch(/Hi Im an AMP page/)
- expect(html).toMatch(/rel="amphtml" href="\/some-amp\?amp=1"/)
+ expect(html).toMatch(/rel="am... | true |
Other | vercel | next.js | 5b57a7527dcba95f20b56007f343d58402e3a301.json | Improve Build Output for SSG (#9719)
* Improve Build Output for SSG
* Swap out symbols and reasons
* adjust text more
* Add test
* Expect more output lines
* fix test case | packages/next/build/index.ts | @@ -384,6 +384,8 @@ export default async function build(dir: string, conf = null): Promise<void> {
)
let isStatic = false
+ let isSsg = false
+ let ssgPageRoutes: string[] | null = null
pagesManifest[page] = bundleRelative.replace(/\\/g, '/')
@@ -432,25 +434,29 @@ export default asy... | true |
Other | vercel | next.js | 5b57a7527dcba95f20b56007f343d58402e3a301.json | Improve Build Output for SSG (#9719)
* Improve Build Output for SSG
* Swap out symbols and reasons
* adjust text more
* Add test
* Expect more output lines
* fix test case | packages/next/build/utils.ts | @@ -37,7 +37,9 @@ export function collectPages(
export interface PageInfo {
isAmp?: boolean
size: number
- static?: boolean
+ static: boolean
+ isSsg: boolean
+ ssgPageRoutes: string[] | null
serverBundle: string
}
@@ -56,8 +58,8 @@ export function printTreeView(
return chalk.red.bold(size)
}
... | true |
Other | vercel | next.js | 5b57a7527dcba95f20b56007f343d58402e3a301.json | Improve Build Output for SSG (#9719)
* Improve Build Output for SSG
* Swap out symbols and reasons
* adjust text more
* Add test
* Expect more output lines
* fix test case | test/integration/prerender/pages/blog/[post]/index.js | @@ -8,6 +8,7 @@ export async function unstable_getStaticPaths() {
'/blog/post-1',
{ params: { post: 'post-2' } },
'/blog/[post3]',
+ '/blog/post-4',
'/blog/post.1',
]
} | true |
Other | vercel | next.js | 5b57a7527dcba95f20b56007f343d58402e3a301.json | Improve Build Output for SSG (#9719)
* Improve Build Output for SSG
* Swap out symbols and reasons
* adjust text more
* Add test
* Expect more output lines
* fix test case | test/integration/prerender/test/index.test.js | @@ -66,6 +66,11 @@ const expectedManifestRoutes = () => ({
initialRevalidateSeconds: 10,
srcRoute: '/blog/[post]',
},
+ '/blog/post-4': {
+ dataRoute: `/_next/data/${buildId}/blog/post-4.json`,
+ initialRevalidateSeconds: 10,
+ srcRoute: '/blog/[post]',
+ },
'/blog/post-1/comment-1': {
d... | true |
Other | vercel | next.js | c4567a1a813c2b357e6c2857c80ac50d0d29c007.json | Fix TypeError in with-graphql-hooks example (#9658)
Reported at https://github.com/zeit/next.js/issues/9617
Use `AppTree` so that `withRouter` works correctly. | examples/with-graphql-hooks/lib/with-graphql-client.js | @@ -7,7 +7,7 @@ export default App => {
return class GraphQLHooks extends React.Component {
static displayName = 'GraphQLHooks(App)'
static async getInitialProps(ctx) {
- const { Component, router } = ctx
+ const { AppTree } = ctx
let appProps = {}
if (App.getInitialProps) {
@@ -2... | false |
Other | vercel | next.js | c593171db12fd2093d2e7d85a3d7feaa36444023.json | Add Tailwind and PurgeCSS Test (#9714) | package.json | @@ -35,6 +35,7 @@
"@babel/plugin-proposal-object-rest-spread": "7.6.2",
"@babel/preset-flow": "7.0.0",
"@babel/preset-react": "7.7.0",
+ "@fullhuman/postcss-purgecss": "1.3.0",
"@mdx-js/loader": "0.18.0",
"@types/jest": "24.0.13",
"@types/string-hash": "1.1.1", | true |
Other | vercel | next.js | c593171db12fd2093d2e7d85a3d7feaa36444023.json | Add Tailwind and PurgeCSS Test (#9714) | test/integration/css-fixtures/with-tailwindcss-and-purgecss/pages/_app.js | @@ -0,0 +1,5 @@
+import '../styles/global.css'
+
+export default function MyApp({ Component, pageProps }) {
+ return <Component {...pageProps} />
+} | true |
Other | vercel | next.js | c593171db12fd2093d2e7d85a3d7feaa36444023.json | Add Tailwind and PurgeCSS Test (#9714) | test/integration/css-fixtures/with-tailwindcss-and-purgecss/pages/index.js | @@ -0,0 +1,38 @@
+import Link from 'next/link'
+
+const links = [
+ { href: 'https://github.com/zeit/next.js', label: 'GitHub' },
+ { href: 'https://nextjs.org/docs', label: 'Docs' },
+]
+
+function Nav() {
+ return (
+ <nav>
+ <ul className="flex justify-between items-center p-8">
+ <li>
+ <... | true |
Other | vercel | next.js | c593171db12fd2093d2e7d85a3d7feaa36444023.json | Add Tailwind and PurgeCSS Test (#9714) | test/integration/css-fixtures/with-tailwindcss-and-purgecss/postcss.config.js | @@ -0,0 +1,13 @@
+const path = require('path')
+module.exports = {
+ plugins: [
+ 'tailwindcss',
+ [
+ '@fullhuman/postcss-purgecss',
+ {
+ content: [path.join(__dirname, './pages/**/*.{js,jsx,ts,tsx}')],
+ defaultExtractor: content => content.match(/[A-Za-z0-9-_:/]+/g) || [],
+ },
+... | true |
Other | vercel | next.js | c593171db12fd2093d2e7d85a3d7feaa36444023.json | Add Tailwind and PurgeCSS Test (#9714) | test/integration/css-fixtures/with-tailwindcss-and-purgecss/styles/global.css | @@ -0,0 +1,3 @@
+@tailwind base;
+@tailwind components;
+@tailwind utilities; | true |
Other | vercel | next.js | c593171db12fd2093d2e7d85a3d7feaa36444023.json | Add Tailwind and PurgeCSS Test (#9714) | test/integration/css/test/index.test.js | @@ -598,4 +598,42 @@ describe('CSS Support', () => {
expect(cssMapFiles.length).toBe(1)
})
})
+
+ describe('Tailwind and Purge CSS', () => {
+ const appDir = join(fixturesDir, 'with-tailwindcss-and-purgecss')
+
+ beforeAll(async () => {
+ await remove(join(appDir, '.next'))
+ })
+
+ it(... | true |
Other | vercel | next.js | c593171db12fd2093d2e7d85a3d7feaa36444023.json | Add Tailwind and PurgeCSS Test (#9714) | yarn.lock | @@ -1308,6 +1308,14 @@
resolved "https://registry.yarnpkg.com/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.2.23.tgz#a0df05b210ff03c65ecb3589390095631b95e1f8"
integrity sha512-BJqOF51sPQjmRoX+WFMbZ5mhuy53JrFN0t1KY+HffcvDRb+82+vkFatKnwG3wTCKV183vJW5tGQIytb4T8pUBg==
+"@fullhuman/postcss-purgecss@1.3.0":
+ ... | true |
Other | vercel | next.js | 2347e3e47e789b89eba9572c9cf39dcf5a28e0c6.json | Adjust return value (#9712)
* Adjust return value
* Add delay | packages/next/next-server/server/load-components.ts | @@ -19,7 +19,7 @@ export type LoadComponentsReturnType = {
params: any
}) => {
props: any
- revalidate: number | false
+ revalidate?: number | boolean
}
unstable_getStaticPaths?: () => void
buildManifest?: any | true |
Other | vercel | next.js | 2347e3e47e789b89eba9572c9cf39dcf5a28e0c6.json | Adjust return value (#9712)
* Adjust return value
* Add delay | packages/next/next-server/server/render.tsx | @@ -156,7 +156,7 @@ type RenderOpts = {
params: any | undefined
}) => {
props: any
- revalidate: number | false
+ revalidate?: number | boolean
}
unstable_getStaticPaths?: () => void
}
@@ -458,14 +458,14 @@ export async function renderToHTML(
`\nTo only run getStaticProps at bui... | true |
Other | vercel | next.js | 2347e3e47e789b89eba9572c9cf39dcf5a28e0c6.json | Adjust return value (#9712)
* Adjust return value
* Add delay | test/integration/prerender/pages/another/index.js | @@ -19,7 +19,7 @@ export async function unstable_getStaticProps() {
world: text,
time: new Date().getTime(),
},
- revalidate: 1,
+ revalidate: true,
}
}
| true |
Other | vercel | next.js | 2347e3e47e789b89eba9572c9cf39dcf5a28e0c6.json | Adjust return value (#9712)
* Adjust return value
* Add delay | test/integration/prerender/test/index.test.js | @@ -93,7 +93,7 @@ const expectedManifestRoutes = () => ({
},
'/default-revalidate': {
dataRoute: `/_next/data/${buildId}/default-revalidate.json`,
- initialRevalidateSeconds: 1,
+ initialRevalidateSeconds: false,
srcRoute: null,
},
'/something': {
@@ -114,12 +114,17 @@ const navigateTest = (... | true |
Other | vercel | next.js | a40a32d1cc37689f20a48dc9ccdadac054790f75.json | Fix SSG tests failing on windows (#9710) | packages/next/next-server/server/spr-cache.ts | @@ -37,7 +37,7 @@ export const calculateRevalidate = (pathname: string): number | false => {
// in development we don't have a prerender-manifest
// and default to always revalidating to allow easier debugging
const curTime = new Date().getTime()
- if (sprOptions.dev) return curTime
+ if (sprOptions.dev) ret... | true |
Other | vercel | next.js | a40a32d1cc37689f20a48dc9ccdadac054790f75.json | Fix SSG tests failing on windows (#9710) | test/integration/prerender/test/index.test.js | @@ -105,6 +105,17 @@ const expectedManifestRoutes = () => ({
const navigateTest = () => {
it('should navigate between pages successfully', async () => {
+ const toBuild = [
+ '/',
+ '/another',
+ '/something',
+ '/normal',
+ '/blog/post-1',
+ '/blog/post-1/comment-1',
+ ]
+
+ ... | true |
Other | vercel | next.js | 808a21cf32ce6ba0d074261ade630c0eb54a7561.json | Update Azure chromedriver version (#9708)
* Add listing Chrome version to Azure
* Move script up
* Update script
* Update chromedriver version | azure-pipelines.yml | @@ -4,7 +4,7 @@ pool:
variables:
NEXT_TELEMETRY_DISABLED: '1'
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
- CHROMEDRIVER_VERSION: '76.0.3809.68'
+ CHROMEDRIVER_VERSION: '78.0.3904.70'
strategy:
maxParallel: 10
@@ -23,6 +23,10 @@ strategy:
node_version: ^10.10.0
steps:
+ - script: |
+ w... | false |
Other | vercel | next.js | e11cf22721936a955108d643a9b6a948681302b0.json | Enable New Chunking for CSS (#9688)
* Enable New Chunking for CSS
* set false | packages/next/next-server/server/config.ts | @@ -99,7 +99,12 @@ function assignDefaults(userConfig: { [key: string]: any }) {
}
})
- return { ...defaultConfig, ...userConfig }
+ const result = { ...defaultConfig, ...userConfig }
+ if (result.experimental && result.experimental.css) {
+ // The new CSS support requires granular chunks be enabled.
+ ... | true |
Other | vercel | next.js | e11cf22721936a955108d643a9b6a948681302b0.json | Enable New Chunking for CSS (#9688)
* Enable New Chunking for CSS
* set false | test/integration/css/next.config.js | @@ -3,7 +3,11 @@ module.exports = {
// Make sure entries are not getting disposed.
maxInactiveAge: 1000 * 60 * 60,
},
- experimental: { css: true, granularChunks: true },
+ experimental: {
+ css: true,
+ // Intentionally set false to ensure we force to true.
+ granularChunks: false,
+ },
web... | true |
Other | vercel | next.js | 6c103ef5a6c0b154e6bce402ffed74b87586745b.json | Add checking of custom routes for invalid fields (#9434)
* Add checking of custom routes for invalid fields
* Remove un-used test imports
* Mentioned statusCode can be undefined in error message
* Update test
* Update invalid routes output
* Add checking to make sure source/destination start with slash
* Update ... | packages/next/build/index.ts | @@ -55,6 +55,7 @@ import {
} from './utils'
import getBaseWebpackConfig from './webpack-config'
import { writeBuildId } from './write-build-id'
+import checkCustomRoutes from '../lib/check-custom-routes'
const fsAccess = promisify(fs.access)
const fsUnlink = promisify(fs.unlink)
@@ -102,9 +103,11 @@ export defau... | true |
Other | vercel | next.js | 6c103ef5a6c0b154e6bce402ffed74b87586745b.json | Add checking of custom routes for invalid fields (#9434)
* Add checking of custom routes for invalid fields
* Remove un-used test imports
* Mentioned statusCode can be undefined in error message
* Update test
* Update invalid routes output
* Add checking to make sure source/destination start with slash
* Update ... | packages/next/build/utils.ts | @@ -11,7 +11,7 @@ import prettyBytes from '../lib/pretty-bytes'
import { recursiveReadDir } from '../lib/recursive-readdir'
import { getRouteMatcher, getRouteRegex } from '../next-server/lib/router/utils'
import { isDynamicRoute } from '../next-server/lib/router/utils/is-dynamic'
-import { Redirect, Rewrite } from '... | true |
Other | vercel | next.js | 6c103ef5a6c0b154e6bce402ffed74b87586745b.json | Add checking of custom routes for invalid fields (#9434)
* Add checking of custom routes for invalid fields
* Remove un-used test imports
* Mentioned statusCode can be undefined in error message
* Update test
* Update invalid routes output
* Add checking to make sure source/destination start with slash
* Update ... | packages/next/lib/check-custom-routes.ts | @@ -0,0 +1,88 @@
+export type Rewrite = {
+ source: string
+ destination: string
+}
+
+export type Redirect = Rewrite & {
+ statusCode?: number
+}
+
+const allowedStatusCodes = new Set([301, 302, 303, 307, 308])
+
+export default function checkCustomRoutes(
+ routes: Array<Rewrite | Redirect>,
+ type: 'redirect' |... | true |
Other | vercel | next.js | 6c103ef5a6c0b154e6bce402ffed74b87586745b.json | Add checking of custom routes for invalid fields (#9434)
* Add checking of custom routes for invalid fields
* Remove un-used test imports
* Mentioned statusCode can be undefined in error message
* Update test
* Update invalid routes output
* Add checking to make sure source/destination start with slash
* Update ... | packages/next/next-server/server/next-server.ts | @@ -39,20 +39,12 @@ import { sendHTML } from './send-html'
import { serveStatic } from './serve-static'
import { getSprCache, initializeSprCache, setSprCache } from './spr-cache'
import { isBlockedPage } from './utils'
+import { Redirect, Rewrite } from '../../lib/check-custom-routes'
const getCustomRouteMatcher ... | true |
Other | vercel | next.js | 6c103ef5a6c0b154e6bce402ffed74b87586745b.json | Add checking of custom routes for invalid fields (#9434)
* Add checking of custom routes for invalid fields
* Remove un-used test imports
* Mentioned statusCode can be undefined in error message
* Update test
* Update invalid routes output
* Add checking to make sure source/destination start with slash
* Update ... | packages/next/server/next-dev-server.ts | @@ -27,6 +27,7 @@ import { Telemetry } from '../telemetry/storage'
import ErrorDebug from './error-debug'
import HotReloader from './hot-reloader'
import { findPageFile } from './lib/find-page-file'
+import checkCustomRoutes from '../lib/check-custom-routes'
if (typeof React.Suspense === 'undefined') {
throw n... | true |
Other | vercel | next.js | 6c103ef5a6c0b154e6bce402ffed74b87586745b.json | Add checking of custom routes for invalid fields (#9434)
* Add checking of custom routes for invalid fields
* Remove un-used test imports
* Mentioned statusCode can be undefined in error message
* Update test
* Update invalid routes output
* Add checking to make sure source/destination start with slash
* Update ... | test/integration/invalid-custom-routes/pages/index.js | @@ -0,0 +1 @@
+export default () => 'hi' | true |
Other | vercel | next.js | 6c103ef5a6c0b154e6bce402ffed74b87586745b.json | Add checking of custom routes for invalid fields (#9434)
* Add checking of custom routes for invalid fields
* Remove un-used test imports
* Mentioned statusCode can be undefined in error message
* Update test
* Update invalid routes output
* Add checking to make sure source/destination start with slash
* Update ... | test/integration/invalid-custom-routes/test/index.test.js | @@ -0,0 +1,165 @@
+/* eslint-env jest */
+/* global jasmine */
+import fs from 'fs-extra'
+import { join } from 'path'
+import { launchApp, findPort, nextBuild } from 'next-test-utils'
+
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 2
+
+let appDir = join(__dirname, '..')
+const nextConfigPath = join(appDir, 'next.co... | true |
Other | vercel | next.js | 6c103ef5a6c0b154e6bce402ffed74b87586745b.json | Add checking of custom routes for invalid fields (#9434)
* Add checking of custom routes for invalid fields
* Remove un-used test imports
* Mentioned statusCode can be undefined in error message
* Update test
* Update invalid routes output
* Add checking to make sure source/destination start with slash
* Update ... | test/lib/next-test-utils.js | @@ -137,11 +137,15 @@ export function runNextCommandDev(argv, stdOut, opts = {}) {
return new Promise((resolve, reject) => {
const instance = spawn('node', ['dist/bin/next', ...argv], { cwd, env })
+ let didResolve = false
function handleStdout(data) {
const message = data.toString()
i... | true |
Other | vercel | next.js | d892229623149cebf6c700553854ef17453bbb5b.json | Simplify config in with-jest-typescript example (#9664)
jest didn't include TS extensions by default, now it does.
Plus some minor adjustments. | examples/with-jest-typescript/jest.config.js | @@ -1,12 +1,3 @@
-const TEST_REGEX = '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|js?|tsx?|ts?)$'
-
module.exports = {
setupFiles: ['<rootDir>/jest.setup.js'],
- testRegex: TEST_REGEX,
- transform: {
- '^.+\\.tsx?$': 'babel-jest',
- },
- testPathIgnorePatterns: ['<rootDir>/.next/', '<rootDir>/node_modules/'],... | true |
Other | vercel | next.js | d892229623149cebf6c700553854ef17453bbb5b.json | Simplify config in with-jest-typescript example (#9664)
jest didn't include TS extensions by default, now it does.
Plus some minor adjustments. | examples/with-jest-typescript/package.json | @@ -13,14 +13,14 @@
"react-dom": "^16.8.4"
},
"devDependencies": {
- "@types/jest": "^24.0.11",
+ "@types/jest": "^24.0.23",
"@types/react": "^16.8.8",
"@types/react-dom": "^16.8.2",
"babel-core": "^6.26.3",
- "babel-jest": "^24.5.0",
+ "babel-jest": "^24.9.0",
"enzyme": "^3.9... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.