@samitouri / QOS-React-2 / commits / 2c2476834a

Rename "next" prerelease channel to "canary" (#26761)

The "next" prerelease channel represents what will be published the next time we do a stable release. We publish a new "next" release every day using a timed CI workflow. When we introduced this prerelease channel a few years ago, another name we considered was "canary". But I proposed "next" instead to create a greater distinction between this channel and the "experimental" channel (which is published at the same cadence, but includes extra experimental features), because some other projects use "canary" to refer to releases that are more unstable than how we would use it. The main downside of "next" is someone might mistakenly assume the name refers to Next.js. We were aware of this risk at the time but didn't think it would be an issue in practice. However, colloquially, we've ended up referring to this as the "canary" channel anyway to avoid precisely that confusion. So after further discussion, we've agreed to rename to "canary". This affects the label used in the version string (e.g. `18.3.0-next-a1c2d3e4` becomes `18.3.0-canary-a1c2d3e4`) as well as the npm dist tags used to publish the releases. For now, I've chosen to publish the canaries using both `@canary` and `@next` dist tags, so that downstream consumers who might depend on `@next` have time to adjust. We can remove that later after the change has been communicated.

Andrew Clark committed May 3, 2023 at 12:10 UTC 2c2476834a7c739ca239750b73f74aa1df144a93
6 files changed +47 -33
.circleci/config.yml
+15 -5
@@ -604,10 +604,20 @@ workflows:
604 when: << pipeline.parameters.prerelease_commit_sha >>
605 jobs:
606 - publish_prerelease:
607 - name: Publish to Next channel
607 + name: Publish to Canary channel
608 commit_sha: << pipeline.parameters.prerelease_commit_sha >>
609 release_channel: stable
610 - dist_tag: "next"
610 + # The tags to use when publishing canaries. The main one we should
611 + # always include is "canary" but we can use multiple (e.g. alpha,
612 + # beta, rc). To declare multiple, use a comma-separated string, like
613 + # this:
614 + # dist_tag: "canary,alpha,beta,rc"
615 + #
616 + # TODO: We currently tag canaries with "next" in addition to "canary"
617 + # because this used to be called the "next" channel and some
618 + # downstream consumers might still expect that tag. We can remove this
619 + # after some time has elapsed and the change has been communicated.
620 + dist_tag: "canary,next"
621 - publish_prerelease:
622 name: Publish to Experimental channel
623 requires:
@@ -615,7 +625,7 @@ workflows:
625 # will sometimes fail if you try to concurrently publish two
626 # different versions of the same package, even if they use different
627 # dist tags.
618 - - Publish to Next channel
628 + - Publish to Canary channel
629 commit_sha: << pipeline.parameters.prerelease_commit_sha >>
630 release_channel: experimental
631 dist_tag: experimental
@@ -633,7 +643,7 @@ workflows:
643 - main
644 jobs:
645 - publish_prerelease:
636 - name: Publish to Next channel
646 + name: Publish to Canary channel
647 commit_sha: << pipeline.git.revision >>
648 release_channel: stable
649 dist_tag: "next"
@@ -644,7 +654,7 @@ workflows:
654 # will sometimes fail if you try to concurrently publish two
655 # different versions of the same package, even if they use different
656 # dist tags.
647 - - Publish to Next channel
657 + - Publish to Canary channel
658 commit_sha: << pipeline.git.revision >>
659 release_channel: experimental
660 dist_tag: experimental
ReactVersions.js
+12 -8
@@ -7,12 +7,12 @@
7 //
8 // The @latest channel uses the version as-is, e.g.:
9 //
10 -// 18.0.0
10 +// 18.3.0
11 //
12 -// The @next channel appends additional information, with the scheme
12 +// The @canary channel appends additional information, with the scheme
13 // <version>-<label>-<commit_sha>, e.g.:
14 //
15 -// 18.0.0-alpha-a1c2d3e4
15 +// 18.3.0-canary-a1c2d3e4
16 //
17 // The @experimental channel doesn't include a version, only a date and a sha, e.g.:
18 //
@@ -20,9 +20,13 @@
20
21 const ReactVersion = '18.3.0';
22
23 -// The label used by the @next channel. Represents the upcoming release's
24 -// stability. Could be "alpha", "beta", "rc", etc.
25 -const nextChannelLabel = 'next';
23 +// The label used by the @canary channel. Represents the upcoming release's
24 +// stability. Most of the time, this will be "canary", but we may temporarily
25 +// choose to change it to "alpha", "beta", "rc", etc.
26 +//
27 +// It only affects the label used in the version string. To customize the
28 +// npm dist tags used during publish, refer to .circleci/config.yml.
29 +const canaryChannelLabel = 'canary';
30
31 const stablePackages = {
32 'eslint-plugin-react-hooks': '5.0.0',
@@ -40,14 +44,14 @@ const stablePackages = {
44 scheduler: '0.24.0',
45 };
46
43 -// These packages do not exist in the @next or @latest channel, only
47 +// These packages do not exist in the @canary or @latest channel, only
48 // @experimental. We don't use semver, just the commit sha, so this is just a
49 // list of package names instead of a map.
50 const experimentalPackages = [];
51
52 module.exports = {
53 ReactVersion,
50 - nextChannelLabel,
54 + canaryChannelLabel,
55 stablePackages,
56 experimentalPackages,
57 };
fixtures/devtools/regression/canary.html
+3 -3
@@ -15,8 +15,8 @@
15 <script src="https://unpkg.com/scheduler@canary/umd/scheduler-tracing.development.js"></script>
16 <script src="https://unpkg.com/react@canary/umd/react.development.js"></script>
17 <script src="https://unpkg.com/react-dom@canary/umd/react-dom.development.js"></script>
18 - <script src="https://unpkg.com/react-cache@next/umd/react-cache.development.js"></script>
19 -
18 + <script src="https://unpkg.com/react-cache@canary/umd/react-cache.development.js"></script>
19 +
20 <!-- Don't use this in production: -->
21 <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
22 </head>
@@ -38,4 +38,4 @@
38 Learn more at https://reactjs.org/docs/getting-started.html
39 -->
40 </body>
41 -</html>
\ No newline at end of file
41 +</html>
fixtures/devtools/regression/next.html
+7 -7
@@ -11,12 +11,12 @@
11 __REACT_DEVTOOLS_GLOBAL_HOOK__ = parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;
12 </script>
13
14 - <script src="https://unpkg.com/scheduler@next/umd/scheduler.development.js"></script>
15 - <script src="https://unpkg.com/scheduler@next/umd/scheduler-tracing.development.js"></script>
16 - <script src="https://unpkg.com/react@next/umd/react.development.js"></script>
17 - <script src="https://unpkg.com/react-dom@next/umd/react-dom.development.js"></script>
18 - <script src="https://unpkg.com/react-cache@next/umd/react-cache.development.js"></script>
19 -
14 + <script src="https://unpkg.com/scheduler@canary/umd/scheduler.development.js"></script>
15 + <script src="https://unpkg.com/scheduler@canary/umd/scheduler-tracing.development.js"></script>
16 + <script src="https://unpkg.com/react@canary/umd/react.development.js"></script>
17 + <script src="https://unpkg.com/react-dom@canary/umd/react-dom.development.js"></script>
18 + <script src="https://unpkg.com/react-cache@canary/umd/react-cache.development.js"></script>
19 +
20 <!-- Don't use this in production: -->
21 <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
22 </head>
@@ -38,4 +38,4 @@
38 Learn more at https://reactjs.org/docs/getting-started.html
39 -->
40 </body>
41 -</html>
\ No newline at end of file
41 +</html>
scripts/release/prepare-release-from-npm-commands/get-latest-next-version.js
+2 -2
@@ -5,11 +5,11 @@
5 const {execRead, logPromise} = require('../utils');
6
7 const run = async () => {
8 - const version = await execRead('npm info react@next version');
8 + const version = await execRead('npm info react@canary version');
9
10 return version;
11 };
12
13 module.exports = async params => {
14 - return logPromise(run(params), 'Determining latest "next" release version');
14 + return logPromise(run(params), 'Determining latest "canary" release version');
15 };
scripts/rollup/build-all-release-channels.js
+8 -8
@@ -13,7 +13,7 @@ const {
13 ReactVersion,
14 stablePackages,
15 experimentalPackages,
16 - nextChannelLabel,
16 + canaryChannelLabel,
17 } = require('../../ReactVersions');
18
19 // Runs the build script for both stable and experimental release channels,
@@ -127,7 +127,7 @@ function processStable(buildDir) {
127 const version = stablePackages[moduleName];
128 versionsMap.set(
129 moduleName,
130 - version + '-' + nextChannelLabel + '-' + sha + '-' + dateString,
130 + version + '-' + canaryChannelLabel + '-' + sha + '-' + dateString,
131 defaultVersionIfNotFound
132 );
133 }
@@ -140,7 +140,7 @@ function processStable(buildDir) {
140 fs.renameSync(buildDir + '/node_modules', buildDir + '/oss-stable');
141 updatePlaceholderReactVersionInCompiledArtifacts(
142 buildDir + '/oss-stable',
143 - ReactVersion + '-' + nextChannelLabel + '-' + sha + '-' + dateString
143 + ReactVersion + '-' + canaryChannelLabel + '-' + sha + '-' + dateString
144 );
145
146 // Now do the semver ones
@@ -191,16 +191,16 @@ function processStable(buildDir) {
191 reactNativeBuildDir,
192 ReactVersion +
193 '-' +
194 - nextChannelLabel +
194 + canaryChannelLabel +
195 '-' +
196 hash.digest('hex').slice(0, 8)
197 );
198 }
199
200 - // Update remaining placeholders with next channel version
200 + // Update remaining placeholders with canary channel version
201 updatePlaceholderReactVersionInCompiledArtifacts(
202 buildDir,
203 - ReactVersion + '-' + nextChannelLabel + '-' + sha + '-' + dateString
203 + ReactVersion + '-' + canaryChannelLabel + '-' + sha + '-' + dateString
204 );
205
206 if (fs.existsSync(buildDir + '/sizes')) {
@@ -251,10 +251,10 @@ function processExperimental(buildDir, version) {
251 );
252 }
253
254 - // Update remaining placeholders with next channel version
254 + // Update remaining placeholders with canary channel version
255 updatePlaceholderReactVersionInCompiledArtifacts(
256 buildDir,
257 - ReactVersion + '-' + nextChannelLabel + '-' + sha + '-' + dateString
257 + ReactVersion + '-' + canaryChannelLabel + '-' + sha + '-' + dateString
258 );
259
260 if (fs.existsSync(buildDir + '/sizes')) {