Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vercel/next.js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v12.3.5
Choose a base ref
...
head repository: vercel/next.js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v12.3.6
Choose a head ref
  • 3 commits
  • 21 files changed
  • 1 contributor

Commits on Mar 23, 2025

  1. update publish-native

    ijjk committed Mar 23, 2025
    Copy the full SHA
    fedcd25 View commit details

Commits on Mar 24, 2025

  1. Match subrequest handling for edge and node

    ijjk committed Mar 24, 2025
    Copy the full SHA
    63c7985 View commit details
  2. v12.3.6

    ijjk committed Mar 24, 2025
    Copy the full SHA
    a4e7a94 View commit details
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -17,5 +17,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "12.3.5"
"version": "12.3.6"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "12.3.5",
"version": "12.3.6",
"keywords": [
"react",
"next",
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "12.3.5",
"version": "12.3.6",
"description": "ESLint configuration used by NextJS.",
"main": "index.js",
"license": "MIT",
@@ -9,7 +9,7 @@
"directory": "packages/eslint-config-next"
},
"dependencies": {
"@next/eslint-plugin-next": "12.3.5",
"@next/eslint-plugin-next": "12.3.6",
"@rushstack/eslint-patch": "^1.1.3",
"@typescript-eslint/parser": "^5.21.0",
"eslint-import-resolver-node": "^0.3.6",
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "12.3.5",
"version": "12.3.6",
"description": "ESLint plugin for NextJS.",
"main": "lib/index.js",
"license": "MIT",
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "12.3.5",
"version": "12.3.6",
"main": "index.js",
"types": "index.d.ts",
"license": "MIT",
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "12.3.5",
"version": "12.3.6",
"license": "MIT",
"dependencies": {
"chalk": "4.1.0",
2 changes: 1 addition & 1 deletion packages/next-env/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/env",
"version": "12.3.5",
"version": "12.3.6",
"keywords": [
"react",
"next",
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "12.3.5",
"version": "12.3.6",
"main": "index.js",
"license": "MIT",
"repository": {
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "12.3.5",
"version": "12.3.6",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
2 changes: 1 addition & 1 deletion packages/next-polyfill-module/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-module",
"version": "12.3.5",
"version": "12.3.6",
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
"main": "dist/polyfill-module.js",
"license": "MIT",
2 changes: 1 addition & 1 deletion packages/next-polyfill-nomodule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "12.3.5",
"version": "12.3.6",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
2 changes: 1 addition & 1 deletion packages/next-swc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/swc",
"version": "12.3.5",
"version": "12.3.6",
"private": true,
"scripts": {
"build-native": "napi build --platform -p next-swc-napi --cargo-name next_swc_napi native --features plugin",
14 changes: 7 additions & 7 deletions packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "12.3.5",
"version": "12.3.6",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
@@ -67,7 +67,7 @@
]
},
"dependencies": {
"@next/env": "12.3.5",
"@next/env": "12.3.6",
"@swc/helpers": "0.4.11",
"caniuse-lite": "^1.0.30001406",
"postcss": "8.4.14",
@@ -118,11 +118,11 @@
"@hapi/accept": "5.0.2",
"@napi-rs/cli": "2.7.0",
"@napi-rs/triples": "1.1.0",
"@next/polyfill-module": "12.3.5",
"@next/polyfill-nomodule": "12.3.5",
"@next/react-dev-overlay": "12.3.5",
"@next/react-refresh-utils": "12.3.5",
"@next/swc": "12.3.5",
"@next/polyfill-module": "12.3.6",
"@next/polyfill-nomodule": "12.3.6",
"@next/react-dev-overlay": "12.3.6",
"@next/react-refresh-utils": "12.3.6",
"@next/swc": "12.3.6",
"@segment/ajv-human-errors": "2.1.2",
"@taskr/clear": "1.1.0",
"@taskr/esnext": "1.1.0",
6 changes: 0 additions & 6 deletions packages/next/server/next-server.ts
Original file line number Diff line number Diff line change
@@ -27,7 +27,6 @@ import type { NextConfig } from './config-shared'
import type { DynamicRoutes, PageChecker } from './router'

import fs from 'fs'
import crypto from 'crypto'
import { join, relative, resolve, sep } from 'path'
import { IncomingMessage, ServerResponse } from 'http'
import { addRequestMeta, getRequestMeta } from './request-meta'
@@ -248,11 +247,6 @@ export default class NextNodeServer extends BaseServer {
)
}

const randomBytes = crypto.randomBytes(8)
const middlewareSubrequestId = randomBytes.toString('hex')
;(global as any)[Symbol.for('@next/middleware-subrequest-id')] =
middlewareSubrequestId

if (!options.dev) {
// pre-warm _document and _app as these will be
// needed for most requests
9 changes: 0 additions & 9 deletions packages/next/server/web/sandbox/context.ts
Original file line number Diff line number Diff line change
@@ -218,15 +218,6 @@ Learn More: https://nextjs.org/docs/messages/edge-dynamic-code-evaluation`),
}

init.headers = new Headers(init.headers ?? {})
const prevs =
init.headers.get(`x-middleware-subrequest`)?.split(':') || []
const value = prevs.concat(options.moduleName).join(':')

init.headers.set('x-middleware-subrequest', value)
init.headers.set(
'x-middleware-subrequest-id',
(global as any)[Symbol.for('@next/middleware-subrequest-id')]
)

if (!init.headers.has('user-agent')) {
init.headers.set(`user-agent`, `Next.js Middleware`)
18 changes: 0 additions & 18 deletions packages/next/server/web/sandbox/sandbox.ts
Original file line number Diff line number Diff line change
@@ -70,24 +70,6 @@ export const getRuntimeContext = async (params: {

export const run = withTaggedErrors(async (params) => {
const runtime = await getRuntimeContext(params)
const subreq = params.request.headers[`x-middleware-subrequest`]
const subrequests = typeof subreq === 'string' ? subreq.split(':') : []
if (
// require the subrequest-id be valid to skip
params.request.headers['x-middleware-subrequest-id'] ===
(global as any)[Symbol.for('@next/middleware-subrequest-id')] &&
subrequests.includes(params.name)
) {
return {
waitUntil: Promise.resolve(),
response: new runtime.context.Response(null, {
headers: {
'x-middleware-next': '1',
},
}),
}
}

const edgeFunction: (args: {
request: RequestData
}) => Promise<FetchEventResult> =
2 changes: 1 addition & 1 deletion packages/react-dev-overlay/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/react-dev-overlay",
"version": "12.3.5",
"version": "12.3.6",
"description": "A development-only overlay for developing React applications.",
"repository": {
"url": "vercel/next.js",
2 changes: 1 addition & 1 deletion packages/react-refresh-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/react-refresh-utils",
"version": "12.3.5",
"version": "12.3.6",
"description": "An experimental package providing utilities for React Refresh.",
"repository": {
"url": "vercel/next.js",
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 7 additions & 8 deletions scripts/publish-native.js
Original file line number Diff line number Diff line change
@@ -19,6 +19,9 @@ const cwd = process.cwd()
let platforms = (await readdir(nativePackagesDir)).filter(
(name) => !name.startsWith('.')
)
let nextPkg = JSON.parse(
await readFile(path.join(cwd, 'packages/next/package.json'))
)

for (let platform of platforms) {
try {
@@ -45,6 +48,10 @@ const cwd = process.cwd()
: '--tag next-12-3-2'
}`
)

let optionalDependencies = nextPkg.optionalDependencies || {}
optionalDependencies['@next/swc-' + platform] = version
nextPkg.optionalDependencies = optionalDependencies
} catch (err) {
// don't block publishing other versions on single platform error
console.error(`Failed to publish`, platform)
@@ -91,14 +98,6 @@ const cwd = process.cwd()
}

// Update optional dependencies versions
let nextPkg = JSON.parse(
await readFile(path.join(cwd, 'packages/next/package.json'))
)
for (let platform of platforms) {
let optionalDependencies = nextPkg.optionalDependencies || {}
optionalDependencies['@next/swc-' + platform] = version
nextPkg.optionalDependencies = optionalDependencies
}
await writeFile(
path.join(path.join(cwd, 'packages/next/package.json')),
JSON.stringify(nextPkg, null, 2)
18 changes: 0 additions & 18 deletions test/e2e/middleware-general/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -71,24 +71,6 @@ describe('Middleware Runtime', () => {
}

function runTests({ i18n }: { i18n?: boolean }) {
it('should filter request header properly', async () => {
const res = await fetchViaHTTP(
next.url,
'/redirect-to-somewhere',
{},
{
headers: {
'x-middleware-subrequest':
'middleware:middleware:middleware:middleware:middleware',
},
redirect: 'manual',
}
)

expect(res.status).toBe(307)
expect(res.headers.get('location')).toContain('/somewhere')
})

if ((global as any).isNextDev) {
it('refreshes the page when middleware changes ', async () => {
const browser = await webdriver(next.url, `/about`)