Unverified Commit 8774088b authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[Backport 15.0] Use React 19 stable (#73564)

parent 7dc7be20
......@@ -7,8 +7,8 @@
},
"dependencies": {
"next": "canary",
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106"
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@types/node": "20.12.12",
......
......@@ -209,10 +209,10 @@
"pretty-bytes": "5.3.0",
"pretty-ms": "7.0.0",
"random-seed": "0.3.0",
"react": "19.0.0-rc-66855b96-20241106",
"react": "19.0.0",
"react-17": "npm:react@17.0.2",
"react-builtin": "npm:react@19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0",
"react-dom-17": "npm:react-dom@17.0.2",
"react-dom-builtin": "npm:react-dom@19.0.0-rc-66855b96-20241106",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-66855b96-20241106",
......
......@@ -13,7 +13,7 @@ import { GetTemplateFileArgs, InstallTemplateArgs } from "./types";
// Do not rename or format. sync-react script relies on this line.
// prettier-ignore
const nextjsReactPeerVersion = "19.0.0-rc-66855b96-20241106";
const nextjsReactPeerVersion = "^19.0.0";
/**
* Get the file path for a given file in a template, e.g. "next.config.js".
......@@ -212,8 +212,8 @@ export const installTemplate = async ({
...packageJson.devDependencies,
typescript: "^5",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/react": "^19",
"@types/react-dom": "^19",
};
}
......
......@@ -109,8 +109,8 @@
"@opentelemetry/api": "^1.1.0",
"@playwright/test": "^1.41.2",
"babel-plugin-react-compiler": "*",
"react": "^18.2.0 || 19.0.0-rc-66855b96-20241106",
"react-dom": "^18.2.0 || 19.0.0-rc-66855b96-20241106",
"react": "^18.2.0 || 19.0.0-rc-66855b96-20241106 || ^19.0.0",
"react-dom": "^18.2.0 || 19.0.0-rc-66855b96-20241106 || ^19.0.0",
"sass": "^1.3.0"
},
"peerDependenciesMeta": {
......
......@@ -33,6 +33,6 @@
},
"peerDependencies": {
"next": "^13.0.0 || ^14.0.0 || ^15.0.0",
"react": "^18.2.0 || 19.0.0-rc-66855b96-20241106"
"react": "^18.2.0 || 19.0.0-rc-66855b96-20241106 || ^19.0.0"
}
}
......@@ -20,7 +20,7 @@ const { getTestFilter } = require('./test/get-test-filter')
// Do not rename or format. sync-react script relies on this line.
// prettier-ignore
const nextjsReactPeerVersion = "19.0.0-rc-66855b96-20241106";
const nextjsReactPeerVersion = "^19.0.0";
let argv = require('yargs/yargs')(process.argv.slice(2))
.string('type')
......
......@@ -4,8 +4,8 @@
"license": "MIT",
"dependencies": {
"next": "latest",
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106"
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"engines": {
"node": ">=18.18.0"
......
......@@ -7,7 +7,6 @@ import cheerio from 'cheerio'
// on experimental flags. For example, as a first step we could all the common
// gates like this one into a single module.
const isPPREnabledByDefault = process.env.__NEXT_EXPERIMENTAL_PPR === 'true'
const isReact18 = parseInt(process.env.NEXT_TEST_REACT_VERSION) === 18
async function resolveStreamResponse(response: any, onData?: any) {
let result = ''
......@@ -515,14 +514,7 @@ describe('app dir - rsc basics', () => {
]
ssrPagesReactVersions.forEach((version) => {
if (isReact18 || isPPREnabledByDefault) {
expect(version).not.toMatch(bundledReactVersionPattern)
} else {
// TODO: Pages router only supports React 19 that is bundled
// Once we run with React 19 stable, this branch should be removed in
// favor of unconditional `not.toMatch`
expect(version).toMatch(bundledReactVersionPattern)
}
expect(version).not.toMatch(bundledReactVersionPattern)
})
})
await Promise.all(promises)
......@@ -556,24 +548,10 @@ describe('app dir - rsc basics', () => {
`)
browserPagesReactVersions.forEach((version) => {
if (isReact18 || isPPREnabledByDefault) {
expect(version).not.toMatch(bundledReactVersionPattern)
} else {
// TODO: Pages router only supports React 19 that is bundled
// Once we run with React 19 stable, this branch should be removed in
// favor of unconditional `not.toMatch`
expect(version).toMatch(bundledReactVersionPattern)
}
expect(version).not.toMatch(bundledReactVersionPattern)
})
browserEdgePagesReactVersions.forEach((version) => {
if (isReact18 || isPPREnabledByDefault) {
expect(version).not.toMatch(bundledReactVersionPattern)
} else {
// TODO: Pages router only supports React 19 that is bundled
// Once we run with React 19 stable, this branch should be removed in
// favor of unconditional `not.toMatch`
expect(version).toMatch(bundledReactVersionPattern)
}
expect(version).not.toMatch(bundledReactVersionPattern)
})
})
......
......@@ -8,7 +8,7 @@
},
"dependencies": {
"next": "canary",
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106"
"react": "^19.0.0",
"react-dom": "^19.0.0"
}
}
......@@ -8,8 +8,8 @@
},
"dependencies": {
"next": "canary",
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106"
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@types/react": "^18",
......
......@@ -51,7 +51,7 @@ type OmitFirstArgument<F> = F extends (
// Do not rename or format. sync-react script relies on this line.
// prettier-ignore
const nextjsReactPeerVersion = "19.0.0-rc-66855b96-20241106";
const nextjsReactPeerVersion = "^19.0.0";
export class NextInstance {
protected files: FileRef | { [filename: string]: string | FileRef }
......
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