Skip to content

Commit

Permalink
Update next React version (facebook#21647)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
acdlite authored Jun 8, 2021
1 parent 5aa0c56 commit 48a11a3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ workflows:
- setup
commit_sha: << pipeline.parameters.prerelease_commit_sha >>
release_channel: stable
dist_tag: next
dist_tag: "next, alpha"
- publish_prerelease:
name: Publish to Experimental channel
requires:
Expand Down Expand Up @@ -564,7 +564,7 @@ workflows:
- setup
commit_sha: << pipeline.git.revision >>
release_channel: stable
dist_tag: next
dist_tag: "next, alpha"
- publish_prerelease:
name: Publish to Experimental channel
requires:
Expand Down
10 changes: 3 additions & 7 deletions ReactVersions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,17 @@
// The @next channel appends additional information, with the scheme
// <version>-<label>-<commit_sha>, e.g.:
//
// 18.0.0-next-a1c2d3e4
//
// (TODO: ^ this isn't enabled quite yet. We still use <version>-<commit_sha>.)
// 18.0.0-alpha-a1c2d3e4
//
// The @experimental channel doesn't include a version, only a sha, e.g.:
//
// 0.0.0-experimental-a1c2d3e4

// TODO: Main includes breaking changes. Bump this to 18.0.0.
const ReactVersion = '17.0.3';
const ReactVersion = '18.0.0';

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

const stablePackages = {
'create-subscription': ReactVersion,
Expand All @@ -52,7 +49,6 @@ const experimentalPackages = [
'react-server-dom-webpack',
];

// TODO: Export a map of every package and its version.
module.exports = {
ReactVersion,
nextChannelLabel,
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/publish-commands/validate-tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const run = async ({cwd, packages, tags}) => {
);
const {version} = await readJson(packageJSONPath);
const isExperimentalVersion = version.indexOf('experimental') !== -1;
if (version.indexOf('0.0.0') === 0) {
if (version.indexOf('-') === 0) {
if (tags.includes('latest')) {
if (isExperimentalVersion) {
console.log(
Expand Down
25 changes: 15 additions & 10 deletions scripts/rollup/build-all-release-channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const {
ReactVersion,
stablePackages,
experimentalPackages,
nextChannelLabel,
} = require('../../ReactVersions');

// Runs the build script for both stable and experimental release channels,
Expand Down Expand Up @@ -90,10 +91,12 @@ function processStable(buildDir) {
const defaultVersionIfNotFound = '0.0.0' + '-' + sha;
const versionsMap = new Map();
for (const moduleName in stablePackages) {
// TODO: Use version declared in ReactVersions module instead of 0.0.0.
// const version = stablePackages[moduleName];
// versionsMap.set(moduleName, version + '-' + nextChannelLabel + '-' + sha);
versionsMap.set(moduleName, defaultVersionIfNotFound);
const version = stablePackages[moduleName];
versionsMap.set(
moduleName,
version + '-' + nextChannelLabel + '-' + sha,
defaultVersionIfNotFound
);
}
updatePackageVersions(
buildDir + '/node_modules',
Expand Down Expand Up @@ -220,19 +223,21 @@ function updatePackageVersions(

if (packageInfo.dependencies) {
for (const dep of Object.keys(packageInfo.dependencies)) {
if (versionsMap.has(dep)) {
const depVersion = versionsMap.get(dep);
if (depVersion !== undefined) {
packageInfo.dependencies[dep] = pinToExactVersion
? version
: '^' + version;
? depVersion
: '^' + depVersion;
}
}
}
if (packageInfo.peerDependencies) {
for (const dep of Object.keys(packageInfo.peerDependencies)) {
if (versionsMap.has(dep)) {
const depVersion = versionsMap.get(dep);
if (depVersion !== undefined) {
packageInfo.peerDependencies[dep] = pinToExactVersion
? version
: '^' + version;
? depVersion
: '^' + depVersion;
}
}
}
Expand Down

0 comments on commit 48a11a3

Please sign in to comment.