Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions evals/next-upgrade/future/assessment.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,18 @@ const { target } = JSON.parse(
globalThis.fetch = async (input, init) => {
const url = String(input)
let value
let versions

if (url.startsWith('https://api.github.com/advisories?')) {
value = []
if (url === 'https://registry.npmjs.org/-/npm/v1/security/advisories/bulk') {
versions = JSON.parse(init.body).next
if (
!Array.isArray(versions) ||
versions.length === 0 ||
versions.some((version) => typeof version !== 'string')
) {
throw new Error('Expected Next.js advisory versions')
}
value = {}
} else if (url === 'https://registry.npmjs.org/next/latest') {
value = {
version: target,
Expand All @@ -25,7 +34,7 @@ globalThis.fetch = async (input, init) => {

appendFileSync(
join(tools, 'assessment.jsonl'),
JSON.stringify({ url, value }) + '\n'
JSON.stringify({ url, versions, value }) + '\n'
)
return Response.json(value)
}
29 changes: 19 additions & 10 deletions evals/next-upgrade/latest/assessment.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,31 @@ const { target } = JSON.parse(

globalThis.fetch = async (input, init) => {
const url = String(input)
let value
let versions

if (url.startsWith('https://api.github.com/advisories?')) {
return Response.json([])
}

if (url !== 'https://registry.npmjs.org/next/latest') {
if (url === 'https://registry.npmjs.org/-/npm/v1/security/advisories/bulk') {
versions = JSON.parse(init.body).next
if (
!Array.isArray(versions) ||
versions.length === 0 ||
versions.some((version) => typeof version !== 'string')
) {
throw new Error('Expected Next.js advisory versions')
}
value = {}
} else if (url === 'https://registry.npmjs.org/next/latest') {
value = {
version: target,
engines: { node: '>=20.9.0' },
}
} else {
return realFetch(input, init)
}

const value = {
version: target,
engines: { node: '>=20.9.0' },
}
appendFileSync(
join(tools, 'assessment.jsonl'),
JSON.stringify({ url, value }) + '\n'
JSON.stringify({ url, versions, value }) + '\n'
)
return Response.json(value)
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
]
}
},
"version": "16.4.0-canary.50"
"version": "16.4.0-canary.51"
}
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": "16.4.0-canary.50",
"version": "16.4.0-canary.51",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/devlow-bench/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vercel/devlow-bench",
"version": "16.4.0-canary.50",
"version": "16.4.0-canary.51",
"description": "Benchmarking tool for the developer workflow",
"repository": {
"type": "git",
Expand Down
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": "16.4.0-canary.50",
"version": "16.4.0-canary.51",
"description": "ESLint configuration used by Next.js.",
"license": "MIT",
"repository": {
Expand All @@ -12,7 +12,7 @@
"dist"
],
"dependencies": {
"@next/eslint-plugin-next": "16.4.0-canary.50",
"@next/eslint-plugin-next": "16.4.0-canary.51",
"eslint-import-resolver-node": "^0.3.6",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-import": "^2.32.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-internal/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@next/eslint-plugin-internal",
"private": true,
"version": "16.4.0-canary.50",
"version": "16.4.0-canary.51",
"description": "ESLint plugin for working on Next.js.",
"exports": {
".": "./src/eslint-plugin-internal.js"
Expand Down
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": "16.4.0-canary.50",
"version": "16.4.0-canary.51",
"description": "ESLint plugin for Next.js.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/font/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@next/font",
"private": true,
"version": "16.4.0-canary.50",
"version": "16.4.0-canary.51",
"repository": {
"url": "vercel/next.js",
"directory": "packages/font"
Expand Down
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": "16.4.0-canary.50",
"version": "16.4.0-canary.51",
"main": "index.js",
"types": "index.d.ts",
"license": "MIT",
Expand Down
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": "16.4.0-canary.50",
"version": "16.4.0-canary.51",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
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": "16.4.0-canary.50",
"version": "16.4.0-canary.51",
"keywords": [
"react",
"next",
Expand Down
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": "16.4.0-canary.50",
"version": "16.4.0-canary.51",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-playwright/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/playwright",
"version": "16.4.0-canary.50",
"version": "16.4.0-canary.51",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-playwright"
Expand Down
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": "16.4.0-canary.50",
"version": "16.4.0-canary.51",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
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": "16.4.0-canary.50",
"version": "16.4.0-canary.51",
"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",
Expand Down
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": "16.4.0-canary.50",
"version": "16.4.0-canary.51",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-routing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/routing",
"version": "16.4.0-canary.50",
"version": "16.4.0-canary.51",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-rspack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-rspack",
"version": "16.4.0-canary.50",
"version": "16.4.0-canary.51",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-rspack"
Expand Down
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": "16.4.0-canary.50",
"version": "16.4.0-canary.51",
"private": true,
"files": [
"native/"
Expand Down
7 changes: 7 additions & 0 deletions packages/next/.storybook/decorators/use-overlay-reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
ACTION_UNHANDLED_ERROR,
ACTION_UNHANDLED_REJECTION,
ACTION_VERSION_INFO,
ACTION_VULNERABILITY_INSIGHT,
INITIAL_OVERLAY_STATE,
} from '../../src/next-devtools/dev-overlay/shared'

Expand Down Expand Up @@ -61,6 +62,12 @@ export function useStorybookOverlayReducer(initialState?: OverlayState) {
case ACTION_ERROR_OVERLAY_TOGGLE: {
return { ...state, isErrorOverlayOpen: !state.isErrorOverlayOpen }
}
case ACTION_VULNERABILITY_INSIGHT: {
return {
...state,
hasVulnerabilityInsight: action.hasVulnerabilityInsight,
}
}
case ACTION_DEVTOOLS_POSITION: {
return { ...state, devToolsPosition: action.devToolsPosition }
}
Expand Down
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": "16.4.0-canary.50",
"version": "16.4.0-canary.51",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -100,7 +100,7 @@
]
},
"dependencies": {
"@next/env": "16.4.0-canary.50",
"@next/env": "16.4.0-canary.51",
"@swc/helpers": "0.5.23",
"baseline-browser-mapping": "^2.9.19",
"caniuse-lite": "^1.0.30001579",
Expand Down Expand Up @@ -164,11 +164,11 @@
"@modelcontextprotocol/sdk": "1.18.1",
"@mswjs/interceptors": "0.42.5",
"@napi-rs/triples": "1.2.0",
"@next/font": "16.4.0-canary.50",
"@next/polyfill-module": "16.4.0-canary.50",
"@next/polyfill-nomodule": "16.4.0-canary.50",
"@next/react-refresh-utils": "16.4.0-canary.50",
"@next/swc": "16.4.0-canary.50",
"@next/font": "16.4.0-canary.51",
"@next/polyfill-module": "16.4.0-canary.51",
"@next/polyfill-nomodule": "16.4.0-canary.51",
"@next/react-refresh-utils": "16.4.0-canary.51",
"@next/swc": "16.4.0-canary.51",
"@opentelemetry/api": "1.6.0",
"@playwright/test": "1.61.0",
"@rspack/core": "1.6.7",
Expand Down
6 changes: 4 additions & 2 deletions packages/next/src/cli/next-upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,11 +448,13 @@ export async function spawnNextUpgrade(
const taskSummary = needsVersionUpdate
? `We're upgrading the app in ${JSON.stringify(baseDir)} from Next.js ${result.installedVersion} to ${result.targetVersion} because ${reason}.`
: `We're adopting the Future Defaults available to the app in ${JSON.stringify(baseDir)}, which already uses Next.js ${result.installedVersion}.`
const prompt = `Read and follow ${JSON.stringify(sharedGuidePath)} first. Attempt its applicable duplicate checks before changing files. If a check is unavailable, report it and continue. Stop only if you find equivalent work. Then read and follow every applicable instruction in ${JSON.stringify(guidePath)}.
const prompt = (
useWorktree: boolean | null
) => `Read and follow ${JSON.stringify(sharedGuidePath)} first. Attempt its applicable duplicate checks before changing files. If a check is unavailable, report it and continue. Stop only if you find equivalent work. Then read and follow every applicable instruction in ${JSON.stringify(guidePath)}.

${taskSummary}

If the app is in a Git repository, perform the upgrade in a separate Git worktree unless the user explicitly requests otherwise. Run upgrade commands from this app's corresponding directory in that worktree. If the app is not in a Git repository, upgrade it in place.
${useWorktree === null ? "Follow the user's worktree choice. If they do not specify, use a separate Git worktree when the app is in a Git repository. Run upgrade commands from this app's corresponding directory in that worktree. If the app is not in a Git repository, upgrade it in place." : useWorktree ? "If the app is in a Git repository, perform the upgrade in a separate Git worktree. Run upgrade commands from this app's corresponding directory in that worktree. If the app is not in a Git repository, upgrade it in place." : 'Perform the upgrade in the current checkout.'}

Set \`experimental.agenticAutoUpgrade\` to ${JSON.stringify(upgradeType)} in the app's Next.js config as part of this upgrade. Preserve unrelated configuration. If the target Next.js version does not support this option, skip the setting and report why.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ export function processMessage(
}
break
}
case HMR_MESSAGE_SENT_TO_BROWSER.VULNERABILITY_INSIGHT: {
dispatcher.onVulnerabilityInsight(message.hasVulnerabilityInsight)
break
}
case HMR_MESSAGE_SENT_TO_BROWSER.BUILT:
case HMR_MESSAGE_SENT_TO_BROWSER.SYNC: {
dispatcher.buildingIndicatorHide()
Expand All @@ -322,6 +326,9 @@ export function processMessage(
// Is undefined when it's a 'built' event
if ('versionInfo' in message)
dispatcher.onVersionInfo(message.versionInfo)
if ('hasVulnerabilityInsight' in message) {
dispatcher.onVulnerabilityInsight(message.hasVulnerabilityInsight)
}
if ('debug' in message && message.debug)
dispatcher.onDebugInfo(message.debug)
if ('devIndicator' in message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ function processMessage(message: HmrMessageSentToBrowser) {
}
break
}
case HMR_MESSAGE_SENT_TO_BROWSER.VULNERABILITY_INSIGHT: {
dispatcher.onVulnerabilityInsight(message.hasVulnerabilityInsight)
break
}
case HMR_MESSAGE_SENT_TO_BROWSER.BUILT:
case HMR_MESSAGE_SENT_TO_BROWSER.SYNC: {
dispatcher.buildingIndicatorHide()
Expand All @@ -301,6 +305,9 @@ function processMessage(message: HmrMessageSentToBrowser) {
// Is undefined when it's a 'built' event
if ('versionInfo' in message)
dispatcher.onVersionInfo(message.versionInfo)
if ('hasVulnerabilityInsight' in message) {
dispatcher.onVulnerabilityInsight(message.hasVulnerabilityInsight)
}
if ('devIndicator' in message)
dispatcher.onDevIndicator(message.devIndicator)
if ('devToolsConfig' in message)
Expand Down
1 change: 1 addition & 0 deletions packages/next/src/client/page-bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export function pageBootstrap(assetPrefix: string) {
case HMR_MESSAGE_SENT_TO_BROWSER.TURBOPACK_CONNECTED:
case HMR_MESSAGE_SENT_TO_BROWSER.ISR_MANIFEST:
case HMR_MESSAGE_SENT_TO_BROWSER.DEVTOOLS_CONFIG:
case HMR_MESSAGE_SENT_TO_BROWSER.VULNERABILITY_INSIGHT:
case HMR_MESSAGE_SENT_TO_BROWSER.REACT_DEBUG_CHUNK:
case HMR_MESSAGE_SENT_TO_BROWSER.REQUEST_CURRENT_ERROR_STATE:
case HMR_MESSAGE_SENT_TO_BROWSER.RUNTIME_ERRORS:
Expand Down
Loading
Loading