@samitouri / QOS-React-2 / commits / 48a11a3efc

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

Andrew Clark committed Jun 8, 2021 at 11:26 UTC 48a11a3efc1a3107b07d5f866a26f5abd440885f
4 files changed +21 -20
.circleci/config.yml
+2 -2
@@ -532,7 +532,7 @@ workflows:
532 - setup
533 commit_sha: << pipeline.parameters.prerelease_commit_sha >>
534 release_channel: stable
535 - dist_tag: next
535 + dist_tag: "next, alpha"
536 - publish_prerelease:
537 name: Publish to Experimental channel
538 requires:
@@ -564,7 +564,7 @@ workflows:
564 - setup
565 commit_sha: << pipeline.git.revision >>
566 release_channel: stable
567 - dist_tag: next
567 + dist_tag: "next, alpha"
568 - publish_prerelease:
569 name: Publish to Experimental channel
570 requires:
ReactVersions.js
+3 -7
@@ -12,20 +12,17 @@
12 // The @next channel appends additional information, with the scheme
13 // <version>-<label>-<commit_sha>, e.g.:
14 //
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
16 //
17 // The @experimental channel doesn't include a version, only a sha, e.g.:
18 //
19 // 0.0.0-experimental-a1c2d3e4
20
23 -// TODO: Main includes breaking changes. Bump this to 18.0.0.
24 -const ReactVersion = '17.0.3';
21 +const ReactVersion = '18.0.0';
22
23 // The label used by the @next channel. Represents the upcoming release's
24 // stability. Could be "alpha", "beta", "rc", etc.
28 -const nextChannelLabel = 'next';
25 +const nextChannelLabel = 'alpha';
26
27 const stablePackages = {
28 'create-subscription': ReactVersion,
@@ -52,7 +49,6 @@ const experimentalPackages = [
49 'react-server-dom-webpack',
50 ];
51
55 -// TODO: Export a map of every package and its version.
52 module.exports = {
53 ReactVersion,
54 nextChannelLabel,
scripts/release/publish-commands/validate-tags.js
+1 -1
@@ -19,7 +19,7 @@ const run = async ({cwd, packages, tags}) => {
19 );
20 const {version} = await readJson(packageJSONPath);
21 const isExperimentalVersion = version.indexOf('experimental') !== -1;
22 - if (version.indexOf('0.0.0') === 0) {
22 + if (version.indexOf('-') === 0) {
23 if (tags.includes('latest')) {
24 if (isExperimentalVersion) {
25 console.log(
scripts/rollup/build-all-release-channels.js
+15 -10
@@ -12,6 +12,7 @@ const {
12 ReactVersion,
13 stablePackages,
14 experimentalPackages,
15 + nextChannelLabel,
16 } = require('../../ReactVersions');
17
18 // Runs the build script for both stable and experimental release channels,
@@ -90,10 +91,12 @@ function processStable(buildDir) {
91 const defaultVersionIfNotFound = '0.0.0' + '-' + sha;
92 const versionsMap = new Map();
93 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 + );
100 }
101 updatePackageVersions(
102 buildDir + '/node_modules',
@@ -220,19 +223,21 @@ function updatePackageVersions(
223
224 if (packageInfo.dependencies) {
225 for (const dep of Object.keys(packageInfo.dependencies)) {
223 - if (versionsMap.has(dep)) {
226 + const depVersion = versionsMap.get(dep);
227 + if (depVersion !== undefined) {
228 packageInfo.dependencies[dep] = pinToExactVersion
225 - ? version
226 - : '^' + version;
229 + ? depVersion
230 + : '^' + depVersion;
231 }
232 }
233 }
234 if (packageInfo.peerDependencies) {
235 for (const dep of Object.keys(packageInfo.peerDependencies)) {
232 - if (versionsMap.has(dep)) {
236 + const depVersion = versionsMap.get(dep);
237 + if (depVersion !== undefined) {
238 packageInfo.peerDependencies[dep] = pinToExactVersion
234 - ? version
235 - : '^' + version;
239 + ? depVersion
240 + : '^' + depVersion;
241 }
242 }
243 }