Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update next React version #21647

Merged
merged 1 commit into from
Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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