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
56292234075051e8b9967c39c8a0d99eb57aa54d.json
Update examples to use React 17 (#26133) [With next 11 requiring react 17](https://nextjs.org/blog/next-11#upgrade-guide), most of the examples need to be updated, so the following snippet updated all the examples to a compatible react version. ```bash cd examples/ fd -g 'package.json' | xargs sed -r -i 's/"react": "...
examples/with-web-worker/package.json
@@ -9,8 +9,8 @@ }, "dependencies": { "next": "latest", - "react": "16.13.1", - "react-dom": "16.13.1" + "react": "^17.0.2", + "react-dom": "^17.0.2" }, "license": "MIT" }
true
Other
vercel
next.js
56292234075051e8b9967c39c8a0d99eb57aa54d.json
Update examples to use React 17 (#26133) [With next 11 requiring react 17](https://nextjs.org/blog/next-11#upgrade-guide), most of the examples need to be updated, so the following snippet updated all the examples to a compatible react version. ```bash cd examples/ fd -g 'package.json' | xargs sed -r -i 's/"react": "...
examples/with-webassembly/package.json
@@ -2,8 +2,8 @@ "name": "with-webassembly", "dependencies": { "next": "latest", - "react": "^17.0.0", - "react-dom": "^17.0.0" + "react": "^17.0.2", + "react-dom": "^17.0.2" }, "scripts": { "dev": "next",
true
Other
vercel
next.js
56292234075051e8b9967c39c8a0d99eb57aa54d.json
Update examples to use React 17 (#26133) [With next 11 requiring react 17](https://nextjs.org/blog/next-11#upgrade-guide), most of the examples need to be updated, so the following snippet updated all the examples to a compatible react version. ```bash cd examples/ fd -g 'package.json' | xargs sed -r -i 's/"react": "...
examples/with-webpack-bundle-size-analyzer/package.json
@@ -11,8 +11,8 @@ "cross-env": "^5.0.1", "faker": "^4.1.0", "next": "latest", - "react": "^16.7.0", - "react-dom": "^16.7.0", + "react": "^17.0.2", + "react-dom": "^17.0.2", "webpack-bundle-size-analyzer": "^2.7.0" }, "license": "MIT"
true
Other
vercel
next.js
56292234075051e8b9967c39c8a0d99eb57aa54d.json
Update examples to use React 17 (#26133) [With next 11 requiring react 17](https://nextjs.org/blog/next-11#upgrade-guide), most of the examples need to be updated, so the following snippet updated all the examples to a compatible react version. ```bash cd examples/ fd -g 'package.json' | xargs sed -r -i 's/"react": "...
examples/with-why-did-you-render/package.json
@@ -9,7 +9,7 @@ "dependencies": { "@welldone-software/why-did-you-render": "^6.0.5", "next": "latest", - "react": "^17.0.1", - "react-dom": "^17.0.1" + "react": "^17.0.2", + "react-dom": "^17.0.2" } }
true
Other
vercel
next.js
56292234075051e8b9967c39c8a0d99eb57aa54d.json
Update examples to use React 17 (#26133) [With next 11 requiring react 17](https://nextjs.org/blog/next-11#upgrade-guide), most of the examples need to be updated, so the following snippet updated all the examples to a compatible react version. ```bash cd examples/ fd -g 'package.json' | xargs sed -r -i 's/"react": "...
examples/with-xstate/package.json
@@ -9,8 +9,8 @@ "dependencies": { "@xstate/react": "^1.3.1", "next": "latest", - "react": "^17.0.1", - "react-dom": "^17.0.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", "xstate": "^4.17.0" }, "license": "MIT"
true
Other
vercel
next.js
56292234075051e8b9967c39c8a0d99eb57aa54d.json
Update examples to use React 17 (#26133) [With next 11 requiring react 17](https://nextjs.org/blog/next-11#upgrade-guide), most of the examples need to be updated, so the following snippet updated all the examples to a compatible react version. ```bash cd examples/ fd -g 'package.json' | xargs sed -r -i 's/"react": "...
examples/with-yarn-workspaces/packages/bar/package.json
@@ -3,6 +3,6 @@ "version": "1.0.0", "license": "ISC", "peerDependencies": { - "react": "^16.0.0" + "react": "^17.0.2" } }
true
Other
vercel
next.js
56292234075051e8b9967c39c8a0d99eb57aa54d.json
Update examples to use React 17 (#26133) [With next 11 requiring react 17](https://nextjs.org/blog/next-11#upgrade-guide), most of the examples need to be updated, so the following snippet updated all the examples to a compatible react version. ```bash cd examples/ fd -g 'package.json' | xargs sed -r -i 's/"react": "...
examples/with-yarn-workspaces/packages/web-app/package.json
@@ -9,8 +9,8 @@ "dependencies": { "next": "latest", "next-transpile-modules": "^7.3.0", - "react": "^16.8.3", - "react-dom": "^16.8.3" + "react": "^17.0.2", + "react-dom": "^17.0.2" }, "license": "ISC" }
true
Other
vercel
next.js
56292234075051e8b9967c39c8a0d99eb57aa54d.json
Update examples to use React 17 (#26133) [With next 11 requiring react 17](https://nextjs.org/blog/next-11#upgrade-guide), most of the examples need to be updated, so the following snippet updated all the examples to a compatible react version. ```bash cd examples/ fd -g 'package.json' | xargs sed -r -i 's/"react": "...
examples/with-zones/blog/package.json
@@ -8,8 +8,8 @@ }, "dependencies": { "next": "latest", - "react": "^16.13.1", - "react-dom": "^16.13.1" + "react": "^17.0.2", + "react-dom": "^17.0.2" }, "license": "MIT" }
true
Other
vercel
next.js
56292234075051e8b9967c39c8a0d99eb57aa54d.json
Update examples to use React 17 (#26133) [With next 11 requiring react 17](https://nextjs.org/blog/next-11#upgrade-guide), most of the examples need to be updated, so the following snippet updated all the examples to a compatible react version. ```bash cd examples/ fd -g 'package.json' | xargs sed -r -i 's/"react": "...
examples/with-zones/home/package.json
@@ -8,8 +8,8 @@ }, "dependencies": { "next": "latest", - "react": "^16.13.1", - "react-dom": "^16.13.1" + "react": "^17.0.2", + "react-dom": "^17.0.2" }, "license": "MIT" }
true
Other
vercel
next.js
56292234075051e8b9967c39c8a0d99eb57aa54d.json
Update examples to use React 17 (#26133) [With next 11 requiring react 17](https://nextjs.org/blog/next-11#upgrade-guide), most of the examples need to be updated, so the following snippet updated all the examples to a compatible react version. ```bash cd examples/ fd -g 'package.json' | xargs sed -r -i 's/"react": "...
examples/with-zustand/package.json
@@ -8,8 +8,8 @@ }, "dependencies": { "next": "latest", - "react": "^16.9.0", - "react-dom": "^16.9.0", + "react": "^17.0.2", + "react-dom": "^17.0.2", "zustand": "3.5.1" }, "license": "MIT"
true
Other
vercel
next.js
b0e09d28ed2300fd9af30962b6b06037adb3a0b0.json
docs: fix ignoring-eslint-url during build (#26165) ## Documentation removes dot from docs link as the terminal appends the dot to the link, which leads to 404
packages/next/lib/has-necessary-dependencies.ts
@@ -66,7 +66,7 @@ export async function hasNecessaryDependencies( const removalLintMsg = `\n\n` + (lintDuringBuild - ? `If you do not want to run ESLint during builds, disable it in next.config.js. See https://nextjs.org/docs/api-reference/next.config.js/ignoring-eslint.` + ? `If you do not want ...
false
Other
vercel
next.js
fac02d85448d5639cd30750a4bdea458c5ba19d1.json
Follow the breaking change of jest-config (#26082) ## Documentation / Examples When I create a new application using Next.js and use `jest` or `react-testing-library`, I get the following error. ``` The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/configuration#testenvir...
examples/with-typescript-eslint-jest/jest.config.js
@@ -1,5 +1,6 @@ module.exports = { roots: ['<rootDir>'], + testEnvironment: 'jsdom', moduleFileExtensions: ['ts', 'tsx', 'js', 'json', 'jsx'], testPathIgnorePatterns: ['<rootDir>[/\\\\](node_modules|.next)[/\\\\]'], transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(ts|tsx)$'],
true
Other
vercel
next.js
fac02d85448d5639cd30750a4bdea458c5ba19d1.json
Follow the breaking change of jest-config (#26082) ## Documentation / Examples When I create a new application using Next.js and use `jest` or `react-testing-library`, I get the following error. ``` The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/configuration#testenvir...
examples/with-typescript-eslint-jest/package.json
@@ -32,18 +32,18 @@ }, "devDependencies": { "@testing-library/react": "^11.2.5", - "@types/jest": "^26.0.20", + "@types/jest": "^26.0.23", "@types/node": "^14.14.25", "@types/react": "^17.0.1", "@typescript-eslint/eslint-plugin": "^4.14.2", "@typescript-eslint/parser": "^4.14.2", - ...
true
Other
vercel
next.js
70242cf4ed1495c4c93ab2aa9d8efb7033ff9345.json
Fix failing Runner import (#26172) Bad casing causing failed import
packages/next-codemod/lib/run-jscodeshift.ts
@@ -1,5 +1,5 @@ // @ts-ignore internal module -import Runner from 'jscodeshift/src/runner' +import Runner from 'jscodeshift/src/Runner' export default function runJscodeshift( transformerPath: string,
false
Other
vercel
next.js
7c8b504252f94079f39304f5023818e84b7cff7e.json
add missing step of installing next@latest (#26141) - Step for installing the latest next version was missing - Turned "Upgrade React version to latest" to an h3 heading ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added ## Feature - [ ] Implements an existing feature request ...
docs/upgrading.md
@@ -6,7 +6,7 @@ description: Learn how to upgrade Next.js. ## Upgrading from version 10 to 11 -## Upgrade React version to latest +### Upgrade React version to latest Most applications already use the latest version of React, with Next.js 11 the minimum React version has been updated to 17.0.2. @@ -22,6 +22,2...
false
Other
vercel
next.js
6bd68bdb9f2f2bd4ba9b32c9b248356e399bb600.json
docs(image): fix image import path (#26142)
docs/api-reference/next/image.md
@@ -40,7 +40,7 @@ We can serve an optimized image like so: ```jsx import Image from 'next/image' -import profilePic from '../me.png' +import profilePic from '../public/me.png' function Home() { return (
false
Other
vercel
next.js
8873374963fdd116ab7a7e537c9604c7912f6a95.json
Update image documentation for static image (#25949) * Update image documentation for static image Adds documentation for static image and blurry placeholder functionality * Update docs/api-reference/next/image.md Co-authored-by: Steven <steven@ceriously.com> * Update docs/api-reference/next/image.md Co...
docs/api-reference/next/image.md
@@ -14,11 +14,12 @@ description: Enable Image Optimization with the built-in Image component. <details> <summary><b>Version History</b></summary> -| Version | Changes | -| --------- | ------------------------ | -| `v10.0.5` | `loader` prop added. | -| `v10.0.1` | `layout` prop added. | ...
false
Other
vercel
next.js
1f09a78eba85512f5f9228c8f824728050529a36.json
Fix react@next and react@experimental tests (#26088)
.github/workflows/test_react_next.yml
@@ -31,6 +31,7 @@ jobs: NEXT_TELEMETRY_DISABLED: 1 HEADLESS: true NEXT_PRIVATE_SKIP_SIZE_TESTS: true + NEXT_PRIVATE_REACT_ROOT: 1 strategy: fail-fast: false matrix:
true
Other
vercel
next.js
1f09a78eba85512f5f9228c8f824728050529a36.json
Fix react@next and react@experimental tests (#26088)
test/unit/link-warnings.test.js
@@ -3,11 +3,21 @@ */ import { act, render } from '@testing-library/react' import Link from 'next/link' +import React from 'react' +import { getPackageVersion } from 'next/dist/lib/get-package-version' +import semver from 'next/dist/compiled/semver' describe('<Link/>', () => { let spy - beforeAll(() => { + l...
true
Other
vercel
next.js
6f4d46aa2addae90c2ba8c72afd4096ec08a5dd6.json
Update safari preload test (#26086)
test/integration/production/test/index.test.js
@@ -679,8 +679,9 @@ describe('Production Usage', () => { if (browserName === 'safari') { const elements = await browser.elementsByCss('link[rel=preload]') - // 4 page preloads and 5 existing preloads for _app, commons, main, etc - expect(elements.length).toBe(5) + // optimized pre...
false
Other
vercel
next.js
2477b1379920accc3a7e9703ba056bd9cdd0f678.json
examples/with-mongodb: avoid destructuring of environment variables. (#26029) Greetings. As per the [documentation](https://nextjs.org/docs/basic-features/environment-variables), we should not treat process.env as a Javscript Object & cannot destructure variables out of it. This PR avoid destructuring of environment ...
examples/with-mongodb/util/mongodb.js
@@ -1,6 +1,7 @@ import { MongoClient } from 'mongodb' -const { MONGODB_URI, MONGODB_DB } = process.env +const MONGODB_URI = process.env.MONGODB_URI +const MONGODB_DB = process.env.MONGODB_DB if (!MONGODB_URI) { throw new Error(
false
Other
vercel
next.js
3dc4b524e79754804b8e53bd1783967d48ce5d13.json
fix minor typo in SWR (#33378) Fixes a small typo: "highly recommend" -> "highly recommended"
docs/basic-features/data-fetching/client-side.md
@@ -43,7 +43,7 @@ function Profile() { ## Client-side data fetching with SWR -The team behind Next.js has created a React hook library for data fetching called [**SWR**](https://swr.vercel.app/). It is **highly recommend** if you are fetching data on the client-side. It handles caching, revalidation, focus trackin...
false
Other
vercel
next.js
10c4f5d13338151cc4e75cefb9dfabfd8cf636be.json
Add link to security email directly. (#33358) * Update SECURITY.md * Update SECURITY.md
SECURITY.md
@@ -1 +1,9 @@ -Visit https://vercel.com/security to view the disclosure policy. +# Reporting Security Issues + +If you believe you have found a security vulnerability in Next.js, we encourage you to let us know right away. + +We will investigate all legitimate reports and do our best to quickly fix the problem. + +Emai...
false
Other
vercel
next.js
ca19860684782531bd932b48a8428fc6249ed489.json
Update license year
license.md
@@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Vercel, Inc. +Copyright (c) 2022 Vercel, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
true
Other
vercel
next.js
ca19860684782531bd932b48a8428fc6249ed489.json
Update license year
packages/next-codemod/license.md
@@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Vercel, Inc. +Copyright (c) 2022 Vercel, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
true
Other
vercel
next.js
ca19860684782531bd932b48a8428fc6249ed489.json
Update license year
packages/next-mdx/license.md
@@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Vercel, Inc. +Copyright (c) 2022 Vercel, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
true
Other
vercel
next.js
ca19860684782531bd932b48a8428fc6249ed489.json
Update license year
packages/next/license.md
@@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Vercel, Inc. +Copyright (c) 2022 Vercel, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
true
Other
vercel
next.js
57a87050e77e9398842a78e43d48b26542642330.json
Add util for normalizing errors (#33159) * JSON.stringify generic errors * Add util for normalizing errors * lint-fix * Add better error for null case as well Co-authored-by: Michael Ozeryansky <mozeryansky@users.noreply.github.com>
errors/threw-undefined.md
@@ -1,9 +1,21 @@ -# Threw undefined in render +# Threw `undefined`/`null` #### Why This Error Occurred -Somewhere in your code you `throw` an `undefined` value. Since this isn't a valid error there isn't a stack trace. We show this error instead to let you know what to look for. +Somewhere in your code you `throw`...
true
Other
vercel
next.js
57a87050e77e9398842a78e43d48b26542642330.json
Add util for normalizing errors (#33159) * JSON.stringify generic errors * Add util for normalizing errors * lint-fix * Add better error for null case as well Co-authored-by: Michael Ozeryansky <mozeryansky@users.noreply.github.com>
packages/next/client/index.tsx
@@ -32,7 +32,7 @@ import PageLoader, { StyleSheetTuple } from './page-loader' import measureWebVitals from './performance-relayer' import { RouteAnnouncer } from './route-announcer' import { createRouter, makePublicRouterInstance } from './router' -import isError from '../lib/is-error' +import { getProperError } fro...
true
Other
vercel
next.js
57a87050e77e9398842a78e43d48b26542642330.json
Add util for normalizing errors (#33159) * JSON.stringify generic errors * Add util for normalizing errors * lint-fix * Add better error for null case as well Co-authored-by: Michael Ozeryansky <mozeryansky@users.noreply.github.com>
packages/next/lib/eslint/runLintCheck.ts
@@ -18,7 +18,7 @@ import { isYarn } from '../is-yarn' import * as Log from '../../build/output/log' import { EventLintCheckCompleted } from '../../telemetry/events/build' -import isError from '../is-error' +import isError, { getProperError } from '../is-error' type Config = { plugins: string[] @@ -221,7 +221,...
true
Other
vercel
next.js
57a87050e77e9398842a78e43d48b26542642330.json
Add util for normalizing errors (#33159) * JSON.stringify generic errors * Add util for normalizing errors * lint-fix * Add better error for null case as well Co-authored-by: Michael Ozeryansky <mozeryansky@users.noreply.github.com>
packages/next/lib/is-error.ts
@@ -1,3 +1,5 @@ +import { isPlainObject } from './is-plain-object' + // We allow some additional attached properties for Errors export interface NextError extends Error { type?: string @@ -11,3 +13,29 @@ export default function isError(err: unknown): err is NextError { typeof err === 'object' && err !== null ...
true
Other
vercel
next.js
57a87050e77e9398842a78e43d48b26542642330.json
Add util for normalizing errors (#33159) * JSON.stringify generic errors * Add util for normalizing errors * lint-fix * Add better error for null case as well Co-authored-by: Michael Ozeryansky <mozeryansky@users.noreply.github.com>
packages/next/lib/is-plain-object.ts
@@ -0,0 +1,12 @@ +export function getObjectClassLabel(value: any): string { + return Object.prototype.toString.call(value) +} + +export function isPlainObject(value: any): boolean { + if (getObjectClassLabel(value) !== '[object Object]') { + return false + } + + const prototype = Object.getPrototypeOf(value) + ...
true
Other
vercel
next.js
57a87050e77e9398842a78e43d48b26542642330.json
Add util for normalizing errors (#33159) * JSON.stringify generic errors * Add util for normalizing errors * lint-fix * Add better error for null case as well Co-authored-by: Michael Ozeryansky <mozeryansky@users.noreply.github.com>
packages/next/lib/is-serializable-props.ts
@@ -1,17 +1,6 @@ -const regexpPlainIdentifier = /^[A-Za-z_$][A-Za-z0-9_$]*$/ - -function getObjectClassLabel(value: any): string { - return Object.prototype.toString.call(value) -} +import { isPlainObject, getObjectClassLabel } from './is-plain-object' -function isPlainObject(value: any): boolean { - if (getObjectC...
true
Other
vercel
next.js
57a87050e77e9398842a78e43d48b26542642330.json
Add util for normalizing errors (#33159) * JSON.stringify generic errors * Add util for normalizing errors * lint-fix * Add better error for null case as well Co-authored-by: Michael Ozeryansky <mozeryansky@users.noreply.github.com>
packages/next/server/base-server.ts
@@ -89,7 +89,7 @@ import { getUtils } from '../build/webpack/loaders/next-serverless-loader/utils' import { PreviewData } from 'next/types' import ResponseCache from './response-cache' import { parseNextUrl } from '../shared/lib/router/utils/parse-next-url' -import isError from '../lib/is-error' +import isError, { g...
true
Other
vercel
next.js
57a87050e77e9398842a78e43d48b26542642330.json
Add util for normalizing errors (#33159) * JSON.stringify generic errors * Add util for normalizing errors * lint-fix * Add better error for null case as well Co-authored-by: Michael Ozeryansky <mozeryansky@users.noreply.github.com>
packages/next/server/dev/hot-reloader.ts
@@ -39,7 +39,7 @@ import { NextConfigComplete } from '../config-shared' import { CustomRoutes } from '../../lib/load-custom-routes' import { DecodeError } from '../../shared/lib/utils' import { Span, trace } from '../../trace' -import isError from '../../lib/is-error' +import { getProperError } from '../../lib/is-er...
true
Other
vercel
next.js
57a87050e77e9398842a78e43d48b26542642330.json
Add util for normalizing errors (#33159) * JSON.stringify generic errors * Add util for normalizing errors * lint-fix * Add better error for null case as well Co-authored-by: Michael Ozeryansky <mozeryansky@users.noreply.github.com>
packages/next/server/dev/next-dev-server.ts
@@ -56,7 +56,7 @@ import { parseStack, } from 'next/dist/compiled/@next/react-dev-overlay/middleware' import * as Log from '../../build/output/log' -import isError from '../../lib/is-error' +import isError, { getProperError } from '../../lib/is-error' import { getMiddlewareRegex } from '../../shared/lib/router/ut...
true
Other
vercel
next.js
57a87050e77e9398842a78e43d48b26542642330.json
Add util for normalizing errors (#33159) * JSON.stringify generic errors * Add util for normalizing errors * lint-fix * Add better error for null case as well Co-authored-by: Michael Ozeryansky <mozeryansky@users.noreply.github.com>
packages/next/shared/lib/router/router.ts
@@ -16,7 +16,7 @@ import { isAssetError, markAssetError, } from '../../../client/route-loader' -import isError from '../../../lib/is-error' +import isError, { getProperError } from '../../../lib/is-error' import { denormalizePagePath } from '../../../server/denormalize-page-path' import { normalizeLocalePath }...
true
Other
vercel
next.js
57a87050e77e9398842a78e43d48b26542642330.json
Add util for normalizing errors (#33159) * JSON.stringify generic errors * Add util for normalizing errors * lint-fix * Add better error for null case as well Co-authored-by: Michael Ozeryansky <mozeryansky@users.noreply.github.com>
test/development/acceptance/ReactRefreshLogBox.test.ts
@@ -903,4 +903,113 @@ describe('ReactRefreshLogBox', () => { await cleanup() }) + + test('non-Error errors are handled properly', async () => { + const { session, cleanup } = await sandbox(next) + + await session.patch( + 'index.js', + ` + export default () => { + throw {'a': ...
true
Other
vercel
next.js
57a87050e77e9398842a78e43d48b26542642330.json
Add util for normalizing errors (#33159) * JSON.stringify generic errors * Add util for normalizing errors * lint-fix * Add better error for null case as well Co-authored-by: Michael Ozeryansky <mozeryansky@users.noreply.github.com>
test/integration/client-navigation/test/rendering.js
@@ -425,7 +425,7 @@ export default function (render, fetch, ctx) { const text = await getRedboxHeader(browser) expect(text).toContain( - 'An undefined error was thrown sometime during render...' + 'An undefined error was thrown, see here for more info:' ) }) })
true
Other
vercel
next.js
5f4947e5a2c75099f7466a6ba8274d8ab4240e6c.json
Add Caveats section to custom error page (#33160) ## Desscription This is a follow up of https://github.com/vercel/next.js/pull/32873. As discussed in #32873, currently it's not recommended to use getServerSideProps in the `Error` component, so this PR will add that caveat to the documentation page, like `Document` a...
docs/advanced-features/custom-error-page.md
@@ -94,3 +94,7 @@ export default function Page({ errorCode, stars }) { The `Error` component also takes `title` as a property if you want to pass in a text message along with a `statusCode`. If you have a custom `Error` component be sure to import that one instead. `next/error` exports the default component used by...
false
Other
vercel
next.js
f0ad19aef62c058893ed12956d40b22b5a8794d4.json
use a separate webpack runtime for middleware (#33134) it should not leak into the client runtime cc @javivelasco ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature...
packages/next/build/entries.ts
@@ -15,7 +15,10 @@ import { NextConfigComplete } from '../server/config-shared' import { isCustomErrorPage, isFlightPage, isReservedPage } from './utils' import { ssrEntries } from './webpack/plugins/middleware-plugin' import type { webpack5 } from 'next/dist/compiled/webpack/webpack' -import { MIDDLEWARE_SSR_RUNTIM...
true
Other
vercel
next.js
f0ad19aef62c058893ed12956d40b22b5a8794d4.json
use a separate webpack runtime for middleware (#33134) it should not leak into the client runtime cc @javivelasco ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature...
packages/next/build/webpack/plugins/middleware-plugin.ts
@@ -6,6 +6,7 @@ import { MIDDLEWARE_FLIGHT_MANIFEST, MIDDLEWARE_BUILD_MANIFEST, MIDDLEWARE_REACT_LOADABLE_MANIFEST, + MIDDLEWARE_RUNTIME_WEBPACK, } from '../../../shared/lib/constants' import { MIDDLEWARE_ROUTE } from '../../../lib/constants' import { nonNullable } from '../../../lib/non-nullable' @@ -89,1...
true
Other
vercel
next.js
f0ad19aef62c058893ed12956d40b22b5a8794d4.json
use a separate webpack runtime for middleware (#33134) it should not leak into the client runtime cc @javivelasco ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature...
packages/next/build/webpack/plugins/terser-webpack-plugin/src/index.js
@@ -75,8 +75,6 @@ export class TerserPlugin { terserSpan.setAttribute('compilationName', compilation.name) return terserSpan.traceAsyncFn(async () => { - let webpackAsset = '' - let hasMiddleware = false let numberOfAssetsForMinify = 0 const assetsList = Object.keys(assets) @@ -99,...
true
Other
vercel
next.js
f0ad19aef62c058893ed12956d40b22b5a8794d4.json
use a separate webpack runtime for middleware (#33134) it should not leak into the client runtime cc @javivelasco ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature...
packages/next/shared/lib/constants.ts
@@ -46,6 +46,7 @@ export const CLIENT_STATIC_FILES_RUNTIME_WEBPACK = `webpack` export const CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL = Symbol(`polyfills`) // server/middleware-flight-runtime.js export const MIDDLEWARE_SSR_RUNTIME_WEBPACK = 'middleware-ssr-runtime' +export const MIDDLEWARE_RUNTIME_WEBPACK = 'midd...
true
Other
vercel
next.js
f0ad19aef62c058893ed12956d40b22b5a8794d4.json
use a separate webpack runtime for middleware (#33134) it should not leak into the client runtime cc @javivelasco ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature...
test/integration/middleware/core/test/index.test.js
@@ -93,16 +93,12 @@ describe('Middleware base tests', () => { ) for (const key of Object.keys(manifest.middleware)) { const middleware = manifest.middleware[key] - expect( - middleware.files.some((file) => file.includes('webpack-middleware')) - ).toBe(true) - expect(...
true
Other
vercel
next.js
f0ad19aef62c058893ed12956d40b22b5a8794d4.json
use a separate webpack runtime for middleware (#33134) it should not leak into the client runtime cc @javivelasco ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature...
test/production/required-server-files.test.ts
@@ -108,10 +108,10 @@ describe('should set-up next', () => { }) it('should output middleware correctly', async () => { - // the middleware-runtime is located in .next/static/chunks so ensure - // the folder is present expect( - await fs.pathExists(join(next.testDir, 'standalone/.next/static/chun...
true
Other
vercel
next.js
48c0bc8cd6268555f41338f9787de9d6d657a0bf.json
Remove extra config from tailwind example (#33062) Removes extra config per https://github.com/vercel/next.js/pull/32808/files#r779282629 ## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint`
examples/with-tailwindcss/.eslintrc.json
@@ -1,3 +0,0 @@ -{ - "extends": "next/core-web-vitals" -}
true
Other
vercel
next.js
48c0bc8cd6268555f41338f9787de9d6d657a0bf.json
Remove extra config from tailwind example (#33062) Removes extra config per https://github.com/vercel/next.js/pull/32808/files#r779282629 ## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint`
examples/with-tailwindcss/README.md
@@ -1,11 +1,3 @@ -<p align="center"> - -<img src="https://res.cloudinary.com/ddcg0rzlo/image/upload/v1640340715/nextjs-tailwind-typescript-banner_vslgq4.png" alt="Next.js TypeScript Starter"> - -</p> - -<br /> - # Next.js + Tailwind CSS Example This example shows how to use [Tailwind CSS](https://tailwindcss.com...
true
Other
vercel
next.js
48c0bc8cd6268555f41338f9787de9d6d657a0bf.json
Remove extra config from tailwind example (#33062) Removes extra config per https://github.com/vercel/next.js/pull/32808/files#r779282629 ## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint`
examples/with-tailwindcss/package.json
@@ -14,8 +14,6 @@ "@types/node": "17.0.4", "@types/react": "17.0.38", "autoprefixer": "^10.4.0", - "eslint": "8.5.0", - "eslint-config-next": "12.0.7", "postcss": "^8.4.5", "tailwindcss": "^3.0.7", "typescript": "4.5.4"
true
Other
vercel
next.js
26ddf32f53f24dd4a56b10ee2b668aebe17cb6b1.json
Update deployment documentation. (#32006) Building off https://github.com/vercel/next.js/pull/31465 for `next export` docs. - Clearly explains the standard output from `next build` - Move Dockerfile snippet to example, instead of embedded directly - Clarify both Vercel and `next start` use the Build API output spec -...
docs/deployment.md
@@ -1,68 +1,67 @@ --- -description: Deploy your Next.js app to production with Vercel and other hosting options. +description: Learn how to deploy your Next.js app to production, either managed or self-hosted. --- # Deployment -## Vercel (Recommended) +Congratulations, you are ready to deploy your Next.js applic...
false
Other
vercel
next.js
789a665a036ede0fc8006ff27d29ef38650f6efc.json
Avoid page double render with emotion vanilla (#30541) > Based on https://github.com/vercel/next.js/blob/v12.0.1/packages/next/server/render.tsx#L522-L532, this avoids the need for double page render. After investigation, the potential unneeded render has been introduced in the official [example](https://github.com/ve...
examples/with-emotion-vanilla/pages/_document.js
@@ -3,9 +3,8 @@ import * as React from 'react' import { renderStatic } from '../shared/renderer' export default class AppDocument extends Document { static async getInitialProps(ctx) { - const page = await ctx.renderPage() - const { css, ids } = await renderStatic(page.html) const initialProps = await D...
false
Other
vercel
next.js
e8f85e3d9a5fc57ffd46c0df3c31277d52ff2de8.json
misc: add MANGLING_DEBUG option (#40958) Context: I am doing some work re: bundle size so I'm spending a lot of time looking at the bundles we generate. This debug options basically deactives mangling and beautifies the output whilst keeping the dead code elimination from Terser which is helpful for me to check what...
packages/next/build/webpack-config.ts
@@ -897,13 +897,28 @@ export default async function getBaseWebpackConfig( comparisons: false, inline: 2, // https://github.com/vercel/next.js/issues/7178#issuecomment-493048965 }, - mangle: { safari10: true }, + mangle: { + safari10: true, + ...(process.env.__NEXT_MANGLING_DEBUG + ...
false
Other
vercel
next.js
43dfc501793f07643697a171b6dbf229853fbffa.json
Remove outdated warning (#40988) Cleans up a leftover warning as it's no longer relevant to be shown at this particular spot. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an exis...
packages/next/build/webpack-config.ts
@@ -580,11 +580,6 @@ export default async function getBaseWebpackConfig( 'You are using the experimental Node.js Runtime with `experimental.runtime`.' ) } - if (hasServerComponents) { - Log.warn( - 'You have experimental React Server Components enabled. Continue at your own risk.' - ...
false
Other
vercel
next.js
f7ce8eceb7a76e6758a9d236ad9711440fb2bb12.json
misc: remove NEXT_RUNTIME=edge from middleware tests (#40977) This seems to be the cause for the failure of https://github.com/vercel/next.js/actions/runs/3133433920/jobs/5087331787 that caused[ the revert](https://github.com/vercel/next.js/pull/40967) of my [commit ](https://github.com/vercel/next.js/commit/11deaaa8...
test/e2e/middleware-general/test/index.test.ts
@@ -56,7 +56,6 @@ describe('Middleware Runtime', () => { ANOTHER_MIDDLEWARE_TEST: 'asdf2', STRING_ENV_VAR: 'asdf3', MIDDLEWARE_TEST: 'asdf', - NEXT_RUNTIME: 'edge', }, }) })
true
Other
vercel
next.js
f7ce8eceb7a76e6758a9d236ad9711440fb2bb12.json
misc: remove NEXT_RUNTIME=edge from middleware tests (#40977) This seems to be the cause for the failure of https://github.com/vercel/next.js/actions/runs/3133433920/jobs/5087331787 that caused[ the revert](https://github.com/vercel/next.js/pull/40967) of my [commit ](https://github.com/vercel/next.js/commit/11deaaa8...
test/integration/middleware-prefetch/tests/index.test.js
@@ -38,7 +38,6 @@ describe('Middleware Production Prefetch', () => { context.app = await nextStart(context.appDir, context.appPort, { env: { MIDDLEWARE_TEST: 'asdf', - NEXT_RUNTIME: 'edge', }, onStdout(msg) { context.logs.output += msg
true
Other
vercel
next.js
0f41a48f8fd828c40527cab8cba7ad645d3290ce.json
Update return shape of generateStaticParams (#40965) x-ref: [slack thread](https://vercel.slack.com/archives/C035J346QQL/p1664290658055079)
packages/next/build/utils.ts
@@ -1126,7 +1126,7 @@ export async function buildAppStaticPaths({ const result = await curGenerate.generateStaticParams({ params }) // TODO: validate the result is valid here or wait for // buildStaticPaths to validate? - for (const item of result.params) { + for (const item of ...
true
Other
vercel
next.js
0f41a48f8fd828c40527cab8cba7ad645d3290ce.json
Update return shape of generateStaticParams (#40965) x-ref: [slack thread](https://vercel.slack.com/archives/C035J346QQL/p1664290658055079)
test/e2e/app-dir/app-static/app/blog/[author]/[slug]/page.js
@@ -20,34 +20,28 @@ export function generateStaticParams({ params }) { switch (params.author) { case 'tim': { - return { - params: [ - { - slug: 'first-post', - }, - ], - } + return [ + { + slug: 'first-post', + }, + ] ...
true
Other
vercel
next.js
0f41a48f8fd828c40527cab8cba7ad645d3290ce.json
Update return shape of generateStaticParams (#40965) x-ref: [slack thread](https://vercel.slack.com/archives/C035J346QQL/p1664290658055079)
test/e2e/app-dir/app-static/app/blog/[author]/layout.js
@@ -10,7 +10,5 @@ export default function Layout({ children, params }) { export function generateStaticParams({ params }) { console.log('/blog/[author] generateStaticParams', JSON.stringify(params)) - return { - params: [{ author: 'tim' }, { author: 'seb' }, { author: 'styfle' }], - } + return [{ author: 't...
true
Other
vercel
next.js
bc685142aa14b9f2dcfe0208c11b3f8fbf0eb5f4.json
Increase other timeouts
.github/workflows/build_test_deploy.yml
@@ -281,7 +281,7 @@ jobs: if: ${{needs.build.outputs.docsChange == 'nope'}} - run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps - timeout-minutes: 3 + timeout-minutes: 5 if: ${{needs.build.outputs.docsChange == 'nope'}} - run: node run-tests.js --t...
false
Other
vercel
next.js
a283b7b14ee93a28cde311c396cce071e61ef2d7.json
docs: add inline documentation for Link props (#40855) ## Example **Instead of:** <img width="674" alt="Screenshot 2022-09-23 at 21 25 58" src="https://user-images.githubusercontent.com/1265681/192042744-6f1163e2-32af-49a0-bfba-385e5a7bad71.png"> **we should show:** <img width="890" alt="Screenshot 2022...
packages/next/client/link.tsx
@@ -27,14 +27,60 @@ type OptionalKeys<T> = { }[keyof T] type InternalLinkProps = { + /** + * The path or URL to navigate to. It can also be an object. + * + * @example https://nextjs.org/docs/api-reference/next/link#with-url-object + */ href: Url + /** + * Optional decorator for the path that will be...
false
Other
vercel
next.js
9657f99eedc7dece0ef134e4709fba8251c3d14a.json
Add timeout to playwright setup job (#40960) The `npm i` step sometimes stall due to the network in GitHub actions so this adds a timeout so we aren't wasting CI time on this. x-ref: https://github.com/vercel/next.js/actions/runs/3136162957/jobs/5092826951
.github/workflows/build_test_deploy.yml
@@ -281,6 +281,7 @@ jobs: if: ${{needs.build.outputs.docsChange == 'nope'}} - run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps + timeout-minutes: 3 if: ${{needs.build.outputs.docsChange == 'nope'}} - run: node run-tests.js --type development --timings -g...
false
Other
vercel
next.js
c69677a553417930b2eaef9b76112ed468837c14.json
remove reducer from server bundle (#40959) This reducer takes a good chunk of the bundle but is never run on the server so we can eliminate it. 5-10ms wins from my manual benchmark runs. ![image](https://user-images.githubusercontent.com/11064311/192577550-4b2c3fa1-1ce9-456a-a635-d708e8200f2d.png) ## Bug - [ ] R...
packages/next/client/components/reducer.ts
@@ -615,7 +615,7 @@ type AppRouterState = { /** * Reducer that handles the app-router state updates. */ -export function reducer( +function clientReducer( state: Readonly<AppRouterState>, action: Readonly< | ReloadAction @@ -1108,3 +1108,20 @@ export function reducer( throw new Error('Unknown act...
false
Other
vercel
next.js
6be2868787285c878d4b4b9eeca2079c9f08bb7b.json
misc: add benchmarking script for edge rendering (#40716) This PR adds the benchmarking script I've been using for #40251 to measure the performance improvements that we make to the Edge SSR runtime. This tool: - uploads two version of the benchmarking project to Vercel, one with the latest canary and the one w...
.gitignore
@@ -45,4 +45,4 @@ test-timings.json # Cache *.tsbuildinfo -.swc/ +.swc/ \ No newline at end of file
true
Other
vercel
next.js
6be2868787285c878d4b4b9eeca2079c9f08bb7b.json
misc: add benchmarking script for edge rendering (#40716) This PR adds the benchmarking script I've been using for #40251 to measure the performance improvements that we make to the Edge SSR runtime. This tool: - uploads two version of the benchmarking project to Vercel, one with the latest canary and the one w...
bench/vercel/.env.dev
@@ -0,0 +1,8 @@ +# The Vercel team you want to deploy the project too +VERCEL_TEST_TEAM= + +# The corresponding Vercel token +VERCEL_TEST_TOKEN= + +# The Vercel project you want to deploy the test project too +VERCEL_TEST_PROJECT_NAME=
true
Other
vercel
next.js
6be2868787285c878d4b4b9eeca2079c9f08bb7b.json
misc: add benchmarking script for edge rendering (#40716) This PR adds the benchmarking script I've been using for #40251 to measure the performance improvements that we make to the Edge SSR runtime. This tool: - uploads two version of the benchmarking project to Vercel, one with the latest canary and the one w...
bench/vercel/.gitignore
@@ -0,0 +1,5 @@ +.vercel +.next +*.tgz +yarn.lock +.env \ No newline at end of file
true
Other
vercel
next.js
6be2868787285c878d4b4b9eeca2079c9f08bb7b.json
misc: add benchmarking script for edge rendering (#40716) This PR adds the benchmarking script I've been using for #40251 to measure the performance improvements that we make to the Edge SSR runtime. This tool: - uploads two version of the benchmarking project to Vercel, one with the latest canary and the one w...
bench/vercel/README.md
@@ -0,0 +1,22 @@ +# Benchmarking Next.js on production + +This script allows you to measure some performance metrics of your local build of Next.js on production by uploading your current build to Vercel with an example app and running some basic benchmarks on it. + +## Requirements + +- the Vercel CLI + +## Setup + +R...
true
Other
vercel
next.js
6be2868787285c878d4b4b9eeca2079c9f08bb7b.json
misc: add benchmarking script for edge rendering (#40716) This PR adds the benchmarking script I've been using for #40251 to measure the performance improvements that we make to the Edge SSR runtime. This tool: - uploads two version of the benchmarking project to Vercel, one with the latest canary and the one w...
bench/vercel/bench.js
@@ -0,0 +1,70 @@ +import { Command } from 'commander' +import console from 'console' + +import chalk from 'chalk' + +import PQueue from 'p-queue' +import { generateProjects, cleanupProjectFolders } from './project-utils.js' +import { printBenchmarkResults } from './chart.js' +import { genRetryableRequest } from './gen-...
true
Other
vercel
next.js
6be2868787285c878d4b4b9eeca2079c9f08bb7b.json
misc: add benchmarking script for edge rendering (#40716) This PR adds the benchmarking script I've been using for #40251 to measure the performance improvements that we make to the Edge SSR runtime. This tool: - uploads two version of the benchmarking project to Vercel, one with the latest canary and the one w...
bench/vercel/benchmark-app/.gitignore
@@ -0,0 +1,2 @@ +.vercel +webpack-stats-client.json \ No newline at end of file
true
Other
vercel
next.js
6be2868787285c878d4b4b9eeca2079c9f08bb7b.json
misc: add benchmarking script for edge rendering (#40716) This PR adds the benchmarking script I've been using for #40251 to measure the performance improvements that we make to the Edge SSR runtime. This tool: - uploads two version of the benchmarking project to Vercel, one with the latest canary and the one w...
bench/vercel/benchmark-app/app/layout.js
@@ -0,0 +1,14 @@ +import * as React from 'react' + +export default function Root({ children }) { + return ( + <html> + <head></head> + <body>{children}</body> + </html> + ) +} + +export const config = { + runtime: 'experimental-edge', +}
true
Other
vercel
next.js
6be2868787285c878d4b4b9eeca2079c9f08bb7b.json
misc: add benchmarking script for edge rendering (#40716) This PR adds the benchmarking script I've been using for #40251 to measure the performance improvements that we make to the Edge SSR runtime. This tool: - uploads two version of the benchmarking project to Vercel, one with the latest canary and the one w...
bench/vercel/benchmark-app/app/rsc/page.js
@@ -0,0 +1,14 @@ +import * as React from 'react' + +// if (!('hot' in Math)) Math.hot = false + +export default function page() { + // const previous = Math.hot + // Math.hot = true + // return <div>{previous ? 'HOT' : 'COLD'}</div> + return <div>hello</div> +} + +export const config = { + runtime: 'experimental-e...
true
Other
vercel
next.js
6be2868787285c878d4b4b9eeca2079c9f08bb7b.json
misc: add benchmarking script for edge rendering (#40716) This PR adds the benchmarking script I've been using for #40251 to measure the performance improvements that we make to the Edge SSR runtime. This tool: - uploads two version of the benchmarking project to Vercel, one with the latest canary and the one w...
bench/vercel/benchmark-app/next.config.js
@@ -0,0 +1,34 @@ +const { StatsWriterPlugin } = require('webpack-stats-plugin') +const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') + +module.exports = { + experimental: { + appDir: true, + }, + webpack: (config, options) => { + const { nextRuntime = 'client' } = options + if (process.env.A...
true
Other
vercel
next.js
6be2868787285c878d4b4b9eeca2079c9f08bb7b.json
misc: add benchmarking script for edge rendering (#40716) This PR adds the benchmarking script I've been using for #40251 to measure the performance improvements that we make to the Edge SSR runtime. This tool: - uploads two version of the benchmarking project to Vercel, one with the latest canary and the one w...
bench/vercel/benchmark-app/package.json
@@ -0,0 +1,14 @@ +{ + "name": "stats-app", + "private": true, + "license": "MIT", + "dependencies": { + "webpack-bundle-analyzer": "^4.6.1", + "webpack-stats-plugin": "^1.1.0" + }, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start" + } +}
true
Other
vercel
next.js
6be2868787285c878d4b4b9eeca2079c9f08bb7b.json
misc: add benchmarking script for edge rendering (#40716) This PR adds the benchmarking script I've been using for #40251 to measure the performance improvements that we make to the Edge SSR runtime. This tool: - uploads two version of the benchmarking project to Vercel, one with the latest canary and the one w...
bench/vercel/benchmark-app/pages/index.js
@@ -0,0 +1,20 @@ +if (!('hot' in Math)) Math.hot = false + +export default function page({ hot }) { + return `${hot ? 'HOT' : 'COLD'}` +} + +export async function getServerSideProps() { + const wasHot = Math.hot + Math.hot = true + + return { + props: { + hot: wasHot, + }, + } +} + +export const config ...
true
Other
vercel
next.js
6be2868787285c878d4b4b9eeca2079c9f08bb7b.json
misc: add benchmarking script for edge rendering (#40716) This PR adds the benchmarking script I've been using for #40251 to measure the performance improvements that we make to the Edge SSR runtime. This tool: - uploads two version of the benchmarking project to Vercel, one with the latest canary and the one w...
bench/vercel/chart.js
@@ -0,0 +1,99 @@ +import downsampler from 'downsample-lttb' +import asciichart from 'asciichart' +import terminalSize from 'term-size' + +const CHART_WIDTH = terminalSize().columns - 15 // space for the labels + +function getMetrics(data) { + const sorted = [...data].sort((a, b) => a - b) + const getPercentile = (per...
true
Other
vercel
next.js
6be2868787285c878d4b4b9eeca2079c9f08bb7b.json
misc: add benchmarking script for edge rendering (#40716) This PR adds the benchmarking script I've been using for #40251 to measure the performance improvements that we make to the Edge SSR runtime. This tool: - uploads two version of the benchmarking project to Vercel, one with the latest canary and the one w...
bench/vercel/gen-request.js
@@ -0,0 +1,41 @@ +import https from 'https' +import timer from '@szmarczak/http-timer' + +// a wrapper around genAsyncRequest that will retry the request 5 times if it fails +export async function genRetryableRequest(url) { + let retries = 0 + while (retries < 5) { + try { + return await genAsyncRequest(url) ...
true
Other
vercel
next.js
6be2868787285c878d4b4b9eeca2079c9f08bb7b.json
misc: add benchmarking script for edge rendering (#40716) This PR adds the benchmarking script I've been using for #40251 to measure the performance improvements that we make to the Edge SSR runtime. This tool: - uploads two version of the benchmarking project to Vercel, one with the latest canary and the one w...
bench/vercel/generate-package-json.js
@@ -0,0 +1,52 @@ +import execa from 'execa' +import fs from 'fs/promises' +import path from 'path' + +export async function generatePackageJson(folder, withLocalNext = false) { + const packageJson = JSON.parse( + await fs.readFile(path.join(folder, 'package.json')) + ) + + const currentVersions = await getCurrent...
true
Other
vercel
next.js
6be2868787285c878d4b4b9eeca2079c9f08bb7b.json
misc: add benchmarking script for edge rendering (#40716) This PR adds the benchmarking script I've been using for #40251 to measure the performance improvements that we make to the Edge SSR runtime. This tool: - uploads two version of the benchmarking project to Vercel, one with the latest canary and the one w...
bench/vercel/package.json
@@ -0,0 +1,24 @@ +{ + "name": "bench-production", + "version": "1.0.0", + "description": "Scripts for benchmarking in production.", + "main": "bench.js", + "type": "module", + "scripts": { + "bench": "node bench.js" + }, + "author": "", + "license": "ISC", + "dependencies": { + "@szmarczak/http-timer": ...
true
Other
vercel
next.js
6be2868787285c878d4b4b9eeca2079c9f08bb7b.json
misc: add benchmarking script for edge rendering (#40716) This PR adds the benchmarking script I've been using for #40251 to measure the performance improvements that we make to the Edge SSR runtime. This tool: - uploads two version of the benchmarking project to Vercel, one with the latest canary and the one w...
bench/vercel/project-utils.js
@@ -0,0 +1,218 @@ +import { config } from 'dotenv' + +import fetch from 'node-fetch' +import chalk from 'chalk' +import execa from 'execa' +import path from 'path' +import url from 'url' +import { generatePackageJson } from './generate-package-json.js' +import { Listr } from 'listr2' + +config() + +const TEST_PROJECT_N...
true
Other
vercel
next.js
6be2868787285c878d4b4b9eeca2079c9f08bb7b.json
misc: add benchmarking script for edge rendering (#40716) This PR adds the benchmarking script I've been using for #40251 to measure the performance improvements that we make to the Edge SSR runtime. This tool: - uploads two version of the benchmarking project to Vercel, one with the latest canary and the one w...
pnpm-lock.yaml
@@ -325,6 +325,30 @@ importers: webpack: 5.74.0_@swc+core@1.2.203 webpack-bundle-analyzer: 4.3.0 + bench/vercel: + specifiers: + '@szmarczak/http-timer': 5.0.1 + asciichart: 1.5.25 + commander: 2.20.0 + dotenv: 10.0.0 + downsample-lttb: 0.0.1 + listr2: 5.0.5 + p-qu...
true
Other
vercel
next.js
6be2868787285c878d4b4b9eeca2079c9f08bb7b.json
misc: add benchmarking script for edge rendering (#40716) This PR adds the benchmarking script I've been using for #40251 to measure the performance improvements that we make to the Edge SSR runtime. This tool: - uploads two version of the benchmarking project to Vercel, one with the latest canary and the one w...
pnpm-workspace.yaml
@@ -1,2 +1,3 @@ packages: - 'packages/*' + - 'bench/vercel/'
true
Other
vercel
next.js
83f89c4f87a7d3bf90bf0b54a0ee7132fa769dfd.json
Improve types for `<Image />` and `responseLimit` (#40863) Currently, a developer building a website using Next.js could write this code with no type errors: ```tsx <Image width="kangaroo" height="100px" quality="medium" {...rest} /> ``` This PR adds stricter type checking, which will catch this ...
packages/next/client/future/image.tsx
@@ -72,6 +72,8 @@ interface StaticRequire { type StaticImport = StaticRequire | StaticImageData +type SafeNumber = number | `${number}` + function isStaticRequire( src: StaticRequire | StaticImageData ): src is StaticRequire { @@ -98,11 +100,11 @@ export type ImageProps = Omit< > & { src: string | StaticI...
true
Other
vercel
next.js
83f89c4f87a7d3bf90bf0b54a0ee7132fa769dfd.json
Improve types for `<Image />` and `responseLimit` (#40863) Currently, a developer building a website using Next.js could write this code with no type errors: ```tsx <Image width="kangaroo" height="100px" quality="medium" {...rest} /> ``` This PR adds stricter type checking, which will catch this ...
packages/next/client/image.tsx
@@ -218,6 +218,8 @@ interface StaticRequire { type StaticImport = StaticRequire | StaticImageData +type SafeNumber = number | `${number}` + function isStaticRequire( src: StaticRequire | StaticImageData ): src is StaticRequire { @@ -243,11 +245,11 @@ export type ImageProps = Omit< 'src' | 'srcSet' | 'ref' ...
true
Other
vercel
next.js
83f89c4f87a7d3bf90bf0b54a0ee7132fa769dfd.json
Improve types for `<Image />` and `responseLimit` (#40863) Currently, a developer building a website using Next.js could write this code with no type errors: ```tsx <Image width="kangaroo" height="100px" quality="medium" {...rest} /> ``` This PR adds stricter type checking, which will catch this ...
packages/next/server/api-utils/node.ts
@@ -1,6 +1,6 @@ import type { IncomingMessage, ServerResponse } from 'http' import type { NextApiRequest, NextApiResponse } from '../../shared/lib/utils' -import type { PageConfig } from 'next/types' +import type { PageConfig, ResponseLimit, SizeLimit } from 'next/types' import { checkIsManualRevalidate, PRERE...
true
Other
vercel
next.js
83f89c4f87a7d3bf90bf0b54a0ee7132fa769dfd.json
Improve types for `<Image />` and `responseLimit` (#40863) Currently, a developer building a website using Next.js could write this code with no type errors: ```tsx <Image width="kangaroo" height="100px" quality="medium" {...rest} /> ``` This PR adds stricter type checking, which will catch this ...
packages/next/server/base-http/node.ts
@@ -1,5 +1,6 @@ import type { ServerResponse, IncomingMessage } from 'http' import type { Writable, Readable } from 'stream' +import type { SizeLimit } from 'next/types' import { NextApiRequestCookies, SYMBOL_CLEARED_COOKIES } from '../api-utils' import { parseBody } from '../api-utils/node' @@ -34,7 +35,7 @@ exp...
true
Other
vercel
next.js
83f89c4f87a7d3bf90bf0b54a0ee7132fa769dfd.json
Improve types for `<Image />` and `responseLimit` (#40863) Currently, a developer building a website using Next.js could write this code with no type errors: ```tsx <Image width="kangaroo" height="100px" quality="medium" {...rest} /> ``` This PR adds stricter type checking, which will catch this ...
packages/next/types/index.d.ts
@@ -61,6 +61,22 @@ export type Redirect = */ export type NextPage<P = {}, IP = P> = NextComponentType<NextPageContext, IP, P> +export type FileSizeSuffix = `${ + | 'k' + | 'K' + | 'm' + | 'M' + | 'g' + | 'G' + | 't' + | 'T' + | 'p' + | 'P'}${'b' | 'B'}` + +export type SizeLimit = number | `${number}${Fil...
true
Other
vercel
next.js
83f89c4f87a7d3bf90bf0b54a0ee7132fa769dfd.json
Improve types for `<Image />` and `responseLimit` (#40863) Currently, a developer building a website using Next.js could write this code with no type errors: ```tsx <Image width="kangaroo" height="100px" quality="medium" {...rest} /> ``` This PR adds stricter type checking, which will catch this ...
test/integration/image-component/typescript/pages/invalid.tsx
@@ -26,6 +26,24 @@ const Invalid = () => { height="500" placeholder="invalid" ></Image> + <Image + id="invalid-width-string-type" + alt="invalid-width-string-type" + src="https://image-optimization-test.vercel.app/test.jpg" + width="500foo" + /> + <Ima...
true
Other
vercel
next.js
83f89c4f87a7d3bf90bf0b54a0ee7132fa769dfd.json
Improve types for `<Image />` and `responseLimit` (#40863) Currently, a developer building a website using Next.js could write this code with no type errors: ```tsx <Image width="kangaroo" height="100px" quality="medium" {...rest} /> ``` This PR adds stricter type checking, which will catch this ...
test/integration/image-component/typescript/pages/valid.tsx
@@ -43,6 +43,14 @@ const Page = () => { width={500} height={500} /> + <Image + id="numeric-string-types" + alt="numeric-string-types" + src="https://image-optimization-test.vercel.app/test.jpg" + quality="80" + width="500" + height="500" + /> ...
true
Other
vercel
next.js
83f89c4f87a7d3bf90bf0b54a0ee7132fa769dfd.json
Improve types for `<Image />` and `responseLimit` (#40863) Currently, a developer building a website using Next.js could write this code with no type errors: ```tsx <Image width="kangaroo" height="100px" quality="medium" {...rest} /> ``` This PR adds stricter type checking, which will catch this ...
test/integration/image-future/typescript/pages/invalid.tsx
@@ -27,6 +27,24 @@ const Invalid = () => { height="500" placeholder="invalid" /> + <Image + id="invalid-width-string-type" + alt="invalid-width-string-type" + src="https://image-optimization-test.vercel.app/test.jpg" + width="500foo" + /> + <Image + ...
true
Other
vercel
next.js
83f89c4f87a7d3bf90bf0b54a0ee7132fa769dfd.json
Improve types for `<Image />` and `responseLimit` (#40863) Currently, a developer building a website using Next.js could write this code with no type errors: ```tsx <Image width="kangaroo" height="100px" quality="medium" {...rest} /> ``` This PR adds stricter type checking, which will catch this ...
test/integration/image-future/typescript/pages/valid.tsx
@@ -28,13 +28,15 @@ const Page = () => { id="fill-no-width-and-height" src="https://image-optimization-test.vercel.app/test.jpg" fill + alt="" /> <Image id="quality-num" src="https://image-optimization-test.vercel.app/test.jpg" quality={80} ...
true
Other
vercel
next.js
7903b04bb42c07eab3cca2e4223c028cc2b31092.json
Remove extra pnp test (#40929) We already have quite a few PnP tests so this removes one of them that is causing issues with unrelated PRs. x-ref: https://github.com/vercel/next.js/actions/runs/3131979254/jobs/5084663564
test/e2e/yarn-pnp/test/with-typescript.test.ts
@@ -1,5 +0,0 @@ -import { runTests } from './utils' - -describe('yarn PnP', () => { - runTests('with-typescript') -})
false
Other
vercel
next.js
194b6ad1c136a8c75a68bf82a5b80504703ec162.json
update url for React Hydration Documentation (#40883) Docs point to old __[hydrate()](https://reactjs.org/docs/react-dom.html#hydrate)__, which had been replaced with __[hydrateRoot()](https://reactjs.org/docs/react-dom-client.html#hydrateroot)__ as React 18 came: > Note: hydrate has been replaced with hydrate...
errors/react-hydration-error.md
@@ -84,5 +84,5 @@ Common causes with css-in-js libraries: ### Useful Links -- [React Hydration Documentation](https://reactjs.org/docs/react-dom.html#hydrate) +- [React Hydration Documentation](https://reactjs.org/docs/react-dom-client.html#hydrateroot) - [Josh Comeau's article on React Hydration](https://www.jos...
false
Other
vercel
next.js
904619509e9ea2de60fccafe19b5d3aa1634d107.json
Use an ellipsis character instead (#40913) <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change that you're making: --> For context, making ...
test/integration/preload-viewport/pages/invalid-prefetch.js
@@ -3,7 +3,7 @@ import Link from 'next/link' export default () => ( <> <Link href="/something-invalid-oops"> - <a id="invalid-link">I'm broken...</a> + <a id="invalid-link">I'm broken…</a> </Link> </> )
false
Other
vercel
next.js
719116ac81da79db427937698f27d50d7fc7301d.json
Allow export const in font loader (#40836) Allow `export const font = Font()` syntax ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the ...
packages/next-swc/crates/core/src/next_font_loaders/font_imports_generator.rs
@@ -68,7 +68,7 @@ impl<'a> FontImportsGenerator<'a> { None } - fn check_var_decl(&mut self, var_decl: &VarDecl) { + fn check_var_decl(&mut self, var_decl: &VarDecl) -> Option<Ident> { if let Some(decl) = var_decl.decls.get(0) { let ident = match &decl.name { ...
true
Other
vercel
next.js
719116ac81da79db427937698f27d50d7fc7301d.json
Allow export const in font loader (#40836) Allow `export const font = Font()` syntax ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the ...
packages/next-swc/crates/core/src/next_font_loaders/mod.rs
@@ -39,6 +39,7 @@ pub struct State { font_functions: AHashMap<Id, FontFunction>, removeable_module_items: FxHashSet<BytePos>, font_imports: Vec<ModuleItem>, + font_exports: Vec<ModuleItem>, font_functions_in_allowed_scope: FxHashSet<BytePos>, } @@ -76,10 +77,11 @@ impl VisitMut for NextFontLoa...
true
Other
vercel
next.js
719116ac81da79db427937698f27d50d7fc7301d.json
Allow export const in font loader (#40836) Allow `export const font = Font()` syntax ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the ...
packages/next-swc/crates/core/tests/errors/next-font-loaders/export-let/input.js
@@ -0,0 +1,5 @@ +import React from 'react' +import { Abel, Inter } from '@next/font/google' + +export let firaCode = Abel() +export var inter = Inter()
true
Other
vercel
next.js
719116ac81da79db427937698f27d50d7fc7301d.json
Allow export const in font loader (#40836) Allow `export const font = Font()` syntax ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the ...
packages/next-swc/crates/core/tests/errors/next-font-loaders/export-let/output.js
@@ -0,0 +1,5 @@ +import firaCode from "@next/font/google?pages/test.tsx;Abel"; +import inter from "@next/font/google?pages/test.tsx;Inter"; +import React from 'react'; +export { firaCode }; +export { inter };
true
Other
vercel
next.js
719116ac81da79db427937698f27d50d7fc7301d.json
Allow export const in font loader (#40836) Allow `export const font = Font()` syntax ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the ...
packages/next-swc/crates/core/tests/errors/next-font-loaders/export-let/output.stderr
@@ -0,0 +1,12 @@ + + x Font loader calls must be assigned to a const + ,-[input.js:4:1] + 4 | export let firaCode = Abel() + : ^^^^^^^^^^^^^^^^^^^^^ + `---- + + x Font loader calls must be assigned to a const + ,-[input.js:5:1] + 5 | export var inter = Inter() + : ^^^^^^^^^^^^^^^^^^^ + `----
true
Other
vercel
next.js
719116ac81da79db427937698f27d50d7fc7301d.json
Allow export const in font loader (#40836) Allow `export const font = Font()` syntax ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the ...
packages/next-swc/crates/core/tests/errors/next-font-loaders/not-ident/output.js
@@ -1 +1,7 @@ +const { a } = Inter({ + variant: '400' +}); +const [b] = Inter({ + variant: '400' +}); const { e } = {};
true
Other
vercel
next.js
719116ac81da79db427937698f27d50d7fc7301d.json
Allow export const in font loader (#40836) Allow `export const font = Font()` syntax ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the ...
packages/next-swc/crates/core/tests/fixture/next-font-loaders/export-const/input.js
@@ -0,0 +1,5 @@ +import React from 'react' +import { Abel, Inter } from '@next/font/google' + +export const firaCode = Abel() +export const inter = Inter()
true
Other
vercel
next.js
719116ac81da79db427937698f27d50d7fc7301d.json
Allow export const in font loader (#40836) Allow `export const font = Font()` syntax ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the ...
packages/next-swc/crates/core/tests/fixture/next-font-loaders/export-const/output.js
@@ -0,0 +1,5 @@ +import firaCode from "@next/font/google?pages/test.tsx;Abel"; +import inter from "@next/font/google?pages/test.tsx;Inter"; +import React from 'react'; +export { firaCode }; +export { inter };
true