Unverified Commit cf76c5b7 authored by Jiwon Choi's avatar Jiwon Choi Committed by GitHub

Update test/CNA templates React version to 19.2.0 (#84736)

The peerDeps are already bumped to 19.2.0 at
https://github.com/vercel/next.js/pull/84463, but the test/CNA templates
weren't updated as the `syncPagesRouterReact` value is always false at
the moment, which blocked the update.

Therefore, remove the `syncPagesRouterReact` condition to match the
actual peerDeps bump.

---------
Co-authored-by: 's avatarvercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: 's avatarSebastian Sebbie Silbermann <sebastian.silbermann@vercel.com>
parent 3b4e4478
...@@ -14,7 +14,7 @@ import { Bundler, GetTemplateFileArgs, InstallTemplateArgs } from "./types"; ...@@ -14,7 +14,7 @@ import { Bundler, GetTemplateFileArgs, InstallTemplateArgs } from "./types";
// Do not rename or format. sync-react script relies on this line. // Do not rename or format. sync-react script relies on this line.
// prettier-ignore // prettier-ignore
const nextjsReactPeerVersion = "19.1.0"; const nextjsReactPeerVersion = "19.2.0";
/** /**
* Get the file path for a given file in a template, e.g. "next.config.js". * Get the file path for a given file in a template, e.g. "next.config.js".
......
...@@ -16,7 +16,7 @@ const { getTestFilter } = require('./test/get-test-filter') ...@@ -16,7 +16,7 @@ const { getTestFilter } = require('./test/get-test-filter')
// Do not rename or format. sync-react script relies on this line. // Do not rename or format. sync-react script relies on this line.
// prettier-ignore // prettier-ignore
const nextjsReactPeerVersion = "19.1.0"; const nextjsReactPeerVersion = "19.2.0";
let argv = require('yargs/yargs')(process.argv.slice(2)) let argv = require('yargs/yargs')(process.argv.slice(2))
.string('type') .string('type')
......
...@@ -353,23 +353,21 @@ Or, run this command with no arguments to use the most recently published versio ...@@ -353,23 +353,21 @@ Or, run this command with no arguments to use the most recently published versio
) )
const { sha: baseSha, dateString: baseDateString } = baseVersionInfo const { sha: baseSha, dateString: baseDateString } = baseVersionInfo
if (syncPagesRouterReact) { for (const fileName of filesReferencingReactPeerDependencyVersion) {
for (const fileName of filesReferencingReactPeerDependencyVersion) { const filePath = path.join(cwd, fileName)
const filePath = path.join(cwd, fileName) const previousSource = await fsp.readFile(filePath, 'utf-8')
const previousSource = await fsp.readFile(filePath, 'utf-8') const updatedSource = previousSource.replace(
const updatedSource = previousSource.replace( /const nextjsReactPeerVersion = "[^"]+";/,
/const nextjsReactPeerVersion = "[^"]+";/, `const nextjsReactPeerVersion = "${highestPagesRouterReactVersion}";`
`const nextjsReactPeerVersion = "${highestPagesRouterReactVersion}";` )
) if (updatedSource === previousSource) {
if (activePagesRouterReact === null && updatedSource === previousSource) { errors.push(
errors.push( new Error(
new Error( `${fileName}: Failed to update ${baseVersionStr} to ${highestPagesRouterReactVersion}. Is this file still referencing the React peer dependency version?`
`${fileName}: Failed to update ${baseVersionStr} to ${highestPagesRouterReactVersion}. Is this file still referencing the React peer dependency version?`
)
) )
} else { )
await fsp.writeFile(filePath, updatedSource) } else {
} await fsp.writeFile(filePath, updatedSource)
} }
} }
......
...@@ -114,7 +114,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -114,7 +114,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
+ client + client
- server - server
...", ...",
"description": "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:", "description": "Hydration failed because the server rendered text didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:",
"environmentLabel": null, "environmentLabel": null,
"label": "Recoverable Error", "label": "Recoverable Error",
"source": "index.js (5:9) @ Mismatch "source": "index.js (5:9) @ Mismatch
......
...@@ -65,7 +65,7 @@ type OmitFirstArgument<F> = F extends ( ...@@ -65,7 +65,7 @@ type OmitFirstArgument<F> = F extends (
// Do not rename or format. sync-react script relies on this line. // Do not rename or format. sync-react script relies on this line.
// prettier-ignore // prettier-ignore
const nextjsReactPeerVersion = "19.1.0"; const nextjsReactPeerVersion = "19.2.0";
export class NextInstance { export class NextInstance {
protected files: ResolvedFileConfig protected files: ResolvedFileConfig
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment