Skip to content

Commit 48a11a3

Browse files
authored
Update next React version (#21647)
This does not mean that a release of 18.0 is imminent, only that the main branch includes breaking changes. Also updates the versioning scheme of the `@next` channel to include the upcoming semver number, as well as the word "alpha" to indicate the stability of the release. - Before: 0.0.0-e0d9b28999 - After: 18.0.0-alpha-e0d9b28999
1 parent 5aa0c56 commit 48a11a3

File tree

4 files changed

+21
-20
lines changed

4 files changed

+21
-20
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ workflows:
532532
- setup
533533
commit_sha: << pipeline.parameters.prerelease_commit_sha >>
534534
release_channel: stable
535-
dist_tag: next
535+
dist_tag: "next, alpha"
536536
- publish_prerelease:
537537
name: Publish to Experimental channel
538538
requires:
@@ -564,7 +564,7 @@ workflows:
564564
- setup
565565
commit_sha: << pipeline.git.revision >>
566566
release_channel: stable
567-
dist_tag: next
567+
dist_tag: "next, alpha"
568568
- publish_prerelease:
569569
name: Publish to Experimental channel
570570
requires:

ReactVersions.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,17 @@
1212
// The @next channel appends additional information, with the scheme
1313
// <version>-<label>-<commit_sha>, e.g.:
1414
//
15-
// 18.0.0-next-a1c2d3e4
16-
//
17-
// (TODO: ^ this isn't enabled quite yet. We still use <version>-<commit_sha>.)
15+
// 18.0.0-alpha-a1c2d3e4
1816
//
1917
// The @experimental channel doesn't include a version, only a sha, e.g.:
2018
//
2119
// 0.0.0-experimental-a1c2d3e4
2220

23-
// TODO: Main includes breaking changes. Bump this to 18.0.0.
24-
const ReactVersion = '17.0.3';
21+
const ReactVersion = '18.0.0';
2522

2623
// The label used by the @next channel. Represents the upcoming release's
2724
// stability. Could be "alpha", "beta", "rc", etc.
28-
const nextChannelLabel = 'next';
25+
const nextChannelLabel = 'alpha';
2926

3027
const stablePackages = {
3128
'create-subscription': ReactVersion,
@@ -52,7 +49,6 @@ const experimentalPackages = [
5249
'react-server-dom-webpack',
5350
];
5451

55-
// TODO: Export a map of every package and its version.
5652
module.exports = {
5753
ReactVersion,
5854
nextChannelLabel,

scripts/release/publish-commands/validate-tags.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const run = async ({cwd, packages, tags}) => {
1919
);
2020
const {version} = await readJson(packageJSONPath);
2121
const isExperimentalVersion = version.indexOf('experimental') !== -1;
22-
if (version.indexOf('0.0.0') === 0) {
22+
if (version.indexOf('-') === 0) {
2323
if (tags.includes('latest')) {
2424
if (isExperimentalVersion) {
2525
console.log(

scripts/rollup/build-all-release-channels.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const {
1212
ReactVersion,
1313
stablePackages,
1414
experimentalPackages,
15+
nextChannelLabel,
1516
} = require('../../ReactVersions');
1617

1718
// Runs the build script for both stable and experimental release channels,
@@ -90,10 +91,12 @@ function processStable(buildDir) {
9091
const defaultVersionIfNotFound = '0.0.0' + '-' + sha;
9192
const versionsMap = new Map();
9293
for (const moduleName in stablePackages) {
93-
// TODO: Use version declared in ReactVersions module instead of 0.0.0.
94-
// const version = stablePackages[moduleName];
95-
// versionsMap.set(moduleName, version + '-' + nextChannelLabel + '-' + sha);
96-
versionsMap.set(moduleName, defaultVersionIfNotFound);
94+
const version = stablePackages[moduleName];
95+
versionsMap.set(
96+
moduleName,
97+
version + '-' + nextChannelLabel + '-' + sha,
98+
defaultVersionIfNotFound
99+
);
97100
}
98101
updatePackageVersions(
99102
buildDir + '/node_modules',
@@ -220,19 +223,21 @@ function updatePackageVersions(
220223

221224
if (packageInfo.dependencies) {
222225
for (const dep of Object.keys(packageInfo.dependencies)) {
223-
if (versionsMap.has(dep)) {
226+
const depVersion = versionsMap.get(dep);
227+
if (depVersion !== undefined) {
224228
packageInfo.dependencies[dep] = pinToExactVersion
225-
? version
226-
: '^' + version;
229+
? depVersion
230+
: '^' + depVersion;
227231
}
228232
}
229233
}
230234
if (packageInfo.peerDependencies) {
231235
for (const dep of Object.keys(packageInfo.peerDependencies)) {
232-
if (versionsMap.has(dep)) {
236+
const depVersion = versionsMap.get(dep);
237+
if (depVersion !== undefined) {
233238
packageInfo.peerDependencies[dep] = pinToExactVersion
234-
? version
235-
: '^' + version;
239+
? depVersion
240+
: '^' + depVersion;
236241
}
237242
}
238243
}

0 commit comments

Comments
 (0)