Skip to content

Commit cf76c5b

Browse files
devjiwonchoivercel[bot]eps1lon
authored
Update test/CNA templates React version to 19.2.0 (#84736)
The peerDeps are already bumped to 19.2.0 at #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: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com> Co-authored-by: Sebastian Sebbie Silbermann <[email protected]>
1 parent 3b4e447 commit cf76c5b

File tree

5 files changed

+18
-20
lines changed

5 files changed

+18
-20
lines changed

packages/create-next-app/templates/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { Bundler, GetTemplateFileArgs, InstallTemplateArgs } from "./types";
1414

1515
// Do not rename or format. sync-react script relies on this line.
1616
// prettier-ignore
17-
const nextjsReactPeerVersion = "19.1.0";
17+
const nextjsReactPeerVersion = "19.2.0";
1818

1919
/**
2020
* Get the file path for a given file in a template, e.g. "next.config.js".

run-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const { getTestFilter } = require('./test/get-test-filter')
1616

1717
// Do not rename or format. sync-react script relies on this line.
1818
// prettier-ignore
19-
const nextjsReactPeerVersion = "19.1.0";
19+
const nextjsReactPeerVersion = "19.2.0";
2020

2121
let argv = require('yargs/yargs')(process.argv.slice(2))
2222
.string('type')

scripts/sync-react.js

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -353,23 +353,21 @@ Or, run this command with no arguments to use the most recently published versio
353353
)
354354
const { sha: baseSha, dateString: baseDateString } = baseVersionInfo
355355

356-
if (syncPagesRouterReact) {
357-
for (const fileName of filesReferencingReactPeerDependencyVersion) {
358-
const filePath = path.join(cwd, fileName)
359-
const previousSource = await fsp.readFile(filePath, 'utf-8')
360-
const updatedSource = previousSource.replace(
361-
/const nextjsReactPeerVersion = "[^"]+";/,
362-
`const nextjsReactPeerVersion = "${highestPagesRouterReactVersion}";`
363-
)
364-
if (activePagesRouterReact === null && updatedSource === previousSource) {
365-
errors.push(
366-
new Error(
367-
`${fileName}: Failed to update ${baseVersionStr} to ${highestPagesRouterReactVersion}. Is this file still referencing the React peer dependency version?`
368-
)
356+
for (const fileName of filesReferencingReactPeerDependencyVersion) {
357+
const filePath = path.join(cwd, fileName)
358+
const previousSource = await fsp.readFile(filePath, 'utf-8')
359+
const updatedSource = previousSource.replace(
360+
/const nextjsReactPeerVersion = "[^"]+";/,
361+
`const nextjsReactPeerVersion = "${highestPagesRouterReactVersion}";`
362+
)
363+
if (updatedSource === previousSource) {
364+
errors.push(
365+
new Error(
366+
`${fileName}: Failed to update ${baseVersionStr} to ${highestPagesRouterReactVersion}. Is this file still referencing the React peer dependency version?`
369367
)
370-
} else {
371-
await fsp.writeFile(filePath, updatedSource)
372-
}
368+
)
369+
} else {
370+
await fsp.writeFile(filePath, updatedSource)
373371
}
374372
}
375373

test/development/acceptance/hydration-error.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
114114
+ client
115115
- server
116116
...",
117-
"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:",
117+
"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:",
118118
"environmentLabel": null,
119119
"label": "Recoverable Error",
120120
"source": "index.js (5:9) @ Mismatch

test/lib/next-modes/base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ type OmitFirstArgument<F> = F extends (
6565

6666
// Do not rename or format. sync-react script relies on this line.
6767
// prettier-ignore
68-
const nextjsReactPeerVersion = "19.1.0";
68+
const nextjsReactPeerVersion = "19.2.0";
6969

7070
export class NextInstance {
7171
protected files: ResolvedFileConfig

0 commit comments

Comments
 (0)