Skip to content

Commit 6c5ca7a

Browse files
committed
[release] Don't lookup build-info.json when updating version numbers
From what we can see, `build-info.json` is a vestigal file that we were previously including in builds but are no longer since 2022 (see #23257, which removes `build-info.json` which would have broken scripts/release/build-release-locally-commands/add-build-info-json.js). Since this file is no longer built, instead of looking it up we default to the `version` that was passed in as an argument to scripts/release/prepare-release-from-npm.js. Since `version` is what is pulled from npm, there should only be 1 consistent version for all the packages that are pulled. Therefore, only 1 version (eg canary) needs to be replaced to the new stable version.
1 parent e1628d5 commit 6c5ca7a

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

scripts/release/prepare-release-from-npm-commands/update-stable-version-numbers.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,6 @@ const run = async ({cwd, packages, version, ci}, versionsMap) => {
114114
clear();
115115

116116
if (packages.includes('react')) {
117-
// A separate "React version" is used for the embedded renderer version to support DevTools,
118-
// since it needs to distinguish between different version ranges of React.
119-
// We need to replace it as well as the "next" version number.
120-
const buildInfoPath = join(nodeModulesPath, 'react', 'build-info.json');
121-
const {reactVersion} = await readJson(buildInfoPath);
122-
123-
if (!reactVersion) {
124-
console.error(
125-
theme`{error Unsupported or invalid build metadata in} {path build/node_modules/react/build-info.json}` +
126-
theme`{error . This could indicate that you have specified an outdated "next" version.}`
127-
);
128-
process.exit(1);
129-
}
130-
131117
// We print the diff to the console for review,
132118
// but it can be large so let's also write it to disk.
133119
const diffPath = join(cwd, 'build', 'temp.diff');
@@ -152,10 +138,6 @@ const run = async ({cwd, packages, version, ci}, versionsMap) => {
152138
while (afterContents.indexOf(version) >= 0) {
153139
afterContents = afterContents.replace(version, newStableVersion);
154140
}
155-
// Replace inline renderer version numbers (e.g. shared/ReactVersion).
156-
while (afterContents.indexOf(reactVersion) >= 0) {
157-
afterContents = afterContents.replace(reactVersion, newStableVersion);
158-
}
159141
if (beforeContents !== afterContents) {
160142
numFilesModified++;
161143
// Using a relative path for diff helps with the snapshot test

0 commit comments

Comments
 (0)