Skip to content

Commit ec78b13

Browse files
authored
Don't override use-sync-external-store peerDeps (#22882)
Usually the build script updates transitive React dependencies so that they refer to the corresponding release version. For use-sync-external-store, though, we also want to support older versions of React, too. So the normal behavior of the build script isn't sufficient. For now, to unblock, I hardcoded a special case, but we should consider a better way to handle this in the future.
1 parent 06f4034 commit ec78b13

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

packages/use-sync-external-store/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
],
2121
"license": "MIT",
2222
"peerDependencies": {
23-
"react": "^16.8.0 || ^17.0.0"
23+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0-rc"
2424
}
2525
}

scripts/release/publish-commands/parse-params.js

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ module.exports = () => {
4545
case 'experimental':
4646
case 'alpha':
4747
case 'beta':
48+
case 'rc':
4849
case 'untagged':
4950
break;
5051
default:

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

+7
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,13 @@ function updatePackageVersions(
243243
}
244244
}
245245
if (packageInfo.peerDependencies) {
246+
if (!pinToExactVersion && moduleName === 'use-sync-external-store') {
247+
// use-sync-external-store supports older versions of React, too, so
248+
// we don't override to the latest version. We should figure out some
249+
// better way to handle this.
250+
// TODO: Remove this special case.
251+
continue;
252+
}
246253
for (const dep of Object.keys(packageInfo.peerDependencies)) {
247254
const depVersion = versionsMap.get(dep);
248255
if (depVersion !== undefined) {

0 commit comments

Comments
 (0)