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 | b540054388b7121ec974e1d7bec19a181063799d.json | Update authentication examples (#19330)
* Updated example readme
* Updated with-passport example
* Updated profile page for with-passport
* Updated with-passport-and-next-connect
* Updated with-magic
* Updated with-magic readme
* Updated with-iron-session
* Updated next version in with-iron-sessio... | examples/with-passport/package.json | @@ -14,7 +14,8 @@
"passport-local": "1.0.0",
"react": "latest",
"react-dom": "latest",
- "swr": "0.3.0"
+ "swr": "0.3.0",
+ "uuid": "8.3.1"
},
"license": "MIT"
} | true |
Other | vercel | next.js | b540054388b7121ec974e1d7bec19a181063799d.json | Update authentication examples (#19330)
* Updated example readme
* Updated with-passport example
* Updated profile page for with-passport
* Updated with-passport-and-next-connect
* Updated with-magic
* Updated with-magic readme
* Updated with-iron-session
* Updated next version in with-iron-sessio... | examples/with-passport/pages/api/login.js | @@ -1,8 +1,7 @@
import passport from 'passport'
import nextConnect from 'next-connect'
import { localStrategy } from '../../lib/password-local'
-import { encryptSession } from '../../lib/iron'
-import { setTokenCookie } from '../../lib/auth-cookies'
+import { setLoginSession } from '../../lib/auth'
const authenti... | true |
Other | vercel | next.js | b540054388b7121ec974e1d7bec19a181063799d.json | Update authentication examples (#19330)
* Updated example readme
* Updated with-passport example
* Updated profile page for with-passport
* Updated with-passport-and-next-connect
* Updated with-magic
* Updated with-magic readme
* Updated with-iron-session
* Updated next version in with-iron-sessio... | examples/with-passport/pages/api/user.js | @@ -1,9 +1,14 @@
-import { getSession } from '../../lib/iron'
+import { getLoginSession } from '../../lib/auth'
+import { findUser } from '../../lib/user'
export default async function user(req, res) {
- const session = await getSession(req)
- // After getting the session you may want to fetch for the user instead... | true |
Other | vercel | next.js | b540054388b7121ec974e1d7bec19a181063799d.json | Update authentication examples (#19330)
* Updated example readme
* Updated with-passport example
* Updated profile page for with-passport
* Updated with-passport-and-next-connect
* Updated with-magic
* Updated with-magic readme
* Updated with-iron-session
* Updated next version in with-iron-sessio... | examples/with-passport/pages/index.js | @@ -11,7 +11,7 @@ const Home = () => {
<p>Steps to test the example:</p>
<ol>
- <li>Click Login and enter an username and password.</li>
+ <li>Click Login and enter a username and password.</li>
<li>
You'll be redirected to Home. Click on Profile, notice how your
... | true |
Other | vercel | next.js | b540054388b7121ec974e1d7bec19a181063799d.json | Update authentication examples (#19330)
* Updated example readme
* Updated with-passport example
* Updated profile page for with-passport
* Updated with-passport-and-next-connect
* Updated with-magic
* Updated with-magic readme
* Updated with-iron-session
* Updated next version in with-iron-sessio... | examples/with-passport/pages/profile.js | @@ -7,7 +7,19 @@ const Profile = () => {
return (
<Layout>
<h1>Profile</h1>
- {user && <p>Your session: {JSON.stringify(user)}</p>}
+ {user && (
+ <>
+ <p>Your session:</p>
+ <pre>{JSON.stringify(user, null, 2)}</pre>
+ </>
+ )}
+
+ <style jsx>{`
+ ... | true |
Other | vercel | next.js | f2f9090a50f42bb894fc7ea3db48e1b125ea85fa.json | Ignore emacs lockfiles (#20497)
Fixes: https://github.com/vercel/next.js/issues/15278
> Bug report
> When using next dev with emacs, as you develop, emacs creates symbolic link files starting with .# as lock files. Next.js seems to attempt to load these but fails, spewing out errors constantly.
Prevents dev server ... | .gitignore | @@ -25,6 +25,7 @@ test/**/next-env.d.ts
# Editors
**/.idea
+**/.#*
# examples
examples/**/out | true |
Other | vercel | next.js | f2f9090a50f42bb894fc7ea3db48e1b125ea85fa.json | Ignore emacs lockfiles (#20497)
Fixes: https://github.com/vercel/next.js/issues/15278
> Bug report
> When using next dev with emacs, as you develop, emacs creates symbolic link files starting with .# as lock files. Next.js seems to attempt to load these but fails, spewing out errors constantly.
Prevents dev server ... | packages/next/build/webpack-config.ts | @@ -712,6 +712,8 @@ export default async function getBaseWebpackConfig(
callback()
}
+ const emacsLockfilePattern = '**/.#*'
+
let webpackConfig: webpack.Configuration = {
externals: !isServer
? // make sure importing "next" is handled gracefully for client
@@ -788,7 +790,13 @@ export default ... | true |
Other | vercel | next.js | c93c9fcc78b6e872a68b533bbcf6dd8ecb1adf03.json | Add error for invalid webpack 5 version (#20558)
Closes: https://github.com/vercel/next.js/issues/20545 | errors/invalid-webpack-5-version.md | @@ -0,0 +1,13 @@
+# Invalid webpack 5 version
+
+#### Why This Error Occurred
+
+While leveraging webpack 5 support in Next.js the minimum required version of `v5.11.1` was not met. This version is needed while leveraging webpack 5 support with Next.js as early versions are missing patches that cause unexpected behavio... | true |
Other | vercel | next.js | c93c9fcc78b6e872a68b533bbcf6dd8ecb1adf03.json | Add error for invalid webpack 5 version (#20558)
Closes: https://github.com/vercel/next.js/issues/20545 | packages/next/build/webpack-config.ts | @@ -64,6 +64,12 @@ type ExcludesFalse = <T>(x: T | false) => x is T
const isWebpack5 = parseInt(webpack.version!) === 5
+if (isWebpack5 && semver.lt(webpack.version!, '5.11.1')) {
+ throw new Error(
+ `webpack 5 version must be greater than v5.11.1 to work properly with Next.js, please upgrade to continue!\nSe... | true |
Other | vercel | next.js | 69ff649999a1f0689a9dd7a904ae6840f17d7174.json | Remove "priority" prop from Image docs (#20471)
I don't think the docs should still mention the `priority` prop because the feature no longer exists since this was merged - https://github.com/vercel/next.js/pull/19118
It certainly caught me out! 😬 https://github.com/vercel/next.js/issues/20438 | docs/api-reference/next/image.md | @@ -103,11 +103,11 @@ We recommend setting `sizes` when `layout="responsive"` and your image will not
The quality of the optimized image, an integer between 1 and 100 where 100 is the best quality. Defaults to 75.
-### priority
+<!-- ### priority
When true, the image will be considered high priority and [preloa... | false |
Other | vercel | next.js | ec0c70a043ff85e1742a09322b2056a73bfefca8.json | ci: adjust Azure Pipelines trigger (#20554) | azure-pipelines.yml | @@ -1,3 +1,25 @@
+trigger:
+ # Only run latest commit for branches:
+ batch: true
+ # Do not run Azure CI for docs-only/example-only changes:
+ paths:
+ include:
+ - '*'
+ exclude:
+ - bench/*
+ - docs/*
+ - errors/*
+ - examples/*
+ # Do not run Azure on `canary`, `master`, or relea... | false |
Other | vercel | next.js | 47433b62ba21321fa9059abb8d089e1e02d1e9cd.json | Correct import comment in interfaces (#20052)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> | examples/with-typescript/interfaces/index.ts | @@ -2,7 +2,7 @@
// and then use them in any component by importing them. For
// example, to import the interface below do:
//
-// import User from 'path/to/interfaces';
+// import { User } from 'path/to/interfaces';
export type User = {
id: number | false |
Other | vercel | next.js | 556ab4f169a362e414b3b765272aae5675278df5.json | Upgrade Tailwindcss to 2.0.2 (#20517)
Normally I wouldn't make a PR for a minor version upgrade, but the 2.0.2 version contains some important performance improvements.
https://github.com/tailwindlabs/tailwindcss/pull/3032 | examples/with-tailwindcss/package.json | @@ -14,7 +14,7 @@
"devDependencies": {
"autoprefixer": "10.0.2",
"postcss": "8.1.7",
- "tailwindcss": "^2.0.1"
+ "tailwindcss": "^2.0.2"
},
"license": "MIT"
} | false |
Other | vercel | next.js | e4da4e5aaaaa7fd488506594b9482a208eb4ce88.json | fix example using-router import wrong pathname (#20536)

About page import wrong pathname causing warning like this. | examples/using-router/pages/about.js | @@ -1,4 +1,4 @@
-import Header from '../components/header'
+import Header from '../components/Header'
export default function About() {
return ( | false |
Other | vercel | next.js | d96de6ea6b52e152388c6b6a8ef40a1fe61acc6c.json | Fix typos found on examples docs (#20516)
This PR fixes some typos found on examples docs | examples/with-ant-design-mobile/README.md | @@ -1,6 +1,6 @@
# Ant Design Mobile example
-This example features how you use [antd-mobile](https://github.com/ant-design/ant-design-mobile) (Ant Design Mobile FrontEnd Framwork) with Next.js.
+This example features how you use [antd-mobile](https://github.com/ant-design/ant-design-mobile) (Ant Design Mobile FrontE... | true |
Other | vercel | next.js | d96de6ea6b52e152388c6b6a8ef40a1fe61acc6c.json | Fix typos found on examples docs (#20516)
This PR fixes some typos found on examples docs | examples/with-deta-base/README.md | @@ -36,10 +36,10 @@ Then set each variable on `.env.local`:
- `DETA_PROJECT_KEY` should be the default _Project Key_ that you saved from step 1.
-The resulting `env.local` file shoule look like this:
+The resulting `env.local` file should look like this:
```bash
-DETA_PROEJECT_KEY=...
+DETA_PROJECT_KEY=...
```... | true |
Other | vercel | next.js | d96de6ea6b52e152388c6b6a8ef40a1fe61acc6c.json | Fix typos found on examples docs (#20516)
This PR fixes some typos found on examples docs | examples/with-electron-typescript/README.md | @@ -29,7 +29,7 @@ Available commands:
"build-electron": transpile electron layer
"build": build both layers
"dev": start dev version
-"dist": create production elctron build
+"dist": create production electron build
"type-check": check TypeScript in project
```
| true |
Other | vercel | next.js | d96de6ea6b52e152388c6b6a8ef40a1fe61acc6c.json | Fix typos found on examples docs (#20516)
This PR fixes some typos found on examples docs | examples/with-env-from-next-config-js/README.md | @@ -46,4 +46,4 @@ following behavior while you are doing development.
- When you run `next build` then `next start`, assuming you set externally the environmental variable STAGING to anything but 1, you will get the results assuming `isProd` is true.
- When your run `next build` or `npm run build` in production, if t... | true |
Other | vercel | next.js | d96de6ea6b52e152388c6b6a8ef40a1fe61acc6c.json | Fix typos found on examples docs (#20516)
This PR fixes some typos found on examples docs | examples/with-firebase-hosting/README.md | @@ -54,7 +54,7 @@ Then you can create components and pages in `.tsx` or `.ts`
## Good to know
- [`firebase.json`](firebase.json:#L7) outlines the catchall rewrite rule for our Cloud Function.
-- The empty `public/.gitignore` file is to ensure `public/` dir exists as it is required for Firebase Hosting. It is [confi... | true |
Other | vercel | next.js | c8837dcbda055a3b145a84113fc5e4e193dc286b.json | Upgrade all http links to https (#20402)
Upgraded all `http` links to `https` that support the `https` protocol.
Llinks
-----
- https://github.com/
- https://koajs.com
- https://ant.design
- https://www.carbondesignsystem.com/components/overview
- https://themes.carbondesignsystem.com
- https://knexjs.org
- https://j... | docs/deployment.md | @@ -10,7 +10,7 @@ The easiest way to deploy Next.js to production is to use the **[Vercel platform
### Getting started
-If you haven’t already done so, push your Next.js app to a Git provider of your choice: [GitHub](http://github.com/), [GitLab](https://gitlab.com/), or [BitBucket](https://bitbucket.org/). Your r... | true |
Other | vercel | next.js | c8837dcbda055a3b145a84113fc5e4e193dc286b.json | Upgrade all http links to https (#20402)
Upgraded all `http` links to `https` that support the `https` protocol.
Llinks
-----
- https://github.com/
- https://koajs.com
- https://ant.design
- https://www.carbondesignsystem.com/components/overview
- https://themes.carbondesignsystem.com
- https://knexjs.org
- https://j... | examples/custom-server-koa/README.md | @@ -2,7 +2,7 @@
Most of the times the default Next server will be enough but sometimes you want to run your own server to customize routes or other kind of the app behavior. Next provides a [Custom server and routing](https://nextjs.org/docs/advanced-features/custom-server) so you can customize as much as you want.
... | true |
Other | vercel | next.js | c8837dcbda055a3b145a84113fc5e4e193dc286b.json | Upgrade all http links to https (#20402)
Upgraded all `http` links to `https` that support the `https` protocol.
Llinks
-----
- https://github.com/
- https://koajs.com
- https://ant.design
- https://www.carbondesignsystem.com/components/overview
- https://themes.carbondesignsystem.com
- https://knexjs.org
- https://j... | examples/with-ant-design-less/README.md | @@ -1,6 +1,6 @@
# Ant Design example
-This example shows how to use Next.js along with [Ant Design of React](http://ant.design). This is intended to show the integration of this UI toolkit with the Framework.
+This example shows how to use Next.js along with [Ant Design of React](https://ant.design). This is intende... | true |
Other | vercel | next.js | c8837dcbda055a3b145a84113fc5e4e193dc286b.json | Upgrade all http links to https (#20402)
Upgraded all `http` links to `https` that support the `https` protocol.
Llinks
-----
- https://github.com/
- https://koajs.com
- https://ant.design
- https://www.carbondesignsystem.com/components/overview
- https://themes.carbondesignsystem.com
- https://knexjs.org
- https://j... | examples/with-ant-design/README.md | @@ -1,6 +1,6 @@
# Ant Design example
-This example shows how to use Next.js along with [Ant Design of React](http://ant.design). This is intended to show the integration of this UI toolkit with the Framework.
+This example shows how to use Next.js along with [Ant Design of React](https://ant.design). This is intende... | true |
Other | vercel | next.js | c8837dcbda055a3b145a84113fc5e4e193dc286b.json | Upgrade all http links to https (#20402)
Upgraded all `http` links to `https` that support the `https` protocol.
Llinks
-----
- https://github.com/
- https://koajs.com
- https://ant.design
- https://www.carbondesignsystem.com/components/overview
- https://themes.carbondesignsystem.com
- https://knexjs.org
- https://j... | examples/with-carbon-components/README.md | @@ -1,8 +1,8 @@
# Example app with carbon-components-react
-This example features how you use IBM's [carbon-components-react](https://github.com/IBM/carbon-components-react) [(Carbon Design System)](http://www.carbondesignsystem.com/components/overview) with Next.js.
+This example features how you use IBM's [carbon-... | true |
Other | vercel | next.js | c8837dcbda055a3b145a84113fc5e4e193dc286b.json | Upgrade all http links to https (#20402)
Upgraded all `http` links to `https` that support the `https` protocol.
Llinks
-----
- https://github.com/
- https://koajs.com
- https://ant.design
- https://www.carbondesignsystem.com/components/overview
- https://themes.carbondesignsystem.com
- https://knexjs.org
- https://j... | examples/with-knex/README.md | @@ -1,6 +1,6 @@
## Example app using Knex
-[Knex](http://knexjs.org/) is a SQL query builder that works with a variety of SQL databases including Postgres and MySQL. This example shows you how to use Knex with Next.js to connect and query a Postgres database. The same code can also connect to all other databases sup... | true |
Other | vercel | next.js | c8837dcbda055a3b145a84113fc5e4e193dc286b.json | Upgrade all http links to https (#20402)
Upgraded all `http` links to `https` that support the `https` protocol.
Llinks
-----
- https://github.com/
- https://koajs.com
- https://ant.design
- https://www.carbondesignsystem.com/components/overview
- https://themes.carbondesignsystem.com
- https://knexjs.org
- https://j... | examples/with-rebass/README.md | @@ -1,6 +1,6 @@
# Example app with Rebass
-This example features how you use [Rebass](http://jxnblk.com/rebass/) functional UI library with Next.js.
+This example features how you use [Rebass](https://jxnblk.com/rebass/) functional UI library with Next.js.

Upgraded all `http` links to `https` that support the `https` protocol.
Llinks
-----
- https://github.com/
- https://koajs.com
- https://ant.design
- https://www.carbondesignsystem.com/components/overview
- https://themes.carbondesignsystem.com
- https://knexjs.org
- https://j... | examples/with-redux-saga/README.md | @@ -26,7 +26,7 @@ Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&ut
In the first example we are going to display a digital clock that updates every second. The first render is happening in the server and then the browser will take over. To illustrate this, the server rendered clock wil... | true |
Other | vercel | next.js | c8837dcbda055a3b145a84113fc5e4e193dc286b.json | Upgrade all http links to https (#20402)
Upgraded all `http` links to `https` that support the `https` protocol.
Llinks
-----
- https://github.com/
- https://koajs.com
- https://ant.design
- https://www.carbondesignsystem.com/components/overview
- https://themes.carbondesignsystem.com
- https://knexjs.org
- https://j... | examples/with-redux-wrapper/README.md | @@ -24,7 +24,7 @@ Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&ut
In the first example we are going to display a digital clock that updates every second. The first render is happening in the server and then the browser will take over. To illustrate this, the server rendered clock wil... | true |
Other | vercel | next.js | c8837dcbda055a3b145a84113fc5e4e193dc286b.json | Upgrade all http links to https (#20402)
Upgraded all `http` links to `https` that support the `https` protocol.
Llinks
-----
- https://github.com/
- https://koajs.com
- https://ant.design
- https://www.carbondesignsystem.com/components/overview
- https://themes.carbondesignsystem.com
- https://knexjs.org
- https://j... | examples/with-semantic-ui/README.md | @@ -1,6 +1,6 @@
# Semantic UI example
-This example shows how to use Next.js along with [Semantic UI React](http://react.semantic-ui.com) including handling of external styles and assets. This is intended to show the integration of this UI toolkit with the Framework.
+This example shows how to use Next.js along with... | true |
Other | vercel | next.js | c8837dcbda055a3b145a84113fc5e4e193dc286b.json | Upgrade all http links to https (#20402)
Upgraded all `http` links to `https` that support the `https` protocol.
Llinks
-----
- https://github.com/
- https://koajs.com
- https://ant.design
- https://www.carbondesignsystem.com/components/overview
- https://themes.carbondesignsystem.com
- https://knexjs.org
- https://j... | examples/with-stomp/README.md | @@ -1,6 +1,6 @@
# Stomp example
-This example show how to use [STOMP](http://stomp.github.io/) inside a Next.js application.
+This example show how to use [STOMP](https://stomp.github.io/) inside a Next.js application.
STOMP is a simple text-orientated messaging protocol. It defines an interoperable wire format s... | true |
Other | vercel | next.js | c8837dcbda055a3b145a84113fc5e4e193dc286b.json | Upgrade all http links to https (#20402)
Upgraded all `http` links to `https` that support the `https` protocol.
Llinks
-----
- https://github.com/
- https://koajs.com
- https://ant.design
- https://www.carbondesignsystem.com/components/overview
- https://themes.carbondesignsystem.com
- https://knexjs.org
- https://j... | examples/with-videojs/README.md | @@ -1,6 +1,6 @@
# video.js example
-This example shows how to use Next.js along with [Video.js](http://videojs.com) including handling of default styles.
+This example shows how to use Next.js along with [Video.js](https://videojs.com) including handling of default styles.
## Deploy your own
| true |
Other | vercel | next.js | c3884e683717b8b7764adb26408a17d1cf84bc99.json | Update graphql example (#27334)
## Documentation / Examples
This is an update to the [GraphQL example](https://github.com/vercel/next.js/tree/canary/examples/api-routes-graphql) to use [apollo server 3](https://www.apollographql.com/docs/apollo-server). This example works with Apollo Studio | examples/api-routes-graphql/package.json | @@ -6,12 +6,13 @@
"start": "next start"
},
"dependencies": {
- "apollo-server-micro": "2.11.0",
- "graphql": "14.6.0",
+ "apollo-server-micro": "^3.0.1",
+ "graphql": "^15.5.1",
+ "micro": "^9.3.4",
"next": "latest",
"react": "^17.0.2",
"react-dom": "^17.0.2",
- "swr": "0.1.1... | true |
Other | vercel | next.js | c3884e683717b8b7764adb26408a17d1cf84bc99.json | Update graphql example (#27334)
## Documentation / Examples
This is an update to the [GraphQL example](https://github.com/vercel/next.js/tree/canary/examples/api-routes-graphql) to use [apollo server 3](https://www.apollographql.com/docs/apollo-server). This example works with Apollo Studio | examples/api-routes-graphql/pages/api/graphql.js | @@ -19,10 +19,27 @@ const resolvers = {
const apolloServer = new ApolloServer({ typeDefs, resolvers })
+const startServer = apolloServer.start()
+
+export default async function handler(req, res) {
+ if (req.method === 'OPTIONS') {
+ res.end()
+ return false
+ }
+ res.setHeader('Access-Control-Allow-Crede... | true |
Other | vercel | next.js | 41b4fc368801146bbbcd235615deac77dbd92c66.json | Upgrade swc for mac m1 compiling issue (#27329)
`@swc/core` will trigger a very rare complication issue on mac m1, it's fixed in version 1.2.66
x-ref: https://github.com/swc-project/swc/pull/1939
cc @kdy1
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have hel... | package.json | @@ -47,6 +47,7 @@
"@fullhuman/postcss-purgecss": "1.3.0",
"@mdx-js/loader": "0.18.0",
"@svgr/webpack": "5.5.0",
+ "@swc/core": "1.2.66",
"@testing-library/react": "11.2.5",
"@types/cheerio": "0.22.16",
"@types/fs-extra": "8.1.0",
@@ -138,8 +139,7 @@
"wait-port": "0.2.2",
"web-... | true |
Other | vercel | next.js | 41b4fc368801146bbbcd235615deac77dbd92c66.json | Upgrade swc for mac m1 compiling issue (#27329)
`@swc/core` will trigger a very rare complication issue on mac m1, it's fixed in version 1.2.66
x-ref: https://github.com/swc-project/swc/pull/1939
cc @kdy1
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have hel... | yarn.lock | @@ -3705,85 +3705,85 @@
"@svgr/plugin-svgo" "^5.5.0"
loader-utils "^2.0.0"
-"@swc/core-android-arm64@^1.2.63":
- version "1.2.63"
- resolved "https://registry.yarnpkg.com/@swc/core-android-arm64/-/core-android-arm64-1.2.63.tgz#e12ce194dc4066c8361975eb7d22141c44d94804"
- integrity sha512-3Q43hlq4C2EX1jcFe... | true |
Other | vercel | next.js | 0472f0fa819a4974a9624542603fd8a3c2639e73.json | Fix image link (#27323) | examples/cms-sanity/components/cover-image.js | @@ -21,7 +21,7 @@ export default function CoverImage({ title, slug, image: source }) {
return (
<div className="sm:mx-0">
{slug ? (
- <Link href={slug}>
+ <Link href={`/posts/${slug}`}>
<a aria-label={title}>{image}</a>
</Link>
) : ( | false |
Other | vercel | next.js | c082972b9393693096a2dc857ce09039ef154903.json | Continue: fix typo in breakpoint config (#27313) | examples/with-stitches/stitches.config.js | @@ -67,7 +67,7 @@ export const { css, styled, global, getCssString } = createCss({
}),
},
media: {
- bp1: '@media (min-width: 520px)',
- bp2: '@media (min-width: 900px)',
+ bp1: '(min-width: 520px)',
+ bp2: '(min-width: 900px)',
},
}) | false |
Other | vercel | next.js | f21cba4929d582ad164d7a7476c4205c5d091e5c.json | Increase stats action install timeout (#27308)
This updates the PR stats action to add the `--network-timeout 1000000` flag when doing initial `yarn` installation to hopefully prevent the random `yarn` failures while it's running. Thanks @styfle for the tip! | .github/actions/next-stats-action/src/index.js | @@ -102,7 +102,9 @@ if (!allowedActions.has(actionInfo.actionName) && !actionInfo.isRelease) {
logger(`Running initial build for ${dir}`)
if (!actionInfo.skipClone) {
let buildCommand = `cd ${dir}${
- !statsConfig.skipInitialInstall ? ' && yarn install' : ''
+ !statsConfig.skipI... | false |
Other | vercel | next.js | 7fea8f3de779814bcae2c7d8ecd736f3234757f8.json | Remove redundant ssr option for styled-components (#27221)
Co-authored-by: JJ Kasper <jj@jjsweb.site> | examples/with-styled-components/.babelrc | @@ -1,4 +1,4 @@
{
"presets": ["next/babel"],
- "plugins": [["styled-components", { "ssr": true }]]
+ "plugins": ["styled-components"]
} | false |
Other | vercel | next.js | 6e99f7af39d5a31bab8c227e945bd3e765b3d3fe.json | Add note about beforeFiles continuing (#27211)
This adds a note explaining that `beforeFiles` continue instead of checking the filesystem/dynamic routes immediately like they do in `afterFiles` and `fallback`.
## Documentation / Examples
- [x] Make sure the linting passes
Closes: https://github.com/vercel/next.js/... | docs/api-reference/next.config.js/rewrites.md | @@ -87,6 +87,8 @@ module.exports = {
}
```
+Note: rewrites in `beforeFiles` do not check the filesystem/dynamic routes immediately after matching a source, they continue until all `beforeFiles` have been checked.
+
## Rewrite parameters
When using parameters in a rewrite the parameters will be passed in the que... | false |
Other | vercel | next.js | ccb62f8636f3f4a25d7ea58edd3d9747cd6c0f99.json | Add x-forward headers to external rewrites (#17557)
* Add x-forward headers to external rewrites
This commit configures the proxy used for external rewrites to include
x-forward headers [1]. This is particularly useful for incremental
adoption, where some routes will be handled by Next.js and others by a
differe... | packages/next/server/image-optimizer.ts | @@ -244,6 +244,7 @@ export async function imageOptimizer(
mockRes.setHeader = (name: string, value: string | string[]) =>
(mockHeaders[name.toLowerCase()] = value)
mockRes._implicitHeader = () => {}
+ mockRes.connection = res.connection
mockRes.finished = false
mock... | true |
Other | vercel | next.js | ccb62f8636f3f4a25d7ea58edd3d9747cd6c0f99.json | Add x-forward headers to external rewrites (#17557)
* Add x-forward headers to external rewrites
This commit configures the proxy used for external rewrites to include
x-forward headers [1]. This is particularly useful for incremental
adoption, where some routes will be handled by Next.js and others by a
differe... | packages/next/server/next-server.ts | @@ -963,6 +963,7 @@ export default class Server {
target,
changeOrigin: true,
ignorePath: true,
+ xfwd: true,
proxyTimeout: 30_000, // limit proxying to 30 seconds
})
| true |
Other | vercel | next.js | ccb62f8636f3f4a25d7ea58edd3d9747cd6c0f99.json | Add x-forward headers to external rewrites (#17557)
* Add x-forward headers to external rewrites
This commit configures the proxy used for external rewrites to include
x-forward headers [1]. This is particularly useful for incremental
adoption, where some routes will be handled by Next.js and others by a
differe... | test/integration/custom-routes/test/index.test.js | @@ -646,7 +646,9 @@ const runTests = (isDev = false) => {
},
},
])
- expect(await res.text()).toContain('hi from external')
+ const nextHost = `localhost:${appPort}`
+ const externalHost = `localhost:${externalServerPort}`
+ expect(await res.text()).toContain(`hi ${nextHost} from ${exte... | true |
Other | vercel | next.js | 3fc5f73dc9232acc67bcf9a24e1c2218a8c6dcab.json | Fix typo in env howto (#27227) | docs/basic-features/environment-variables.md | @@ -110,7 +110,7 @@ Next.js allows you to set defaults in `.env` (all environments), `.env.developme
`.env.local` always overrides the defaults set.
-> **Note**: `.env`, `.env.development`, and `.env.production` files should be included in your repository as they define defaults. **`.env*.local` should be added to... | false |
Other | vercel | next.js | f9795fdd2665369b60a153fbb6231f478e4a7d08.json | improve static generation UX (#27171)
#### improve export spinner
update at least once a minute in non-tty
update progress regularly when using the spinner
decrease frequency of the spinner (windows console output is expensive)
#### restart static page generation and collecting page data worker pools when hanging
w... | errors/manifest.json | @@ -414,6 +414,14 @@
{
"title": "import-esm-externals",
"path": "/errors/import-esm-externals.md"
+ },
+ {
+ "title": "static-page-generation-timeout",
+ "path": "/errors/static-page-generation-timeout.md"
+ },
+ {
+ "title": "page-da... | true |
Other | vercel | next.js | f9795fdd2665369b60a153fbb6231f478e4a7d08.json | improve static generation UX (#27171)
#### improve export spinner
update at least once a minute in non-tty
update progress regularly when using the spinner
decrease frequency of the spinner (windows console output is expensive)
#### restart static page generation and collecting page data worker pools when hanging
w... | errors/page-data-collection-timeout.md | @@ -0,0 +1,18 @@
+# Collecting page data timed out after multiple attempts
+
+#### Why This Error Occurred
+
+Next.js tries to restart the worker pool of the page data collection when no progress happens for a while, to avoid hanging builds.
+
+When restarted it will retry all uncompleted jobs, but if a job was unsucce... | true |
Other | vercel | next.js | f9795fdd2665369b60a153fbb6231f478e4a7d08.json | improve static generation UX (#27171)
#### improve export spinner
update at least once a minute in non-tty
update progress regularly when using the spinner
decrease frequency of the spinner (windows console output is expensive)
#### restart static page generation and collecting page data worker pools when hanging
w... | errors/static-page-generation-timeout.md | @@ -0,0 +1,18 @@
+# Static page generation timed out after multiple attempts
+
+#### Why This Error Occurred
+
+Next.js tries to restart the worker pool of the static page generation when no progress happens for a while, to avoid hanging builds.
+
+When restarted it will retry all uncompleted jobs, but if a job was uns... | true |
Other | vercel | next.js | f9795fdd2665369b60a153fbb6231f478e4a7d08.json | improve static generation UX (#27171)
#### improve export spinner
update at least once a minute in non-tty
update progress regularly when using the spinner
decrease frequency of the spinner (windows console output is expensive)
#### restart static page generation and collecting page data worker pools when hanging
w... | packages/next/build/index.ts | @@ -2,7 +2,7 @@ import { loadEnvConfig } from '@next/env'
import chalk from 'chalk'
import crypto from 'crypto'
import { promises, writeFileSync } from 'fs'
-import { Worker } from 'jest-worker'
+import { Worker } from '../lib/worker'
import devalue from 'next/dist/compiled/devalue'
import escapeStringRegexp from ... | true |
Other | vercel | next.js | f9795fdd2665369b60a153fbb6231f478e4a7d08.json | improve static generation UX (#27171)
#### improve export spinner
update at least once a minute in non-tty
update progress regularly when using the spinner
decrease frequency of the spinner (windows console output is expensive)
#### restart static page generation and collecting page data worker pools when hanging
w... | packages/next/build/utils.ts | @@ -67,6 +67,8 @@ export interface PageInfo {
isSsg: boolean
ssgPageRoutes: string[] | null
initialRevalidateSeconds: number | false
+ pageDuration: number | undefined
+ ssgPageDurations: number[] | undefined
}
export async function printTreeView(
@@ -101,6 +103,17 @@ export async function printTreeView(... | true |
Other | vercel | next.js | f9795fdd2665369b60a153fbb6231f478e4a7d08.json | improve static generation UX (#27171)
#### improve export spinner
update at least once a minute in non-tty
update progress regularly when using the spinner
decrease frequency of the spinner (windows console output is expensive)
#### restart static page generation and collecting page data worker pools when hanging
w... | packages/next/export/index.ts | @@ -7,7 +7,7 @@ import {
readFileSync,
writeFileSync,
} from 'fs'
-import { Worker } from 'jest-worker'
+import { Worker } from '../lib/worker'
import { dirname, join, resolve, sep } from 'path'
import { promisify } from 'util'
import { AmpPageStatus, formatAmpMessages } from '../build/output/index'
@@ -40,7 ... | true |
Other | vercel | next.js | f9795fdd2665369b60a153fbb6231f478e4a7d08.json | improve static generation UX (#27171)
#### improve export spinner
update at least once a minute in non-tty
update progress regularly when using the spinner
decrease frequency of the spinner (windows console output is expensive)
#### restart static page generation and collecting page data worker pools when hanging
w... | packages/next/export/worker.ts | @@ -61,6 +61,7 @@ interface ExportPageResults {
fromBuildExportRevalidate?: number
error?: boolean
ssgNotFound?: boolean
+ duration: number
}
interface RenderOpts {
@@ -105,7 +106,8 @@ export default async function exportPage({
const exportPageSpan = trace('export-page-worker', parentSpanId)
retur... | true |
Other | vercel | next.js | f9795fdd2665369b60a153fbb6231f478e4a7d08.json | improve static generation UX (#27171)
#### improve export spinner
update at least once a minute in non-tty
update progress regularly when using the spinner
decrease frequency of the spinner (windows console output is expensive)
#### restart static page generation and collecting page data worker pools when hanging
w... | packages/next/lib/worker.ts | @@ -0,0 +1,88 @@
+import { Worker as JestWorker } from 'jest-worker'
+
+type FarmOptions = ConstructorParameters<typeof JestWorker>[1]
+
+const RESTARTED = Symbol('restarted')
+
+export class Worker {
+ private _worker: JestWorker | undefined
+
+ constructor(
+ workerPath: string,
+ options: FarmOptions & {
+ ... | true |
Other | vercel | next.js | f9795fdd2665369b60a153fbb6231f478e4a7d08.json | improve static generation UX (#27171)
#### improve export spinner
update at least once a minute in non-tty
update progress regularly when using the spinner
decrease frequency of the spinner (windows console output is expensive)
#### restart static page generation and collecting page data worker pools when hanging
w... | packages/next/server/config-shared.ts | @@ -94,6 +94,8 @@ export type NextConfig = { [key: string]: any } & {
gzipSize?: boolean
craCompat?: boolean
esmExternals?: boolean | 'loose'
+ staticPageGenerationTimeout?: number
+ pageDataCollectionTimeout?: number
}
}
@@ -157,6 +159,8 @@ export const defaultConfig: NextConfig = {
gzi... | true |
Other | vercel | next.js | f9795fdd2665369b60a153fbb6231f478e4a7d08.json | improve static generation UX (#27171)
#### improve export spinner
update at least once a minute in non-tty
update progress regularly when using the spinner
decrease frequency of the spinner (windows console output is expensive)
#### restart static page generation and collecting page data worker pools when hanging
w... | test/integration/build-output/fixtures/basic-app/pages/slow-static/[propsDuration]/[renderDuration].js | @@ -0,0 +1,34 @@
+export default ({ renderDuration }) => {
+ const target = Date.now() + (+renderDuration || 200)
+ while (Date.now() < target);
+ return <div>{renderDuration}</div>
+}
+
+export function getStaticPaths() {
+ return {
+ paths: [
+ [2000, 10],
+ [5, 5],
+ [25, 25],
+ [20, 20],
... | true |
Other | vercel | next.js | f9795fdd2665369b60a153fbb6231f478e4a7d08.json | improve static generation UX (#27171)
#### improve export spinner
update at least once a minute in non-tty
update progress regularly when using the spinner
decrease frequency of the spinner (windows console output is expensive)
#### restart static page generation and collecting page data worker pools when hanging
w... | test/integration/build-output/test/index.test.js | @@ -43,7 +43,7 @@ describe('Build Output', () => {
stdout: true,
}))
- expect(stdout).toMatch(/\/ [ ]* \d{1,} B/)
+ expect(stdout).toMatch(/\/ (.* )?\d{1,} B/)
expect(stdout).toMatch(/\+ First Load JS shared by all [ 0-9.]* kB/)
expect(stdout).toMatch(/ ... | true |
Other | vercel | next.js | 3b388c346c6990c98e83357ad68263edc7081210.json | Fix Script beforeInteractive on navigation (#26995)
## Bug
- [x] fixes #26342
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
## Documentation / Examples
- [x] Make sure the linting passes | packages/next/client/script.tsx | @@ -152,6 +152,8 @@ function Script(props: ScriptProps): JSX.Element | null {
},
])
updateScripts(scripts)
+ } else {
+ loadScript(props)
}
}
| true |
Other | vercel | next.js | 3b388c346c6990c98e83357ad68263edc7081210.json | Fix Script beforeInteractive on navigation (#26995)
## Bug
- [x] fixes #26342
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
## Documentation / Examples
- [x] Make sure the linting passes | test/integration/script-loader/pages/index.js | @@ -1,4 +1,5 @@
import Script from 'next/script'
+import Link from 'next/link'
const Page = () => {
return (
@@ -8,6 +9,7 @@ const Page = () => {
src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.20/lodash.min.js?a=scriptAfterInteractive"
></Script>
<div>index</div>
+ <Link h... | true |
Other | vercel | next.js | 3b388c346c6990c98e83357ad68263edc7081210.json | Fix Script beforeInteractive on navigation (#26995)
## Bug
- [x] fixes #26342
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
## Documentation / Examples
- [x] Make sure the linting passes | test/integration/script-loader/test/index.test.js | @@ -43,13 +43,13 @@ describe('Script Loader', () => {
async function test(id) {
const script = await browser.elementById(id)
const endScripts = await browser.elementsByCss(
- `#${id} ~ script[src^="/_next/static/"]`
+ `#__NEXT_DATA__ ~ #${id}`
)
// Renders ... | true |
Other | vercel | next.js | 71665b2437fbd83f833d197081506adef412ac0f.json | Fix gsp generation with file extension (#27144)
Fixes #11831
Fixes #12212
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md` | packages/next/export/worker.ts | @@ -199,15 +199,22 @@ export default async function exportPage({
publicRuntimeConfig: renderOpts.runtimeConfig,
})
- let htmlFilename = `${filePath}${sep}index.html`
- if (!subFolders) htmlFilename = `${filePath}.html`
+ const getHtmlFilename = (_path: string) =>
+ subFolders ? `... | true |
Other | vercel | next.js | 71665b2437fbd83f833d197081506adef412ac0f.json | Fix gsp generation with file extension (#27144)
Fixes #11831
Fixes #12212
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md` | test/integration/gsp-extension/pages/[slug].js | @@ -0,0 +1,20 @@
+export default function Page({ value }) {
+ return value
+}
+
+export const getStaticProps = ({ params }) => ({
+ props: {
+ value: params.slug,
+ },
+})
+
+export const getStaticPaths = () => {
+ return {
+ paths: [
+ { params: { slug: '1' } },
+ { params: { slug: '2.ext' } },
+ ... | true |
Other | vercel | next.js | 71665b2437fbd83f833d197081506adef412ac0f.json | Fix gsp generation with file extension (#27144)
Fixes #11831
Fixes #12212
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md` | test/integration/gsp-extension/test/index.test.js | @@ -0,0 +1,59 @@
+/* eslint-env jest */
+
+import fs from 'fs-extra'
+import { join } from 'path'
+import {
+ fetchViaHTTP,
+ findPort,
+ killApp,
+ nextBuild,
+ nextStart,
+ renderViaHTTP,
+} from 'next-test-utils'
+
+jest.setTimeout(1000 * 60 * 2)
+const appDir = join(__dirname, '..')
+
+let appPort
+let app
+c... | true |
Other | vercel | next.js | d29a95ad633e16fca3c37255d395a243eba3dab6.json | Change pure functions to functions (#27192)
The right terminology should be used so we don't learn new developers wrong facts.
Using pure function here is plain wrong, the definition of a pure functions is as follows:
> The function return values are identical for identical arguments. The function application has no... | docs/api-routes/api-middlewares.md | @@ -119,7 +119,7 @@ export default handler
## Extending the `req`/`res` objects with TypeScript
-For better type-safety, it is not recommended to extend the `req` and `res` objects. Instead, use pure functions to work with them:
+For better type-safety, it is not recommended to extend the `req` and `res` objects. ... | false |
Other | vercel | next.js | fdabeb7098f8d5d02e232c981f502e0a8c1d7801.json | Use SWC to compile Next.js core server files (#27167)
- Use SWC to compile Next.js core server files
- Ensure only @babel/runtime/helpers/interopRequireDefault helper is used
Just an initial comparison to compare size difference of this change.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integr... | package.json | @@ -138,7 +138,8 @@
"wait-port": "0.2.2",
"web-streams-polyfill": "2.1.1",
"webpack-bundle-analyzer": "4.3.0",
- "worker-loader": "3.0.7"
+ "worker-loader": "3.0.7",
+ "@swc/core": "1.2.63"
},
"resolutions": {
"browserslist": "4.16.6", | true |
Other | vercel | next.js | fdabeb7098f8d5d02e232c981f502e0a8c1d7801.json | Use SWC to compile Next.js core server files (#27167)
- Use SWC to compile Next.js core server files
- Ensure only @babel/runtime/helpers/interopRequireDefault helper is used
Just an initial comparison to compare size difference of this change.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integr... | packages/next/client/dev/error-overlay/hot-dev-client.js | @@ -26,7 +26,12 @@
// can be found here:
// https://github.com/facebook/create-react-app/blob/v3.4.1/packages/react-dev-utils/webpackHotDevClient.js
-import * as DevOverlay from '@next/react-dev-overlay/lib/client'
+import {
+ register,
+ onBuildError,
+ onBuildOk,
+ onRefresh,
+} from '@next/react-dev-overlay/... | true |
Other | vercel | next.js | fdabeb7098f8d5d02e232c981f502e0a8c1d7801.json | Use SWC to compile Next.js core server files (#27167)
- Use SWC to compile Next.js core server files
- Ensure only @babel/runtime/helpers/interopRequireDefault helper is used
Just an initial comparison to compare size difference of this change.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integr... | packages/next/client/index.tsx | @@ -13,8 +13,11 @@ import Router, {
PrivateRouteInfo,
} from '../shared/lib/router/router'
import { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic'
-import * as querystring from '../shared/lib/router/utils/querystring'
-import * as envConfig from '../shared/lib/runtime-config'
+import {
+ urlQueryTo... | true |
Other | vercel | next.js | fdabeb7098f8d5d02e232c981f502e0a8c1d7801.json | Use SWC to compile Next.js core server files (#27167)
- Use SWC to compile Next.js core server files
- Ensure only @babel/runtime/helpers/interopRequireDefault helper is used
Just an initial comparison to compare size difference of this change.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integr... | packages/next/client/link.tsx | @@ -1,4 +1,4 @@
-import React, { Children, useEffect } from 'react'
+import React from 'react'
import { UrlObject } from 'url'
import {
addBasePath,
@@ -232,7 +232,7 @@ function Link(props: React.PropsWithChildren<LinkProps>) {
let child: any
if (process.env.NODE_ENV === 'development') {
try {
- ch... | true |
Other | vercel | next.js | fdabeb7098f8d5d02e232c981f502e0a8c1d7801.json | Use SWC to compile Next.js core server files (#27167)
- Use SWC to compile Next.js core server files
- Ensure only @babel/runtime/helpers/interopRequireDefault helper is used
Just an initial comparison to compare size difference of this change.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integr... | packages/next/client/next-dev.js | @@ -1,12 +1,15 @@
/* globals __REPLACE_NOOP_IMPORT__ */
-import initNext, * as next from './'
+import { initNext, version, router, emitter, render, renderError } from './'
import EventSourcePolyfill from './dev/event-source-polyfill'
import initOnDemandEntries from './dev/on-demand-entries-client'
import initWebpac... | true |
Other | vercel | next.js | fdabeb7098f8d5d02e232c981f502e0a8c1d7801.json | Use SWC to compile Next.js core server files (#27167)
- Use SWC to compile Next.js core server files
- Ensure only @babel/runtime/helpers/interopRequireDefault helper is used
Just an initial comparison to compare size difference of this change.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integr... | packages/next/client/next.js | @@ -1,5 +1,14 @@
-import initNext, * as next from './'
+import { initNext, version, router, emitter, render, renderError } from './'
-window.next = next
+window.next = {
+ version,
+ // router is initialized later so it has to be live-binded
+ get router() {
+ return router
+ },
+ emitter,
+ render,
+ rende... | true |
Other | vercel | next.js | fdabeb7098f8d5d02e232c981f502e0a8c1d7801.json | Use SWC to compile Next.js core server files (#27167)
- Use SWC to compile Next.js core server files
- Ensure only @babel/runtime/helpers/interopRequireDefault helper is used
Just an initial comparison to compare size difference of this change.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integr... | packages/next/client/page-loader.ts | @@ -9,7 +9,8 @@ import getAssetPathFromRoute from '../shared/lib/router/utils/get-asset-path-fro
import { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic'
import { parseRelativeUrl } from '../shared/lib/router/utils/parse-relative-url'
import { removePathTrailingSlash } from './normalize-trailing-slash'... | true |
Other | vercel | next.js | fdabeb7098f8d5d02e232c981f502e0a8c1d7801.json | Use SWC to compile Next.js core server files (#27167)
- Use SWC to compile Next.js core server files
- Ensure only @babel/runtime/helpers/interopRequireDefault helper is used
Just an initial comparison to compare size difference of this change.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integr... | packages/next/client/portal/index.tsx | @@ -1,4 +1,4 @@
-import * as React from 'react'
+import React from 'react'
import { createPortal } from 'react-dom'
type PortalProps = { | true |
Other | vercel | next.js | fdabeb7098f8d5d02e232c981f502e0a8c1d7801.json | Use SWC to compile Next.js core server files (#27167)
- Use SWC to compile Next.js core server files
- Ensure only @babel/runtime/helpers/interopRequireDefault helper is used
Just an initial comparison to compare size difference of this change.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integr... | packages/next/client/route-announcer.tsx | @@ -1,18 +1,18 @@
-import React, { useEffect, useState, useRef } from 'react'
+import React from 'react'
import { useRouter } from './router'
export function RouteAnnouncer() {
const { asPath } = useRouter()
- const [routeAnnouncement, setRouteAnnouncement] = useState('')
+ const [routeAnnouncement, setRouteAn... | true |
Other | vercel | next.js | fdabeb7098f8d5d02e232c981f502e0a8c1d7801.json | Use SWC to compile Next.js core server files (#27167)
- Use SWC to compile Next.js core server files
- Ensure only @babel/runtime/helpers/interopRequireDefault helper is used
Just an initial comparison to compare size difference of this change.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integr... | packages/next/client/route-loader.ts | @@ -285,7 +285,7 @@ function getFilesForRoute(
})
}
-function createRouteLoader(assetPrefix: string): RouteLoader {
+export function createRouteLoader(assetPrefix: string): RouteLoader {
const entrypoints: Map<
string,
Future<RouteEntrypoint> | RouteEntrypoint
@@ -423,5 +423,3 @@ function createRoute... | true |
Other | vercel | next.js | fdabeb7098f8d5d02e232c981f502e0a8c1d7801.json | Use SWC to compile Next.js core server files (#27167)
- Use SWC to compile Next.js core server files
- Ensure only @babel/runtime/helpers/interopRequireDefault helper is used
Just an initial comparison to compare size difference of this change.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integr... | packages/next/client/router.ts | @@ -1,6 +1,7 @@
/* global window */
import React from 'react'
-import Router, { NextRouter } from '../shared/lib/router/router'
+import Router from '../shared/lib/router/router'
+import type { NextRouter } from '../shared/lib/router/router'
import { RouterContext } from '../shared/lib/router-context'
type ClassAr... | true |
Other | vercel | next.js | fdabeb7098f8d5d02e232c981f502e0a8c1d7801.json | Use SWC to compile Next.js core server files (#27167)
- Use SWC to compile Next.js core server files
- Ensure only @babel/runtime/helpers/interopRequireDefault helper is used
Just an initial comparison to compare size difference of this change.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integr... | packages/next/package.json | @@ -59,7 +59,7 @@
"requires": [
"./taskfile-ncc.js",
"./taskfile-babel.js",
- "./taskfile-typescript.js"
+ "./taskfile-swc.js"
]
},
"dependencies": { | true |
Other | vercel | next.js | fdabeb7098f8d5d02e232c981f502e0a8c1d7801.json | Use SWC to compile Next.js core server files (#27167)
- Use SWC to compile Next.js core server files
- Ensure only @babel/runtime/helpers/interopRequireDefault helper is used
Just an initial comparison to compare size difference of this change.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integr... | packages/next/server/next.ts | @@ -112,7 +112,8 @@ export class NextServer {
const DevServer = require('./dev/next-dev-server').default
return new DevServer(options)
}
- return new (await getServerImpl())(options)
+ const ServerImplementation = await getServerImpl()
+ return new ServerImplementation(options)
}
pri... | true |
Other | vercel | next.js | fdabeb7098f8d5d02e232c981f502e0a8c1d7801.json | Use SWC to compile Next.js core server files (#27167)
- Use SWC to compile Next.js core server files
- Ensure only @babel/runtime/helpers/interopRequireDefault helper is used
Just an initial comparison to compare size difference of this change.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integr... | packages/next/taskfile-babel.js | @@ -18,6 +18,7 @@ const babelClientPresetEnvOptions = {
'transform-typeof-symbol',
'transform-async-to-generator',
'transform-spread',
+ 'proposal-object-rest-spread',
'proposal-dynamic-import',
],
}
@@ -33,6 +34,15 @@ const babelClientOpts = {
// eslint-disable-next-line no-useless-conc... | true |
Other | vercel | next.js | fdabeb7098f8d5d02e232c981f502e0a8c1d7801.json | Use SWC to compile Next.js core server files (#27167)
- Use SWC to compile Next.js core server files
- Ensure only @babel/runtime/helpers/interopRequireDefault helper is used
Just an initial comparison to compare size difference of this change.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integr... | packages/next/taskfile-swc.js | @@ -0,0 +1,91 @@
+// taskr babel plugin with Babel 7 support
+// https://github.com/lukeed/taskr/pull/305
+
+const path = require('path')
+
+// eslint-disable-next-line import/no-extraneous-dependencies
+const transform = require('@swc/core').transform
+
+module.exports = function (task) {
+ // eslint-disable-next-lin... | true |
Other | vercel | next.js | fdabeb7098f8d5d02e232c981f502e0a8c1d7801.json | Use SWC to compile Next.js core server files (#27167)
- Use SWC to compile Next.js core server files
- Ensure only @babel/runtime/helpers/interopRequireDefault helper is used
Just an initial comparison to compare size difference of this change.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integr... | packages/next/taskfile.js | @@ -821,39 +821,39 @@ export async function compile(task, opts) {
export async function bin(task, opts) {
await task
.source(opts.src || 'bin/*')
- .babel('server', { stripExtension: true, dev: opts.dev })
+ .swc('server', { stripExtension: true, dev: opts.dev })
.target('dist/bin', { mode: '0755' }... | true |
Other | vercel | next.js | fdabeb7098f8d5d02e232c981f502e0a8c1d7801.json | Use SWC to compile Next.js core server files (#27167)
- Use SWC to compile Next.js core server files
- Ensure only @babel/runtime/helpers/interopRequireDefault helper is used
Just an initial comparison to compare size difference of this change.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integr... | yarn.lock | @@ -3238,6 +3238,19 @@
call-me-maybe "^1.0.1"
glob-to-regexp "^0.3.0"
+"@napi-rs/triples@^1.0.2":
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/@napi-rs/triples/-/triples-1.0.2.tgz#2ce4c6a78568358772008f564ee5009093d20a19"
+ integrity sha512-EL3SiX43m9poFSnhDx4d4fn9SSaqyO2rHsCNhETi9bWPmjXK3u... | true |
Other | vercel | next.js | 8c3c2b7ea2c6ee5cfaeceae1137c2c352bf66dfa.json | Update redirect regexes to not match _next (#27143)
This updates redirects' regexes to not match `/_next` paths since this is currently unexpected and can easily cause a multi-match redirect to break loading client-side assets. This also fixes custom-routes not matching correctly when `trailingSlash: true/false` is us... | packages/next/build/index.ts | @@ -19,6 +19,7 @@ import { findPagesDir } from '../lib/find-pages-dir'
import loadCustomRoutes, {
CustomRoutes,
getRedirectStatus,
+ modifyRouteRegex,
normalizeRouteRegex,
Redirect,
Rewrite,
@@ -330,6 +331,10 @@ export default async function build(
)
}
+ const restrictedRedirectPaths =... | true |
Other | vercel | next.js | 8c3c2b7ea2c6ee5cfaeceae1137c2c352bf66dfa.json | Update redirect regexes to not match _next (#27143)
This updates redirects' regexes to not match `/_next` paths since this is currently unexpected and can easily cause a multi-match redirect to break loading client-side assets. This also fixes custom-routes not matching correctly when `trailingSlash: true/false` is us... | packages/next/lib/load-custom-routes.ts | @@ -65,6 +65,22 @@ export function normalizeRouteRegex(regex: string) {
return regex.replace(/\\\//g, '/')
}
+// for redirects we restrict matching /_next and for all routes
+// we add an optional trailing slash at the end for easier
+// configuring between trailingSlash: true/false
+export function modifyRouteRe... | true |
Other | vercel | next.js | 8c3c2b7ea2c6ee5cfaeceae1137c2c352bf66dfa.json | Update redirect regexes to not match _next (#27143)
This updates redirects' regexes to not match `/_next` paths since this is currently unexpected and can easily cause a multi-match redirect to break loading client-side assets. This also fixes custom-routes not matching correctly when `trailingSlash: true/false` is us... | packages/next/server/next-server.ts | @@ -18,6 +18,7 @@ import {
Rewrite,
RouteType,
CustomRoutes,
+ modifyRouteRegex,
} from '../lib/load-custom-routes'
import {
BUILD_ID_FILE,
@@ -822,11 +823,24 @@ export default class Server {
...staticFilesRoute,
]
+ const restrictedRedirectPaths = ['/_next'].map((p) =>
+ this.nextC... | true |
Other | vercel | next.js | 8c3c2b7ea2c6ee5cfaeceae1137c2c352bf66dfa.json | Update redirect regexes to not match _next (#27143)
This updates redirects' regexes to not match `/_next` paths since this is currently unexpected and can easily cause a multi-match redirect to break loading client-side assets. This also fixes custom-routes not matching correctly when `trailingSlash: true/false` is us... | packages/next/shared/lib/router/utils/path-match.ts | @@ -15,13 +15,19 @@ export const customRouteMatcherOptions: pathToRegexp.TokensToRegexpOptions &
}
export default (customRoute = false) => {
- return (path: string) => {
+ return (path: string, regexModifier?: (regex: string) => string) => {
const keys: pathToRegexp.Key[] = []
- const matcherRegex = pathT... | true |
Other | vercel | next.js | 8c3c2b7ea2c6ee5cfaeceae1137c2c352bf66dfa.json | Update redirect regexes to not match _next (#27143)
This updates redirects' regexes to not match `/_next` paths since this is currently unexpected and can easily cause a multi-match redirect to break loading client-side assets. This also fixes custom-routes not matching correctly when `trailingSlash: true/false` is us... | test/integration/custom-routes/next.config.js | @@ -378,6 +378,17 @@ module.exports = {
destination: '/another?host=1',
permanent: false,
},
+ {
+ source: '/:path/has-redirect-5',
+ has: [
+ {
+ type: 'header',
+ key: 'x-test-next',
+ },
+ ],
+ destination: '/somewhere'... | true |
Other | vercel | next.js | 8c3c2b7ea2c6ee5cfaeceae1137c2c352bf66dfa.json | Update redirect regexes to not match _next (#27143)
This updates redirects' regexes to not match `/_next` paths since this is currently unexpected and can easily cause a multi-match redirect to break loading client-side assets. This also fixes custom-routes not matching correctly when `trailingSlash: true/false` is us... | test/integration/custom-routes/test/index.test.js | @@ -233,6 +233,34 @@ const runTests = (isDev = false) => {
expect(res3location).toBe('/')
})
+ it('should not match redirect for /_next', async () => {
+ const res = await fetchViaHTTP(
+ appPort,
+ '/_next/has-redirect-5',
+ undefined,
+ {
+ headers: {
+ 'x-test-next':... | true |
Other | vercel | next.js | e0ff050402ae7d2e71abb9efaffd917d950c4c4d.json | Update the "Top level .mdx pages" code sample (#27080)
The regex matches both .md and .mdx extensions, so I've added the .md extension to the description and `pageExtensions` array.
## Documentation / Examples
- [x] Make sure the linting passes | packages/next-mdx/readme.md | @@ -61,15 +61,15 @@ module.exports = withMDX()
## Top level .mdx pages
-Define the `pageExtensions` option to have Next.js handle `.mdx` files in the `pages` directory as pages:
+Define the `pageExtensions` option to have Next.js handle `.md` and `.mdx` files in the `pages` directory as pages:
```js
// next.co... | false |
Other | vercel | next.js | 9c93c0543fce823e36ab4f5ccf826d0b71f503d9.json | Add some missing fields to the NextConfig type (#27126)
This adds some missing fields to the `NextConfig` type we expose under `next` and also adds a `NextConfigComplete` internal type that allows us to not treat all fields as optional like you would when using the type in `next.config.js`.
## Bug
- [ ] Related iss... | packages/next/build/entries.ts | @@ -9,7 +9,7 @@ import { warn } from './output/log'
import { ClientPagesLoaderOptions } from './webpack/loaders/next-client-pages-loader'
import { ServerlessLoaderQuery } from './webpack/loaders/next-serverless-loader'
import { LoadedEnvFiles } from '@next/env'
-import { NextConfig } from '../server/config'
+import ... | true |
Other | vercel | next.js | 9c93c0543fce823e36ab4f5ccf826d0b71f503d9.json | Add some missing fields to the NextConfig type (#27126)
This adds some missing fields to the `NextConfig` type we expose under `next` and also adds a `NextConfigComplete` internal type that allows us to not treat all fields as optional like you would when using the type in `next.config.js`.
## Bug
- [ ] Related iss... | packages/next/build/index.ts | @@ -52,10 +52,7 @@ import {
isDynamicRoute,
} from '../shared/lib/router/utils'
import { __ApiPreviewProps } from '../server/api-utils'
-import loadConfig, {
- isTargetLikeServerless,
- NextConfig,
-} from '../server/config'
+import loadConfig, { isTargetLikeServerless } from '../server/config'
import { BuildMa... | true |
Other | vercel | next.js | 9c93c0543fce823e36ab4f5ccf826d0b71f503d9.json | Add some missing fields to the NextConfig type (#27126)
This adds some missing fields to the `NextConfig` type we expose under `next` and also adds a `NextConfigComplete` internal type that allows us to not treat all fields as optional like you would when using the type in `next.config.js`.
## Bug
- [ ] Related iss... | packages/next/build/webpack-config.ts | @@ -27,7 +27,7 @@ import {
SERVER_DIRECTORY,
} from '../shared/lib/constants'
import { execOnce } from '../shared/lib/utils'
-import { NextConfig } from '../server/config'
+import { NextConfigComplete } from '../server/config-shared'
import { findPageFile } from '../server/lib/find-page-file'
import { WebpackEnt... | true |
Other | vercel | next.js | 9c93c0543fce823e36ab4f5ccf826d0b71f503d9.json | Add some missing fields to the NextConfig type (#27126)
This adds some missing fields to the `NextConfig` type we expose under `next` and also adds a `NextConfigComplete` internal type that allows us to not treat all fields as optional like you would when using the type in `next.config.js`.
## Bug
- [ ] Related iss... | packages/next/export/index.ts | @@ -29,10 +29,8 @@ import {
SERVERLESS_DIRECTORY,
SERVER_DIRECTORY,
} from '../shared/lib/constants'
-import loadConfig, {
- isTargetLikeServerless,
- NextConfig,
-} from '../server/config'
+import loadConfig, { isTargetLikeServerless } from '../server/config'
+import { NextConfigComplete } from '../server/con... | true |
Other | vercel | next.js | 9c93c0543fce823e36ab4f5ccf826d0b71f503d9.json | Add some missing fields to the NextConfig type (#27126)
This adds some missing fields to the `NextConfig` type we expose under `next` and also adds a `NextConfigComplete` internal type that allows us to not treat all fields as optional like you would when using the type in `next.config.js`.
## Bug
- [ ] Related iss... | packages/next/server/config-shared.ts | @@ -1,6 +1,6 @@
import os from 'os'
import { Header, Redirect, Rewrite } from '../lib/load-custom-routes'
-import { imageConfigDefault } from './image-config'
+import { ImageConfig, imageConfigDefault } from './image-config'
export type DomainLocales = Array<{
http?: true
@@ -9,8 +9,13 @@ export type DomainLoca... | true |
Other | vercel | next.js | 9c93c0543fce823e36ab4f5ccf826d0b71f503d9.json | Add some missing fields to the NextConfig type (#27126)
This adds some missing fields to the `NextConfig` type we expose under `next` and also adds a `NextConfigComplete` internal type that allows us to not treat all fields as optional like you would when using the type in `next.config.js`.
## Bug
- [ ] Related iss... | packages/next/server/config.ts | @@ -5,7 +5,11 @@ import * as Log from '../build/output/log'
import { hasNextSupport } from '../telemetry/ci-info'
import { CONFIG_FILE, PHASE_DEVELOPMENT_SERVER } from '../shared/lib/constants'
import { execOnce } from '../shared/lib/utils'
-import { defaultConfig, normalizeConfig } from './config-shared'
+import {
... | true |
Other | vercel | next.js | 9c93c0543fce823e36ab4f5ccf826d0b71f503d9.json | Add some missing fields to the NextConfig type (#27126)
This adds some missing fields to the `NextConfig` type we expose under `next` and also adds a `NextConfigComplete` internal type that allows us to not treat all fields as optional like you would when using the type in `next.config.js`.
## Bug
- [ ] Related iss... | packages/next/server/dev/hot-reloader.ts | @@ -24,7 +24,7 @@ import { isWriteable } from '../../build/is-writeable'
import { ClientPagesLoaderOptions } from '../../build/webpack/loaders/next-client-pages-loader'
import { stringify } from 'querystring'
import { difference } from '../../build/utils'
-import { NextConfig } from '../config'
+import { NextConfigC... | true |
Other | vercel | next.js | 9c93c0543fce823e36ab4f5ccf826d0b71f503d9.json | Add some missing fields to the NextConfig type (#27126)
This adds some missing fields to the `NextConfig` type we expose under `next` and also adds a `NextConfigComplete` internal type that allows us to not treat all fields as optional like you would when using the type in `next.config.js`.
## Bug
- [ ] Related iss... | packages/next/server/image-config.ts | @@ -14,7 +14,7 @@ export type ImageConfig = {
loader: LoaderValue
path: string
domains?: string[]
- disableStaticImages: boolean
+ disableStaticImages?: boolean
}
export const imageConfigDefault: ImageConfig = { | true |
Other | vercel | next.js | 9c93c0543fce823e36ab4f5ccf826d0b71f503d9.json | Add some missing fields to the NextConfig type (#27126)
This adds some missing fields to the `NextConfig` type we expose under `next` and also adds a `NextConfigComplete` internal type that allows us to not treat all fields as optional like you would when using the type in `next.config.js`.
## Bug
- [ ] Related iss... | packages/next/server/next-server.ts | @@ -96,6 +96,7 @@ import ResponseCache, {
ResponseCacheEntry,
ResponseCacheValue,
} from './response-cache'
+import { NextConfigComplete } from './config-shared'
const getCustomRouteMatcher = pathMatch(true)
@@ -135,7 +136,7 @@ export type ServerConstructor = {
export default class Server {
protected di... | true |
Other | vercel | next.js | 3b9786925d43bb85a959db9f414494396c709f0f.json | Add jsdoc types to docs snippets (#27125)
This PR adds the JSDoc types so that VS Code and other tools can use autocompletion when editing `next.config.js` | docs/api-reference/next.config.js/introduction.md | @@ -11,18 +11,27 @@ For custom advanced behavior of Next.js, you can create a `next.config.js` in th
Take a look at the following `next.config.js` example:
```js
-module.exports = {
+/**
+ * @type {import('next').NextConfig}
+ */
+const nextConfig = {
/* config options here */
}
+
+module.exports = nextConfig
... | false |
Other | vercel | next.js | cb8da5778ecedf638da477eb0ea91bcae8b74077.json | Replace `withCoalescedInvoke` with `ResponseCache` (#26997)
By itself, `withCoalescedInvoke` with a separate `this.incrementalCache.set(...)` isn't really suitable for streaming responses. Since streaming is asynchronous, updating the cache separately introduces a gap where another origin request for the same resource... | packages/next/server/dev/next-dev-server.ts | @@ -30,7 +30,6 @@ import Server, {
WrappedBuildError,
ServerConstructor,
FindComponentsResult,
- ResponsePayload,
} from '../next-server'
import { normalizePagePath } from '../normalize-page-path'
import Router, { Params, route } from '../router'
@@ -637,16 +636,6 @@ export default class DevServer extends ... | true |
Other | vercel | next.js | cb8da5778ecedf638da477eb0ea91bcae8b74077.json | Replace `withCoalescedInvoke` with `ResponseCache` (#26997)
By itself, `withCoalescedInvoke` with a separate `this.incrementalCache.set(...)` isn't really suitable for streaming responses. Since streaming is asynchronous, updating the cache separately introduces a gap where another origin request for the same resource... | packages/next/server/next-server.ts | @@ -19,7 +19,6 @@ import {
RouteType,
CustomRoutes,
} from '../lib/load-custom-routes'
-import { withCoalescedInvoke } from '../lib/coalesced-function'
import {
BUILD_ID_FILE,
CLIENT_PUBLIC_FILES_PATH,
@@ -73,7 +72,7 @@ import prepareDestination, {
} from '../shared/lib/router/utils/prepare-destination'
... | true |
Other | vercel | next.js | cb8da5778ecedf638da477eb0ea91bcae8b74077.json | Replace `withCoalescedInvoke` with `ResponseCache` (#26997)
By itself, `withCoalescedInvoke` with a separate `this.incrementalCache.set(...)` isn't really suitable for streaming responses. Since streaming is asynchronous, updating the cache separately introduces a gap where another origin request for the same resource... | packages/next/server/response-cache.ts | @@ -0,0 +1,103 @@
+import { IncrementalCache } from './incremental-cache'
+
+interface CachedRedirectValue {
+ kind: 'REDIRECT'
+ props: Object
+}
+
+interface CachedPageValue {
+ kind: 'PAGE'
+ html: string
+ pageData: Object
+}
+
+export type ResponseCacheValue = CachedRedirectValue | CachedPageValue
+
+export t... | true |
Other | vercel | next.js | cb8da5778ecedf638da477eb0ea91bcae8b74077.json | Replace `withCoalescedInvoke` with `ResponseCache` (#26997)
By itself, `withCoalescedInvoke` with a separate `this.incrementalCache.set(...)` isn't really suitable for streaming responses. Since streaming is asynchronous, updating the cache separately introduces a gap where another origin request for the same resource... | packages/next/server/send-payload.ts | @@ -3,7 +3,7 @@ import { isResSent } from '../shared/lib/utils'
import generateETag from 'etag'
import fresh from 'next/dist/compiled/fresh'
-type PayloadOptions =
+export type PayloadOptions =
| { private: true }
| { private: boolean; stateful: true }
| { private: boolean; stateful: false; revalidate: num... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.