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
2f50f1f8c948b5766a783adfba5e05d129deb624.json
Stabilize more tests (#15470) jest retries seem to be masking test failures, like the `auto-export` one (and maybe others). I turned it off for now. The `auto-export` test fails when retries are turned off. the output of this test failure was a bit unhelpful so I also improved it. Many tests have anonymous page functi...
test/integration/scroll-back-restoration/pages/another.js
@@ -1,10 +1,12 @@ import Link from 'next/link' -export default () => ( - <> - <p id="another">hi from another</p> - <Link href="/"> - <a id="to-index">to index</a> - </Link> - </> -) +export default function Page() { + return ( + <> + <p id="another">hi from another</p> + <Link href="/"...
true
Other
vercel
next.js
2f50f1f8c948b5766a783adfba5e05d129deb624.json
Stabilize more tests (#15470) jest retries seem to be masking test failures, like the `auto-export` one (and maybe others). I turned it off for now. The `auto-export` test fails when retries are turned off. the output of this test failure was a bit unhelpful so I also improved it. Many tests have anonymous page functi...
test/integration/serverless-runtime-configs/pages/_app.js
@@ -2,9 +2,11 @@ import getConfig from 'next/config' const config = getConfig() -export default ({ Component, pageProps }) => ( - <> - <p id="app-config">{JSON.stringify(config)}</p> - <Component {...pageProps} /> - </> -) +export default function App({ Component, pageProps }) { + return ( + <> + ...
true
Other
vercel
next.js
2f50f1f8c948b5766a783adfba5e05d129deb624.json
Stabilize more tests (#15470) jest retries seem to be masking test failures, like the `auto-export` one (and maybe others). I turned it off for now. The `auto-export` test fails when retries are turned off. the output of this test failure was a bit unhelpful so I also improved it. Many tests have anonymous page functi...
test/lib/wd-chain.js
@@ -92,6 +92,14 @@ export default class Chain { ) } + waitForCondition(condition) { + return this.updateChain(() => + this.browser.wait(async (driver) => { + return driver.executeScript('return ' + condition).catch(() => false) + }) + ) + } + eval(snippet) { if (typeof snippet...
true
Other
vercel
next.js
2f50f1f8c948b5766a783adfba5e05d129deb624.json
Stabilize more tests (#15470) jest retries seem to be masking test failures, like the `auto-export` one (and maybe others). I turned it off for now. The `auto-export` test fails when retries are turned off. the output of this test failure was a bit unhelpful so I also improved it. Many tests have anonymous page functi...
yarn.lock
@@ -3917,19 +3917,21 @@ bindings@^1.5.0: dependencies: file-uri-to-path "1.0.0" -bl@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/bl/-/bl-2.2.0.tgz#e1a574cdf528e4053019bb800b041c0ac88da493" - dependencies: - readable-stream "^2.3.5" - safe-buffer "^5.1.1" - bl@^3.0.0: version...
true
Other
vercel
next.js
574fe0b582d5cc1b13663121fd47a3d82deaaa17.json
Make dynamic routes case-sensitive (#15444) Fixes https://github.com/vercel/next.js/issues/15377 Closes https://github.com/vercel/next.js/pull/15394
packages/next/next-server/lib/router/utils/route-regex.ts
@@ -107,15 +107,15 @@ export function getRouteRegex( .join('') return { - re: new RegExp(`^${parameterizedRoute}(?:/)?$`, 'i'), + re: new RegExp(`^${parameterizedRoute}(?:/)?$`), groups, routeKeys, namedRegex: `^${namedParameterizedRoute}(?:/)?$`, } } return { -...
true
Other
vercel
next.js
574fe0b582d5cc1b13663121fd47a3d82deaaa17.json
Make dynamic routes case-sensitive (#15444) Fixes https://github.com/vercel/next.js/issues/15377 Closes https://github.com/vercel/next.js/pull/15394
test/integration/client-navigation/pages/dynamic/[slug]/route.js
@@ -0,0 +1,13 @@ +import React from 'react' + +export default class DynamicRoute extends React.Component { + static async getInitialProps({ query = { slug: 'default' } }) { + return { + query, + } + } + + render() { + return <p>{this.props.query.slug}</p> + } +}
true
Other
vercel
next.js
574fe0b582d5cc1b13663121fd47a3d82deaaa17.json
Make dynamic routes case-sensitive (#15444) Fixes https://github.com/vercel/next.js/issues/15377 Closes https://github.com/vercel/next.js/pull/15394
test/integration/client-navigation/test/index.test.js
@@ -43,6 +43,7 @@ describe('Client Navigation', () => { '/url-prop-override', '/dynamic/ssr', + '/dynamic/[slug]/route', '/nav', '/nav/about', @@ -1002,6 +1003,27 @@ describe('Client Navigation', () => { await browser.close() }) + it('should get url dynamic param', ...
true
Other
vercel
next.js
4bf01d4ec8829fe90489f3c1aadebb5bb1e06a10.json
feat(next-swc): Update css parser (#36114) This only applies https://github.com/swc-project/swc/commit/81370d16cb405d43aeb9198e1fce4aa11009045f This fixes parsing of legacy `calc`s.
packages/next-swc/Cargo.lock
@@ -2040,9 +2040,9 @@ dependencies = [ [[package]] name = "swc_css_parser" -version = "0.100.1" +version = "0.100.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63ba20eb665492621fee54b67432c29f58a8f440541d2c68f549d212cd595dea" +checksum = "aa623eabb6808a9bdee076605fc8023f0e1fea460...
false
Other
vercel
next.js
ad1b6310deb6ccaec16016e999049fa307a8a61c.json
add support for changing /route/#hashes (#36079) update with-google-analytics example to also fire events when the hash section of the URL changes.
examples/with-google-analytics/pages/_app.js
@@ -10,8 +10,10 @@ const App = ({ Component, pageProps }) => { gtag.pageview(url) } router.events.on('routeChangeComplete', handleRouteChange) + router.events.on('hashChangeComplete', handleRouteChange) return () => { router.events.off('routeChangeComplete', handleRouteChange) + rou...
false
Other
vercel
next.js
da6f271d9be8eb96727d8a8079d0b01aabb36faa.json
Interpolate module.exports as default import (#36082) fixes https://github.com/vercel/next.js/issues/34412 ## Bug - [x] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request...
packages/next/build/webpack/loaders/next-flight-client-loader.ts
@@ -10,6 +10,8 @@ import { promisify } from 'util' import { parse } from '../../swc' import { buildExports } from './utils' +const IS_NEXT_CLIENT_BUILT_IN = /[\\/]next[\\/](link|image)\.js$/ + function addExportNames(names: string[], node: any) { if (!node) return switch (node.type) { @@ -57,7 +59,7 @@ async...
true
Other
vercel
next.js
da6f271d9be8eb96727d8a8079d0b01aabb36faa.json
Interpolate module.exports as default import (#36082) fixes https://github.com/vercel/next.js/issues/34412 ## Bug - [x] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request...
packages/next/lib/eslint/runLintCheck.ts
@@ -34,8 +34,12 @@ function isValidSeverity(severity: string): severity is Severity { } const requiredPackages = [ - { file: 'eslint', pkg: 'eslint' }, - { file: 'eslint-config-next', pkg: 'eslint-config-next' }, + { file: 'eslint', pkg: 'eslint', exportsRestrict: false }, + { + file: 'eslint-config-next', +...
true
Other
vercel
next.js
da6f271d9be8eb96727d8a8079d0b01aabb36faa.json
Interpolate module.exports as default import (#36082) fixes https://github.com/vercel/next.js/issues/34412 ## Bug - [x] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request...
packages/next/lib/has-necessary-dependencies.ts
@@ -1,6 +1,10 @@ +import { existsSync } from 'fs' +import { join, relative } from 'path' + export interface MissingDependency { file: string pkg: string + exportsRestrict: boolean } export type NecessaryDependencies = { @@ -15,7 +19,24 @@ export async function hasNecessaryDependencies( let resolutions = ...
true
Other
vercel
next.js
da6f271d9be8eb96727d8a8079d0b01aabb36faa.json
Interpolate module.exports as default import (#36082) fixes https://github.com/vercel/next.js/issues/34412 ## Bug - [x] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request...
packages/next/lib/verify-partytown-setup.ts
@@ -61,7 +61,13 @@ export async function verifyPartytownSetup( try { const partytownDeps: NecessaryDependencies = await hasNecessaryDependencies( dir, - [{ file: '@builder.io/partytown', pkg: '@builder.io/partytown' }] + [ + { + file: '@builder.io/partytown', + pkg: '@b...
true
Other
vercel
next.js
da6f271d9be8eb96727d8a8079d0b01aabb36faa.json
Interpolate module.exports as default import (#36082) fixes https://github.com/vercel/next.js/issues/34412 ## Bug - [x] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request...
packages/next/lib/verifyTypeScriptSetup.ts
@@ -17,9 +17,17 @@ import { missingDepsError } from './typescript/missingDependencyError' import { NextConfigComplete } from '../server/config-shared' const requiredPackages = [ - { file: 'typescript', pkg: 'typescript' }, - { file: '@types/react/index.d.ts', pkg: '@types/react' }, - { file: '@types/node/index.d...
true
Other
vercel
next.js
da6f271d9be8eb96727d8a8079d0b01aabb36faa.json
Interpolate module.exports as default import (#36082) fixes https://github.com/vercel/next.js/issues/34412 ## Bug - [x] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request...
packages/next/taskfile-swc.js
@@ -14,7 +14,11 @@ module.exports = function (task) { function* ( file, serverOrClient, - { stripExtension, keepImportAssertions = false } = {} + { + stripExtension, + keepImportAssertions = false, + interopClientDefaultExport = false, + } = {} ) { // D...
true
Other
vercel
next.js
da6f271d9be8eb96727d8a8079d0b01aabb36faa.json
Interpolate module.exports as default import (#36082) fixes https://github.com/vercel/next.js/issues/34412 ## Bug - [x] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request...
packages/next/taskfile.js
@@ -1826,7 +1826,7 @@ export async function nextbuild(task, opts) { export async function client(task, opts) { await task .source(opts.src || 'client/**/*.+(js|ts|tsx)') - .swc('client', { dev: opts.dev }) + .swc('client', { dev: opts.dev, interopClientDefaultExport: true }) .target('dist/client') ...
true
Other
vercel
next.js
da6f271d9be8eb96727d8a8079d0b01aabb36faa.json
Interpolate module.exports as default import (#36082) fixes https://github.com/vercel/next.js/issues/34412 ## Bug - [x] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request...
test/e2e/type-module-interop/index.test.ts
@@ -11,8 +11,17 @@ describe('Type module interop', () => { next = await createNext({ files: { 'pages/index.js': ` + import Link from 'next/link' + export default function Page() { - return <p>hello world</p> + return ( + <> + <p...
true
Other
vercel
next.js
95a8f31d86f47d8d8f00534781974f143129ecfe.json
Fix outputStandalone with optimizeCss (#36028)
packages/next/build/index.ts
@@ -2085,14 +2085,15 @@ export default async function build( }, []), ]) { const filePath = path.join(dir, file) - await promises.copyFile( - filePath, - path.join( - distDir, - 'standalone', - path.relative(outputFileTracingRoot, filePat...
true
Other
vercel
next.js
95a8f31d86f47d8d8f00534781974f143129ecfe.json
Fix outputStandalone with optimizeCss (#36028)
test/production/standalone-mode-and-optimizecss/index.test.ts
@@ -0,0 +1,43 @@ +import { createNext } from 'e2e-utils' +import { NextInstance } from 'test/lib/next-modes/base' +import { renderViaHTTP } from 'next-test-utils' + +describe('standalone mode and optimizeCss', () => { + let next: NextInstance + + beforeAll(async () => { + next = await createNext({ + files: { ...
true
Other
vercel
next.js
f6de29f9d431742899e6010c198fcbc95f7fe78f.json
Add note to contributing about docs manifest (#36020) * Add note to contributing about docs manifest * Update contributing.md Co-authored-by: Balázs Orbán <info@balazsorban.com> Co-authored-by: Tim Neutkens <tim@timneutkens.nl> Co-authored-by: Balázs Orbán <info@balazsorban.com>
contributing.md
@@ -196,6 +196,47 @@ This will use the version of `next` built inside of the Next.js monorepo and the main `yarn dev` monorepo command can be running to make changes to the local Next.js version at the same time (some changes might require re-running `yarn next-with-deps` to take effect). +## Updating documentation...
false
Other
vercel
next.js
a0924fc7c763797b2927b4c3cb0f321ead49e645.json
Add docs for x-nextjs-cache header (#36023) This adds documentation for the `x-nextjs-cache` header which is now exposed for ISR pages and image optimization requests to help signal the cache state. ## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint` Co-authored-by: Steven <...
docs/api-reference/data-fetching/get-static-props.md
@@ -83,6 +83,12 @@ export async function getStaticProps() { Learn more about [Incremental Static Regeneration](/docs/basic-features/data-fetching/incremental-static-regeneration.md) +The cache status of a page leveraging ISR can be determined by reading the value of the `x-nextjs-cache` response header. The possib...
true
Other
vercel
next.js
a0924fc7c763797b2927b4c3cb0f321ead49e645.json
Add docs for x-nextjs-cache header (#36023) This adds documentation for the `x-nextjs-cache` header which is now exposed for ISR pages and image optimization requests to help signal the cache state. ## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint` Co-authored-by: Steven <...
docs/api-reference/next/image.md
@@ -422,6 +422,12 @@ The following describes the caching algorithm for the default [loader](#loader). Images are optimized dynamically upon request and stored in the `<distDir>/cache/images` directory. The optimized image file will be served for subsequent requests until the expiration is reached. When a request is ...
true
Other
vercel
next.js
3d4f4c6995587145c19c13892f84cae81d2eb334.json
Update the docs for Switchable Runtime (#36015) As per the feedback in #35952. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature ...
docs/advanced-features/react-18/switchable-runtime.md
@@ -1,6 +1,6 @@ # Switchable Runtime (Alpha) -By default, Next.js uses Node.js as the runtime for page rendering, including pre-rendering, server-side rendering. +By default, Next.js uses Node.js as the runtime for page rendering, including pre-rendering and server-side rendering. If you have [React 18](/docs/adv...
false
Other
vercel
next.js
de0bc57b6e522395d62076eb60b6b6c92488be2e.json
test: organize react 18 tests (#36003) * Organize react 18 test cases, group invalid cases to speed up the regular test cases * Add `runDevSuite` and `runProdSuite` for group next dev/prod test cases ```js runDevSuite(name, appDir, { runTests: (context, env) => { ... }, beforeAll, afterAll, }) runProdvSuite(na...
test/integration/import-assertion/test/index.test.js
@@ -1,37 +1,8 @@ import { join } from 'path' -import { - nextBuild, - nextStart, - launchApp, - killApp, - findPort, - renderViaHTTP, -} from 'next-test-utils' +import { renderViaHTTP, runDevSuite, runProdSuite } from 'next-test-utils' const appDir = join(__dirname, '../') -function runSuite(suiteName, env,...
true
Other
vercel
next.js
de0bc57b6e522395d62076eb60b6b6c92488be2e.json
test: organize react 18 tests (#36003) * Organize react 18 test cases, group invalid cases to speed up the regular test cases * Add `runDevSuite` and `runProdSuite` for group next dev/prod test cases ```js runDevSuite(name, appDir, { runTests: (context, env) => { ... }, beforeAll, afterAll, }) runProdvSuite(na...
test/integration/react-18-invalid-config/index.test.js
@@ -2,19 +2,47 @@ import fs from 'fs-extra' import { join } from 'path' -import { File, nextBuild } from 'next-test-utils' +import { + File, + nextBuild, + runDevSuite, + runProdSuite, + fetchViaHTTP, +} from 'next-test-utils' const appDir = __dirname const nodeArgs = ['-r', join(appDir, '../../lib/react-1...
true
Other
vercel
next.js
de0bc57b6e522395d62076eb60b6b6c92488be2e.json
test: organize react 18 tests (#36003) * Organize react 18 test cases, group invalid cases to speed up the regular test cases * Add `runDevSuite` and `runProdSuite` for group next dev/prod test cases ```js runDevSuite(name, appDir, { runTests: (context, env) => { ... }, beforeAll, afterAll, }) runProdvSuite(na...
test/integration/react-18/test/index.test.js
@@ -7,27 +7,23 @@ import { findPort, killApp, launchApp, - nextBuild, - nextStart, renderViaHTTP, hasRedbox, getRedboxHeader, + runDevSuite, + runProdSuite, } from 'next-test-utils' import concurrent from './concurrent' import basics from './basics' import strictMode from './strict-mode' impo...
true
Other
vercel
next.js
de0bc57b6e522395d62076eb60b6b6c92488be2e.json
test: organize react 18 tests (#36003) * Organize react 18 test cases, group invalid cases to speed up the regular test cases * Add `runDevSuite` and `runProdSuite` for group next dev/prod test cases ```js runDevSuite(name, appDir, { runTests: (context, env) => { ... }, beforeAll, afterAll, }) runProdvSuite(na...
test/integration/react-streaming-and-server-components/test/functions.js
@@ -10,20 +10,23 @@ import { nextBuild } from './utils' export default function (context) { it('should not generate functions manifest when filesystem API is not enabled', async () => { // Make sure there is no existing functions manifest (caused by failed tests etc). - await fs.remove(join(context.appDir, ...
true
Other
vercel
next.js
de0bc57b6e522395d62076eb60b6b6c92488be2e.json
test: organize react 18 tests (#36003) * Organize react 18 test cases, group invalid cases to speed up the regular test cases * Add `runDevSuite` and `runProdSuite` for group next dev/prod test cases ```js runDevSuite(name, appDir, { runTests: (context, env) => { ... }, beforeAll, afterAll, }) runProdvSuite(na...
test/integration/react-streaming-and-server-components/test/index.test.js
@@ -3,16 +3,17 @@ import { join } from 'path' import fs from 'fs-extra' -import { fetchViaHTTP, findPort, killApp, renderViaHTTP } from 'next-test-utils' - import { + fetchViaHTTP, + renderViaHTTP, nextBuild, - nextStart, - nextDev, + runDevSuite, + runProdSuite, +} from 'next-test-utils' + +import { a...
true
Other
vercel
next.js
de0bc57b6e522395d62076eb60b6b6c92488be2e.json
test: organize react 18 tests (#36003) * Organize react 18 test cases, group invalid cases to speed up the regular test cases * Add `runDevSuite` and `runProdSuite` for group next dev/prod test cases ```js runDevSuite(name, appDir, { runTests: (context, env) => { ... }, beforeAll, afterAll, }) runProdvSuite(na...
test/integration/react-streaming-and-server-components/test/rsc.js
@@ -3,9 +3,10 @@ import webdriver from 'next-webdriver' import { renderViaHTTP, check } from 'next-test-utils' import { join } from 'path' import fs from 'fs-extra' -import { distDir, getNodeBySelector } from './utils' +import { getNodeBySelector } from './utils' export default function (context, { runtime, env }...
true
Other
vercel
next.js
de0bc57b6e522395d62076eb60b6b6c92488be2e.json
test: organize react 18 tests (#36003) * Organize react 18 test cases, group invalid cases to speed up the regular test cases * Add `runDevSuite` and `runProdSuite` for group next dev/prod test cases ```js runDevSuite(name, appDir, { runTests: (context, env) => { ... }, beforeAll, afterAll, }) runProdvSuite(na...
test/integration/react-streaming-and-server-components/test/runtime.js
@@ -2,9 +2,9 @@ import { renderViaHTTP } from 'next-test-utils' import { join } from 'path' import fs from 'fs-extra' -import { distDir } from './utils' - export default async function runtime(context, { runtime, env }) { + const distDir = join(context.appDir, '.next') + if (runtime === 'edge') { it('shou...
true
Other
vercel
next.js
de0bc57b6e522395d62076eb60b6b6c92488be2e.json
test: organize react 18 tests (#36003) * Organize react 18 test cases, group invalid cases to speed up the regular test cases * Add `runDevSuite` and `runProdSuite` for group next dev/prod test cases ```js runDevSuite(name, appDir, { runTests: (context, env) => { ... }, beforeAll, afterAll, }) runProdvSuite(na...
test/integration/react-streaming-and-server-components/test/switchable-runtime.test.js
@@ -5,10 +5,12 @@ import { check, findPort, killApp, + launchApp, + nextBuild, + nextStart, renderViaHTTP, waitFor, } from 'next-test-utils' -import { nextBuild, nextDev, nextStart } from './utils' const appDir = join(__dirname, '../switchable-runtime') @@ -48,7 +50,10 @@ describe('Switchable ru...
true
Other
vercel
next.js
de0bc57b6e522395d62076eb60b6b6c92488be2e.json
test: organize react 18 tests (#36003) * Organize react 18 test cases, group invalid cases to speed up the regular test cases * Add `runDevSuite` and `runProdSuite` for group next dev/prod test cases ```js runDevSuite(name, appDir, { runTests: (context, env) => { ... }, beforeAll, afterAll, }) runProdvSuite(na...
test/integration/react-streaming-and-server-components/test/utils.js
@@ -1,51 +1,17 @@ import { join } from 'path' -import { - File, - launchApp, - nextBuild as _nextBuild, - nextStart as _nextStart, -} from 'next-test-utils' +import { File } from 'next-test-utils' import cheerio from 'cheerio' -const nodeArgs = [] - export const appDir = join(__dirname, '../app') export const...
true
Other
vercel
next.js
de0bc57b6e522395d62076eb60b6b6c92488be2e.json
test: organize react 18 tests (#36003) * Organize react 18 test cases, group invalid cases to speed up the regular test cases * Add `runDevSuite` and `runProdSuite` for group next dev/prod test cases ```js runDevSuite(name, appDir, { runTests: (context, env) => { ... }, beforeAll, afterAll, }) runProdvSuite(na...
test/lib/next-test-utils.js
@@ -722,3 +722,67 @@ export function readNextBuildServerPageFile(appDir, page) { const pageFile = getPageFileFromPagesManifest(appDir, page) return readFileSync(path.join(appDir, '.next', 'server', pageFile), 'utf8') } + +/** + * + * @param {string} suiteName + * @param {{env: 'prod' | 'dev', appDir: string}} co...
true
Other
vercel
next.js
d8623bb90f39b10e95a4f572e6eacb1e278538c6.json
Use eager import to include client modules (#35979) Eager import does almost the same thing as `require()` but it instead also supports loading an ES module. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Featu...
packages/next/build/webpack/loaders/next-flight-server-loader.ts
@@ -238,7 +238,12 @@ export default async function transformSource( __webpack_require__, _: () => { ${imports - .map((importSource) => `require('${importSource}');`) + .map( + (importSource) => + `import(/* webpackMode: "eager" */ ${JSON.stringify( + ...
false
Other
vercel
next.js
049bb22c1c91f1928d31aa1fd2f4e939a71e0a48.json
Update polyfill of web streams (#35571) * attach pipeTo and pipeThrough polyfills to instance * remove transformer polyfill * remove polyfill * fix missing polyfill in sandbox * always polyfill the runtime * always polyfill web streams in renderer * fix missing AbortController and AbortSignal * ty...
packages/next/server/next-server.ts
@@ -1,4 +1,6 @@ import './node-polyfill-fetch' +import './node-polyfill-web-streams' + import type { Params, Route } from './router' import type { CacheFs } from '../shared/lib/utils' import type { MiddlewareManifest } from '../build/webpack/plugins/middleware-plugin' @@ -10,19 +12,15 @@ import type { Rewrite } fro...
true
Other
vercel
next.js
049bb22c1c91f1928d31aa1fd2f4e939a71e0a48.json
Update polyfill of web streams (#35571) * attach pipeTo and pipeThrough polyfills to instance * remove transformer polyfill * remove polyfill * fix missing polyfill in sandbox * always polyfill the runtime * always polyfill web streams in renderer * fix missing AbortController and AbortSignal * ty...
packages/next/server/node-polyfill-web-streams.js
@@ -1,8 +1,12 @@ -import { TransformStream } from 'next/dist/compiled/web-streams-polyfill' -import { ReadableStream } from './web/sandbox/readable-stream' +import { + ReadableStream, + TransformStream, +} from 'next/dist/compiled/web-streams-polyfill' -// Polyfill Web Streams in the Node.js environment +// Polyfil...
true
Other
vercel
next.js
049bb22c1c91f1928d31aa1fd2f4e939a71e0a48.json
Update polyfill of web streams (#35571) * attach pipeTo and pipeThrough polyfills to instance * remove transformer polyfill * remove polyfill * fix missing polyfill in sandbox * always polyfill the runtime * always polyfill web streams in renderer * fix missing AbortController and AbortSignal * ty...
packages/next/server/node-web-streams-helper.ts
@@ -24,43 +24,6 @@ export function readableStreamTee<T = any>( return [transformStream.readable, transformStream2.readable] } -export function pipeTo<T>( - readable: ReadableStream<T>, - writable: WritableStream<T>, - options?: { preventClose: boolean } -) { - let resolver: () => void - const promise = new P...
true
Other
vercel
next.js
049bb22c1c91f1928d31aa1fd2f4e939a71e0a48.json
Update polyfill of web streams (#35571) * attach pipeTo and pipeThrough polyfills to instance * remove transformer polyfill * remove polyfill * fix missing polyfill in sandbox * always polyfill the runtime * always polyfill web streams in renderer * fix missing AbortController and AbortSignal * ty...
packages/next/server/render.tsx
@@ -68,7 +68,6 @@ import { readableStreamTee, encodeText, decodeText, - pipeThrough, streamFromArray, streamToString, chainStreams, @@ -1225,16 +1224,13 @@ export async function renderToHTML( if (renderServerComponentData) { return new RenderResult( - pipeThrough( - renderToRead...
true
Other
vercel
next.js
049bb22c1c91f1928d31aa1fd2f4e939a71e0a48.json
Update polyfill of web streams (#35571) * attach pipeTo and pipeThrough polyfills to instance * remove transformer polyfill * remove polyfill * fix missing polyfill in sandbox * always polyfill the runtime * always polyfill web streams in renderer * fix missing AbortController and AbortSignal * ty...
packages/next/server/web/sandbox/context.ts
@@ -2,7 +2,7 @@ import type { Context } from 'vm' import { Blob, File, FormData } from 'next/dist/compiled/formdata-node' import { readFileSync, promises as fs } from 'fs' import { requireDependencies } from './require' -import { TransformStream } from 'next/dist/compiled/web-streams-polyfill' +import '../../node-po...
true
Other
vercel
next.js
049bb22c1c91f1928d31aa1fd2f4e939a71e0a48.json
Update polyfill of web streams (#35571) * attach pipeTo and pipeThrough polyfills to instance * remove transformer polyfill * remove polyfill * fix missing polyfill in sandbox * always polyfill the runtime * always polyfill web streams in renderer * fix missing AbortController and AbortSignal * ty...
packages/next/server/web/sandbox/polyfills.ts
@@ -2,7 +2,6 @@ import { Crypto as WebCrypto } from 'next/dist/compiled/@peculiar/webcrypto' import { CryptoKey } from 'next/dist/compiled/@peculiar/webcrypto' import { v4 as uuid } from 'next/dist/compiled/uuid' import processPolyfill from 'next/dist/compiled/process' -import { ReadableStream } from './readable-str...
true
Other
vercel
next.js
049bb22c1c91f1928d31aa1fd2f4e939a71e0a48.json
Update polyfill of web streams (#35571) * attach pipeTo and pipeThrough polyfills to instance * remove transformer polyfill * remove polyfill * fix missing polyfill in sandbox * always polyfill the runtime * always polyfill web streams in renderer * fix missing AbortController and AbortSignal * ty...
packages/next/server/web/sandbox/readable-stream.ts
@@ -1,81 +0,0 @@ -class ReadableStream<T> { - constructor(opts: UnderlyingSource = {}) { - let closed = false - let pullPromise: any - - let transformController: TransformStreamDefaultController - const { readable, writable } = new TransformStream( - { - start: (controller: TransformStreamDefau...
true
Other
vercel
next.js
633050402f8706cb06c1874338ab9d5e6aec1107.json
fix: add locale prefix to middleware preflight url (#35911) Fixes part of https://github.com/vercel/next.js/issues/34274 Navigating to `/` causes to redirect preflight request to a url of browser language like `/en`. This PR fixes to add the locale prefix always so that the redirect does not happen anymore and middl...
packages/next/shared/lib/router/router.ts
@@ -1897,10 +1897,12 @@ export default class Router implements BaseRouter { return { type: 'next' } } + const preflightHref = addLocale(options.as, options.locale) + let preflight: PreflightData | undefined try { preflight = await this._getPreflightData({ - preflightHref: option...
true
Other
vercel
next.js
633050402f8706cb06c1874338ab9d5e6aec1107.json
fix: add locale prefix to middleware preflight url (#35911) Fixes part of https://github.com/vercel/next.js/issues/34274 Navigating to `/` causes to redirect preflight request to a url of browser language like `/en`. This PR fixes to add the locale prefix always so that the redirect does not happen anymore and middl...
test/integration/middleware/with-i18n-preflight/next.config.js
@@ -0,0 +1,6 @@ +module.exports = { + i18n: { + locales: ['ja', 'en', 'fr'], + defaultLocale: 'ja', + }, +}
true
Other
vercel
next.js
633050402f8706cb06c1874338ab9d5e6aec1107.json
fix: add locale prefix to middleware preflight url (#35911) Fixes part of https://github.com/vercel/next.js/issues/34274 Navigating to `/` causes to redirect preflight request to a url of browser language like `/en`. This PR fixes to add the locale prefix always so that the redirect does not happen anymore and middl...
test/integration/middleware/with-i18n-preflight/pages/_middleware.js
@@ -0,0 +1,7 @@ +import { NextResponse } from 'next/server' + +export function middleware(req) { + const url = req.nextUrl.clone() + url.searchParams.set('locale', url.locale) + return NextResponse.rewrite(url) +}
true
Other
vercel
next.js
633050402f8706cb06c1874338ab9d5e6aec1107.json
fix: add locale prefix to middleware preflight url (#35911) Fixes part of https://github.com/vercel/next.js/issues/34274 Navigating to `/` causes to redirect preflight request to a url of browser language like `/en`. This PR fixes to add the locale prefix always so that the redirect does not happen anymore and middl...
test/integration/middleware/with-i18n-preflight/pages/index.js
@@ -0,0 +1,40 @@ +import Link from 'next/link' + +export default function Home({ locale }) { + return ( + <div> + <div className={locale}>{locale}</div> + <ul> + <li> + <Link href="/" locale="en"> + <a id="link-en">Go to en</a> + </Link> + </li> + <li> + ...
true
Other
vercel
next.js
633050402f8706cb06c1874338ab9d5e6aec1107.json
fix: add locale prefix to middleware preflight url (#35911) Fixes part of https://github.com/vercel/next.js/issues/34274 Navigating to `/` causes to redirect preflight request to a url of browser language like `/en`. This PR fixes to add the locale prefix always so that the redirect does not happen anymore and middl...
test/integration/middleware/with-i18n-preflight/test/index.test.js
@@ -0,0 +1,69 @@ +/* eslint-env jest */ + +import { join } from 'path' +import webdriver, { USE_SELENIUM } from 'next-webdriver' +import { + findPort, + killApp, + launchApp, + nextBuild, + nextStart, +} from 'next-test-utils' + +jest.setTimeout(1000 * 60 * 2) + +const context = {} +context.appDir = join(__dirname...
true
Other
vercel
next.js
633050402f8706cb06c1874338ab9d5e6aec1107.json
fix: add locale prefix to middleware preflight url (#35911) Fixes part of https://github.com/vercel/next.js/issues/34274 Navigating to `/` causes to redirect preflight request to a url of browser language like `/en`. This PR fixes to add the locale prefix always so that the redirect does not happen anymore and middl...
test/lib/browsers/base.ts
@@ -18,7 +18,7 @@ export class BrowserInterface { return this } - async setup(browserName: string): Promise<void> {} + async setup(browserName: string, locale?: string): Promise<void> {} async close(): Promise<void> {} async quit(): Promise<void> {}
true
Other
vercel
next.js
633050402f8706cb06c1874338ab9d5e6aec1107.json
fix: add locale prefix to middleware preflight url (#35911) Fixes part of https://github.com/vercel/next.js/issues/34274 Navigating to `/` causes to redirect preflight request to a url of browser language like `/en`. This PR fixes to add the locale prefix always so that the redirect does not happen anymore and middl...
test/lib/browsers/playwright.ts
@@ -46,7 +46,7 @@ class Playwright extends BrowserInterface { this.eventCallbacks[event]?.delete(cb) } - async setup(browserName: string) { + async setup(browserName: string, locale?: string) { if (browser) return const headless = !!process.env.HEADLESS @@ -57,7 +57,7 @@ class Playwright extends...
true
Other
vercel
next.js
633050402f8706cb06c1874338ab9d5e6aec1107.json
fix: add locale prefix to middleware preflight url (#35911) Fixes part of https://github.com/vercel/next.js/issues/34274 Navigating to `/` causes to redirect preflight request to a url of browser language like `/en`. This PR fixes to add the locale prefix always so that the redirect does not happen anymore and middl...
test/lib/browsers/selenium.ts
@@ -45,7 +45,8 @@ export async function quit() { class Selenium extends BrowserInterface { private browserName: string - async setup(browserName: string) { + // TODO: support setting locale + async setup(browserName: string, locale?: string) { if (browser) return this.browserName = browserName
true
Other
vercel
next.js
633050402f8706cb06c1874338ab9d5e6aec1107.json
fix: add locale prefix to middleware preflight url (#35911) Fixes part of https://github.com/vercel/next.js/issues/34274 Navigating to `/` causes to redirect preflight request to a url of browser language like `/en`. This PR fixes to add the locale prefix always so that the redirect does not happen anymore and middl...
test/lib/next-webdriver.ts
@@ -36,6 +36,12 @@ if (typeof afterAll === 'function') { }) } +export const USE_SELENIUM = Boolean( + process.env.LEGACY_SAFARI || + process.env.BROWSER_NAME === 'internet explorer' || + process.env.SKIP_LOCAL_SELENIUM_SERVER +) + /** * * @param appPort can either be the port or the full URL @@ -54,6 ...
true
Other
vercel
next.js
ad997344893403948a70edb47b0d056658458e39.json
Fix flaky test (#35951) Failed here: https://github.com/vercel/next.js/runs/5855144575?check_suite_focus=true#step:9:1795 ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing fea...
test/integration/react-streaming-and-server-components/test/rsc.js
@@ -109,13 +109,15 @@ export default function (context, { runtime, env }) { expect(content).toContain('component:index.server') await browser.waitForElementByCss('#goto-streaming-rsc').click() - await new Promise((res) => setTimeout(res, 1500)) + + // Wait for navigation and streaming to finish. + ...
false
Other
vercel
next.js
9959d7ef32bb74ec9467df86c598d0a365942d48.json
Use babel 7 jsx syntax (#17043) For some reason babel-plugin-syntax-jsx of babel 6 was used instead of babel 7 version.
packages/next/build/babel/plugins/jsx-pragma.ts
@@ -1,12 +1,13 @@ import { NodePath, PluginObj, types as BabelTypes } from '@babel/core' +import jsx from '@babel/plugin-syntax-jsx' export default function ({ types: t, }: { types: typeof BabelTypes }): PluginObj<any> { return { - inherits: require('babel-plugin-syntax-jsx'), + inherits: jsx, ...
true
Other
vercel
next.js
9959d7ef32bb74ec9467df86c598d0a365942d48.json
Use babel 7 jsx syntax (#17043) For some reason babel-plugin-syntax-jsx of babel 6 was used instead of babel 7 version.
packages/next/package.json
@@ -67,6 +67,7 @@ "@babel/plugin-proposal-object-rest-spread": "7.11.0", "@babel/plugin-syntax-bigint": "7.8.3", "@babel/plugin-syntax-dynamic-import": "7.8.3", + "@babel/plugin-syntax-jsx": "7.10.4", "@babel/plugin-transform-modules-commonjs": "7.10.4", "@babel/plugin-transform-runtime": "7...
true
Other
vercel
next.js
9959d7ef32bb74ec9467df86c598d0a365942d48.json
Use babel 7 jsx syntax (#17043) For some reason babel-plugin-syntax-jsx of babel 6 was used instead of babel 7 version.
packages/next/types/misc.d.ts
@@ -1,5 +1,6 @@ /* eslint-disable import/no-extraneous-dependencies */ declare module '@babel/plugin-transform-modules-commonjs' +declare module '@babel/plugin-syntax-jsx' declare module 'browserslist' declare module 'cssnano-simple' { import { Plugin } from 'postcss'
true
Other
vercel
next.js
9959d7ef32bb74ec9467df86c598d0a365942d48.json
Use babel 7 jsx syntax (#17043) For some reason babel-plugin-syntax-jsx of babel 6 was used instead of babel 7 version.
yarn.lock
@@ -766,19 +766,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-jsx@^7.10.4": +"@babel/plugin-syntax-jsx@7.10.4", "@babel/plugin-syntax-jsx@^7.10.4", "@babel/plugin-syntax-jsx@^7.2.0": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plu...
true
Other
vercel
next.js
79f060eeba9a55ad7fd6542319a6b1738e8028dc.json
Update workflow to use latest webpack 5 beta
.github/workflows/build_test_deploy.yml
@@ -107,7 +107,7 @@ jobs: steps: - uses: actions/checkout@v2 - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - - run: cat package.json | jq '.resolutions.webpack = "^5.0.0-beta.22"' > package.json.tmp && mv package.json.tmp package.json + - run: cat package.json | jq '.resolution...
false
Other
vercel
next.js
d4a8d4fc880e94101c260d703570e603ae92beee.json
fix gtag syntax in measuring docs (#16933)
docs/advanced-features/measuring-performance.md
@@ -160,13 +160,12 @@ export function reportWebVitals(metric) { > export function reportWebVitals({ id, name, label, value }) { > // Use `window.gtag` if you initialized Google Analytics as this example: > // https://github.com/vercel/next.js/blob/canary/examples/with-google-analytics/pages/_document.js -> win...
false
Other
vercel
next.js
f786ccdbb9ace80a3d0bfe738d8575d42a2f7ad2.json
Upgrade cacache of terser-webpack-plugin (#17022) Ref https://github.com/webpack-contrib/terser-webpack-plugin/blob/v4.1.0/package.json#L44 cacache is a dependency of terser-webpack-plugin. The latest version depends on cacache 15 while next adds cacache 13. This may give unexpected results. Better keep it in sync wi...
packages/next/package.json
@@ -83,7 +83,7 @@ "babel-plugin-transform-react-remove-prop-types": "0.4.24", "browserslist": "4.13.0", "buffer": "5.6.0", - "cacache": "13.0.1", + "cacache": "15.0.5", "caniuse-lite": "^1.0.30001113", "chokidar": "2.1.8", "crypto-browserify": "3.12.0",
true
Other
vercel
next.js
f786ccdbb9ace80a3d0bfe738d8575d42a2f7ad2.json
Upgrade cacache of terser-webpack-plugin (#17022) Ref https://github.com/webpack-contrib/terser-webpack-plugin/blob/v4.1.0/package.json#L44 cacache is a dependency of terser-webpack-plugin. The latest version depends on cacache 15 while next adds cacache 13. This may give unexpected results. Better keep it in sync wi...
yarn.lock
@@ -4701,27 +4701,27 @@ bytes@3.1.0, bytes@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" -cacache@13.0.1: - version "13.0.1" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-13.0.1.tgz#a8000c21697089082f85287a1aec6e38...
true
Other
vercel
next.js
47d983f71f90a4c3fccd43479505b0270f7fb258.json
Add error when href interpolation fails (#16946) This adds an error when interpolation fails to make sure invalid `href`s aren't accidentally used and an invalid URL is built. Closes: https://github.com/vercel/next.js/issues/16944
errors/href-interpolation-failed.md
@@ -0,0 +1,54 @@ +# `href` Interpolation Failed + +#### Why This Error Occurred + +Somewhere you are utilizing the `next/link` component, `Router#push`, or `Router#replace` with `href` interpolation to build dynamic routes but did not provide all of the needed dynamic route params to properly interpolate the `href`. + ...
true
Other
vercel
next.js
47d983f71f90a4c3fccd43479505b0270f7fb258.json
Add error when href interpolation fails (#16946) This adds an error when interpolation fails to make sure invalid `href`s aren't accidentally used and an invalid URL is built. Closes: https://github.com/vercel/next.js/issues/16944
packages/next/next-server/lib/router/router.ts
@@ -178,11 +178,14 @@ export function resolveHref( finalUrl.pathname, query ) - interpolatedAs = formatWithValidation({ - pathname: result, - hash: finalUrl.hash, - query: omitParmsFromQuery(query, params), - }) + + if (result) { + interpolatedAs = for...
true
Other
vercel
next.js
47d983f71f90a4c3fccd43479505b0270f7fb258.json
Add error when href interpolation fails (#16946) This adds an error when interpolation fails to make sure invalid `href`s aren't accidentally used and an invalid URL is built. Closes: https://github.com/vercel/next.js/issues/16944
test/integration/build-output/test/index.test.js
@@ -95,13 +95,13 @@ describe('Build Output', () => { expect(indexSize.endsWith('B')).toBe(true) // should be no bigger than 60.2 kb - expect(parseFloat(indexFirstLoad) - 60.4).toBeLessThanOrEqual(0) + expect(parseFloat(indexFirstLoad) - 60.5).toBeLessThanOrEqual(0) expect(indexFirstLoad...
true
Other
vercel
next.js
47d983f71f90a4c3fccd43479505b0270f7fb258.json
Add error when href interpolation fails (#16946) This adds an error when interpolation fails to make sure invalid `href`s aren't accidentally used and an invalid URL is built. Closes: https://github.com/vercel/next.js/issues/16944
test/integration/dynamic-routing/pages/index.js
@@ -31,6 +31,17 @@ const Page = () => { <a id="view-post-1-interpolated">View post 1 (interpolated)</a> </Link> <br /> + <Link + href={{ + pathname: '/[name]', + query: { another: 'value' }, + }} + > + <a id="view-post-1-interpolated-incorrectly"> ...
true
Other
vercel
next.js
47d983f71f90a4c3fccd43479505b0270f7fb258.json
Add error when href interpolation fails (#16946) This adds an error when interpolation fails to make sure invalid `href`s aren't accidentally used and an invalid URL is built. Closes: https://github.com/vercel/next.js/issues/16944
test/integration/dynamic-routing/test/index.test.js
@@ -15,6 +15,8 @@ import { nextStart, normalizeRegEx, check, + hasRedbox, + getRedboxHeader, } from 'next-test-utils' import cheerio from 'cheerio' import escapeRegex from 'escape-string-regexp' @@ -788,6 +790,18 @@ function runTests(dev) { expect(text).toBe('slug: first') }) + it('should...
true
Other
vercel
next.js
25cdaab2972c6f27ed453e53674be0a48681f76a.json
Add Support for CSS Module Value Imports (#16973) Fixes #10142 Fixes #11629
packages/next/build/webpack/config/blocks/css/loaders/global.ts
@@ -24,7 +24,12 @@ export function getGlobalCssLoader( // Resolve CSS `@import`s and `url()`s loaders.push({ loader: require.resolve('css-loader'), - options: { importLoaders: 1 + preProcessors.length, sourceMap: true }, + options: { + importLoaders: 1 + preProcessors.length, + sourceMap: tru...
true
Other
vercel
next.js
25cdaab2972c6f27ed453e53674be0a48681f76a.json
Add Support for CSS Module Value Imports (#16973) Fixes #10142 Fixes #11629
packages/next/build/webpack/config/blocks/css/loaders/modules.ts
@@ -28,8 +28,13 @@ export function getCssModuleLoader( options: { importLoaders: 1 + preProcessors.length, sourceMap: true, - onlyLocals: ctx.isServer, + // Use CJS mode for backwards compatibility: + esModule: false, modules: { + // Do not transform class names (CJS mode...
true
Other
vercel
next.js
25cdaab2972c6f27ed453e53674be0a48681f76a.json
Add Support for CSS Module Value Imports (#16973) Fixes #10142 Fixes #11629
packages/next/package.json
@@ -89,7 +89,7 @@ "caniuse-lite": "^1.0.30001113", "chokidar": "2.1.8", "crypto-browserify": "3.12.0", - "css-loader": "3.5.3", + "css-loader": "4.3.0", "cssnano-simple": "1.2.0", "find-cache-dir": "3.3.1", "jest-worker": "24.9.0",
true
Other
vercel
next.js
25cdaab2972c6f27ed453e53674be0a48681f76a.json
Add Support for CSS Module Value Imports (#16973) Fixes #10142 Fixes #11629
test/acceptance/ReactRefreshLogBox.test.js
@@ -829,7 +829,7 @@ test('css syntax errors', async () => { Syntax error: Selector \\"button\\" is not pure (pure selectors must contain at least one local class or id) > 1 | button {} - | ^" + | ^" `) await cleanup()
true
Other
vercel
next.js
25cdaab2972c6f27ed453e53674be0a48681f76a.json
Add Support for CSS Module Value Imports (#16973) Fixes #10142 Fixes #11629
test/integration/css-features/fixtures/module-import-exports/package.json
@@ -0,0 +1,5 @@ +{ + "browserslist": [ + "last 1 chrome version" + ] +}
true
Other
vercel
next.js
25cdaab2972c6f27ed453e53674be0a48681f76a.json
Add Support for CSS Module Value Imports (#16973) Fixes #10142 Fixes #11629
test/integration/css-features/fixtures/module-import-exports/pages/colors.module.css
@@ -0,0 +1,4 @@ +:export { + w1: #ffffff; + b1: #000000; +}
true
Other
vercel
next.js
25cdaab2972c6f27ed453e53674be0a48681f76a.json
Add Support for CSS Module Value Imports (#16973) Fixes #10142 Fixes #11629
test/integration/css-features/fixtures/module-import-exports/pages/index.js
@@ -0,0 +1,5 @@ +import styles from './styles.module.css' + +export default function () { + return <div>{JSON.stringify(styles)}</div> +}
true
Other
vercel
next.js
25cdaab2972c6f27ed453e53674be0a48681f76a.json
Add Support for CSS Module Value Imports (#16973) Fixes #10142 Fixes #11629
test/integration/css-features/fixtures/module-import-exports/pages/styles.module.css
@@ -0,0 +1,5 @@ +@value b1 from "./colors.module.css"; + +.blk { + color: b1; +}
true
Other
vercel
next.js
25cdaab2972c6f27ed453e53674be0a48681f76a.json
Add Support for CSS Module Value Imports (#16973) Fixes #10142 Fixes #11629
test/integration/css-features/test/index.test.js
@@ -221,3 +221,35 @@ describe('CSS Modules: Importing Invalid Global CSS', () => { expect(stderr).toContain('Selector "a" is not pure') }) }) + +describe('CSS Modules: Import Exports', () => { + const appDir = join(fixturesDir, 'module-import-exports') + + let stdout + let code + beforeAll(async () => { + ...
true
Other
vercel
next.js
25cdaab2972c6f27ed453e53674be0a48681f76a.json
Add Support for CSS Module Value Imports (#16973) Fixes #10142 Fixes #11629
test/integration/css-modules/test/index.test.js
@@ -379,7 +379,7 @@ describe('Valid Nested CSS Module Usage from within node_modules', () => { const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8') expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot( - `".other3_other3__1f9h7{color:violet}.other_className__bt...
true
Other
vercel
next.js
25cdaab2972c6f27ed453e53674be0a48681f76a.json
Add Support for CSS Module Value Imports (#16973) Fixes #10142 Fixes #11629
test/integration/css/test/index.test.js
@@ -737,7 +737,7 @@ describe('CSS Support', () => { }) }) - describe('Bad CSS Import from node_modules', () => { + describe('CSS Import from node_modules', () => { const appDir = join(fixturesDir, 'npm-import-bad') beforeAll(async () => { @@ -747,9 +747,9 @@ describe('CSS Support', () => { ...
true
Other
vercel
next.js
25cdaab2972c6f27ed453e53674be0a48681f76a.json
Add Support for CSS Module Value Imports (#16973) Fixes #10142 Fixes #11629
test/integration/scss/test/index.test.js
@@ -809,7 +809,7 @@ describe('SCSS Support', () => { }) }) - describe('Bad CSS Import from node_modules', () => { + describe('CSS Import from node_modules', () => { const appDir = join(fixturesDir, 'npm-import-bad') beforeAll(async () => { @@ -819,9 +819,9 @@ describe('SCSS Support', () => { ...
true
Other
vercel
next.js
25cdaab2972c6f27ed453e53674be0a48681f76a.json
Add Support for CSS Module Value Imports (#16973) Fixes #10142 Fixes #11629
yarn.lock
@@ -3202,6 +3202,11 @@ version "7.0.4" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339" +"@types/json-schema@^7.0.5": + version "7.0.6" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.6.tgz#f4c7ec43e81b319...
true
Other
vercel
next.js
99998f0b49b8ff96596341b8d722959b28e66a82.json
Ignore .next also in subfolders (#16962) As the example is about Yarn workspaces, it should gitignore `.next` recursively.
examples/with-yarn-workspaces/.gitignore
@@ -9,8 +9,7 @@ /coverage # next.js -/.next/ -/out/ +.next/ # production /build
false
Other
vercel
next.js
4ba3607dcbb6ad88a9ee6935504f2dadc91dd0de.json
Fix typo in Pet mongoose model (#16943) s/applicale/applicable/
examples/with-mongodb-mongoose/models/Pet.js
@@ -34,7 +34,7 @@ const PetSchema = new mongoose.Schema({ type: Boolean, }, diet: { - /* List of dietary needs, if applicale */ + /* List of dietary needs, if applicable */ type: Array, },
false
Other
vercel
next.js
b22769194262a700728be9b912cce2f63383bca0.json
Fix align documentation with the code (#16843)
docs/basic-features/data-fetching.md
@@ -52,7 +52,7 @@ export async function getStaticProps(context) { The `context` parameter is an object containing the following keys: - `params` contains the route parameters for pages using dynamic routes. For example, if the page name is `[id].js` , then `params` will look like `{ id: ... }`. To learn more, take ...
false
Other
vercel
next.js
08859275ae8295ee29214f7c26138b3fee76bbcb.json
Add tests for searchParams dev warning (#16798) Fixes a warning being logged to the console when using `href` with a dynamic path. Fixes #16794
test/integration/dynamic-routing/pages/d/[id].js
@@ -0,0 +1,9 @@ +import { useRouter } from 'next/router' + +const Page = () => { + const router = useRouter() + const { query } = router + return <p id="asdf">This is {query.id}</p> +} + +export default Page
true
Other
vercel
next.js
08859275ae8295ee29214f7c26138b3fee76bbcb.json
Add tests for searchParams dev warning (#16798) Fixes a warning being logged to the console when using `href` with a dynamic path. Fixes #16794
test/integration/dynamic-routing/pages/index.js
@@ -1,6 +1,15 @@ import Link from 'next/link' import { useRouter } from 'next/router' +if (typeof window !== 'undefined') { + window.caughtWarns = [] + const origWarn = window.console.warn + window.console.warn = function (...args) { + window.caughtWarns.push(args) + origWarn(...args) + } +} + const Page...
true
Other
vercel
next.js
08859275ae8295ee29214f7c26138b3fee76bbcb.json
Add tests for searchParams dev warning (#16798) Fixes a warning being logged to the console when using `href` with a dynamic path. Fixes #16794
test/integration/dynamic-routing/test/index.test.js
@@ -84,6 +84,31 @@ function runTests(dev) { expect(url).toBe('?fromHome=true') }) + if (dev) { + it('should not have any console warnings on initial load', async () => { + const browser = await webdriver(appPort, '/') + expect(await browser.eval('window.caughtWarns')).toEqual([]) + }) + + ...
true
Other
vercel
next.js
0e48ea3938a6d57bc85c2d903f8401d147bfc4f6.json
Convert next/client to TypeScript (#16167) Fixes #16166
packages/next/client/index.tsx
@@ -1,27 +1,66 @@ /* global location */ -import { createRouter, makePublicRouterInstance } from 'next/router' -import * as querystring from '../next-server/lib/router/utils/querystring' +import type { ParsedUrlQuery } from 'querystring' import React from 'react' import ReactDOM from 'react-dom' import { HeadManager...
true
Other
vercel
next.js
0e48ea3938a6d57bc85c2d903f8401d147bfc4f6.json
Convert next/client to TypeScript (#16167) Fixes #16166
packages/next/next-server/lib/router/router.ts
@@ -157,16 +157,21 @@ export type PrefetchOptions = { priority?: boolean } -type RouteInfo = { +export type PrivateRouteInfo = { Component: ComponentType __N_SSG?: boolean __N_SSP?: boolean - props?: any + props?: Record<string, any> err?: Error error?: any } -type Subscription = (data: RouteI...
true
Other
vercel
next.js
09afc376cd67357949d1e1d2ae52aeb82e654a1b.json
Convert performance relayer to TypeScript (#16161) Really basic one! Needed for `next/client`.
packages/next/client/performance-relayer.js
@@ -1,9 +0,0 @@ -import { getCLS, getFID, getFCP, getLCP, getTTFB } from 'web-vitals' - -export default (onPerfEntry) => { - getCLS(onPerfEntry) - getFID(onPerfEntry) - getFCP(onPerfEntry) - getLCP(onPerfEntry) - getTTFB(onPerfEntry) -}
true
Other
vercel
next.js
09afc376cd67357949d1e1d2ae52aeb82e654a1b.json
Convert performance relayer to TypeScript (#16161) Really basic one! Needed for `next/client`.
packages/next/client/performance-relayer.ts
@@ -0,0 +1,16 @@ +import { + getCLS, + getFCP, + getFID, + getLCP, + getTTFB, + ReportHandler, +} from 'web-vitals' + +export default (onPerfEntry: ReportHandler) => { + getCLS(onPerfEntry) + getFID(onPerfEntry) + getFCP(onPerfEntry) + getLCP(onPerfEntry) + getTTFB(onPerfEntry) +}
true
Other
vercel
next.js
5b81531676df921e272fa655d5359a2c6fe31981.json
Reduce router code (#16159) This reduces the code as suggested: https://github.com/vercel/next.js/pull/15231#discussion_r469691649. Removes these bloated Babel helpers: ```diff @@ -678,80 +678,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI var _createClass = __webpack_...
packages/next/next-server/lib/router/router.ts
@@ -831,15 +831,16 @@ export default class Router implements BaseRouter { // handle resolving href for dynamic routes if (!pages.includes(cleanPathname!)) { - for (let page of pages) { + // eslint-disable-next-line array-callback-return + pages.some((page) => { if ( isDyna...
false
Other
vercel
next.js
ff0571ae1403d162f79c6b9a84bb315c820d33e9.json
Remove unused router method (#16149) This PR removes a legacy router method that was used for old-style HMR, now replaced by Fast Refresh. This method was not public: ```tsx export type NextRouter = BaseRouter & Pick< Router, | 'push' | 'replace' | 'reload' | 'back' | 'prefetch' | 'befor...
packages/next/next-server/lib/router/router.ts
@@ -397,31 +397,6 @@ export default class Router implements BaseRouter { this.change('replaceState', url, as, options) } - update(route: string, mod: any) { - const Component: ComponentType = mod.default || mod - const data = this.components[route] - if (!data) { - throw new Error(`Cannot updat...
false
Other
vercel
next.js
e72ac7642235d37891deba08fdad31e9963f164c.json
Remove tslint disables (#16116) We no longer use tslint so these comments don't do anything.
packages/next/bin/next.ts
@@ -7,7 +7,6 @@ import { NON_STANDARD_NODE_ENV } from '../lib/constants' // When 'npm link' is used it checks the clone location. Not the project. require.resolve(dependency) } catch (err) { - // tslint:disable-next-line console.warn( `The module '${dependency}' was not found. Next.js requir...
true
Other
vercel
next.js
e72ac7642235d37891deba08fdad31e9963f164c.json
Remove tslint disables (#16116) We no longer use tslint so these comments don't do anything.
packages/next/cli/next-dev.ts
@@ -30,7 +30,6 @@ const nextDev: cliCommand = (argv) => { throw error } if (args['--help']) { - // tslint:disable-next-line console.log(` Description Starts the application in development mode (hot-code reloading, error @@ -119,10 +118,8 @@ const nextDev: cliCommand = (argv) => { ...
true
Other
vercel
next.js
e72ac7642235d37891deba08fdad31e9963f164c.json
Remove tslint disables (#16116) We no longer use tslint so these comments don't do anything.
packages/next/cli/next-export.ts
@@ -29,7 +29,6 @@ const nextExport: cliCommand = (argv) => { throw error } if (args['--help']) { - // tslint:disable-next-line console.log(` Description Exports the application for production deployment
true
Other
vercel
next.js
e72ac7642235d37891deba08fdad31e9963f164c.json
Remove tslint disables (#16116) We no longer use tslint so these comments don't do anything.
packages/next/cli/next-start.ts
@@ -29,7 +29,6 @@ const nextStart: cliCommand = (argv) => { throw error } if (args['--help']) { - // tslint:disable-next-line console.log(` Description Starts the application in production mode. @@ -53,14 +52,12 @@ const nextStart: cliCommand = (argv) => { const port = args['--port...
true
Other
vercel
next.js
e72ac7642235d37891deba08fdad31e9963f164c.json
Remove tslint disables (#16116) We no longer use tslint so these comments don't do anything.
packages/next/client/router.ts
@@ -94,9 +94,7 @@ routerEvents.forEach((event) => { try { _singletonRouter[eventField](...args) } catch (err) { - // tslint:disable-next-line:no-console console.error(`Error when running the Router event: ${eventField}`) - // tslint:disable-next-line:no-console ...
true
Other
vercel
next.js
e72ac7642235d37891deba08fdad31e9963f164c.json
Remove tslint disables (#16116) We no longer use tslint so these comments don't do anything.
packages/next/next-server/lib/mitt.ts
@@ -32,7 +32,6 @@ export default function mitt(): MittEmitter { off(type: string, handler: Handler) { if (all[type]) { - // tslint:disable-next-line:no-bitwise all[type].splice(all[type].indexOf(handler) >>> 0, 1) } },
true
Other
vercel
next.js
e72ac7642235d37891deba08fdad31e9963f164c.json
Remove tslint disables (#16116) We no longer use tslint so these comments don't do anything.
packages/next/next-server/lib/utils.ts
@@ -103,7 +103,6 @@ export type NEXT_DATA = { /** * `Next` context */ -// tslint:disable-next-line interface-name export interface NextPageContext { /** * Error object if encountered during rendering
true
Other
vercel
next.js
e72ac7642235d37891deba08fdad31e9963f164c.json
Remove tslint disables (#16116) We no longer use tslint so these comments don't do anything.
packages/next/next-server/server/get-page-files.ts
@@ -20,7 +20,6 @@ export function getPageFiles( let files = buildManifest.pages[normalizedPage] if (!files) { - // tslint:disable-next-line console.warn( `Could not find files for ${normalizedPage} in .next/build-manifest.json` )
true
Other
vercel
next.js
e72ac7642235d37891deba08fdad31e9963f164c.json
Remove tslint disables (#16116) We no longer use tslint so these comments don't do anything.
packages/next/next-server/server/next-server.ts
@@ -253,7 +253,6 @@ export default class Server { this.onErrorMiddleware({ err }) } if (this.quiet) return - // tslint:disable-next-line console.error(err) }
true
Other
vercel
next.js
e72ac7642235d37891deba08fdad31e9963f164c.json
Remove tslint disables (#16116) We no longer use tslint so these comments don't do anything.
packages/next/next-server/server/require.ts
@@ -33,7 +33,6 @@ export function getPagePath( try { page = denormalizePagePath(normalizePagePath(page)) } catch (err) { - // tslint:disable-next-line console.error(err) throw pageNotFoundError(page) }
true
Other
vercel
next.js
e72ac7642235d37891deba08fdad31e9963f164c.json
Remove tslint disables (#16116) We no longer use tslint so these comments don't do anything.
packages/next/server/lib/utils.ts
@@ -1,6 +1,5 @@ export function printAndExit(message: string, code = 1) { if (code === 0) { - // tslint:disable-next-line no-console console.log(message) } else { console.error(message)
true