experiment: upgrade to Rspack 2 to test e2e impact#8426
experiment: upgrade to Rspack 2 to test e2e impact#8426jacekradko wants to merge 1 commit intomainfrom
Conversation
Bumps the Rspack catalog to 2.0.0 and applies the migration: - Node minimum bumped to 22.12.0 (Rspack 2 requirement) - Convert clerk-js rspack.config.js to .mjs (Rspack 2 core is pure ESM) - Rename output.libraryTarget to output.library.type (8 sites) - Move experiments.cache to top-level cache - Drop --analyze CLI flag (removed in v2; Rsdoctor remains for analysis) - Bump @rsdoctor/rspack-plugin to 1.5.x - Add @rspack/dev-server as a direct dep (no longer bundled with @rspack/cli) Both packages build green across all variants.
🦋 Changeset detectedLatest commit: 54e600e The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
📝 WalkthroughWalkthroughThis pull request upgrades the Rspack build toolchain from v1.7.x to v2.0.0 across the monorepo. Changes include upgrading core Rspack dependencies in Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Review rate limit: 2/5 reviews remaining, refill in 31 minutes and 21 seconds. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@pnpm-workspace.yaml`:
- Around line 50-51: Remove the stale minimumReleaseAge bypass by deleting the
excluded entry '@rspack/*' from the pnpm workspace excludes list (the TODO above
it can also be removed), so the workspace no longer excludes `@rspack` packages
and reduces unnecessary supply-chain risk.
- Around line 24-27: The Node engine fields in packages/ui/package.json and
packages/clerk-js/package.json are too permissive ("engines": { "node":
">=20.9.0" }) given the bump of `@rspack/`* to 2.0.0 (which requires Node 20.19+
or 22.12+); update the "engines" node requirement in both package manifests to
at least ">=20.19.0" (or change both to match the project's stricter root
policy, e.g., ">=24.15.0") so installs won't pass on runtimes that will fail
when rspack runs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 0211ff4c-e591-4bd5-8d00-92577e409af8
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (7)
.changeset/rspack-2-upgrade.mdpackages/clerk-js/package.jsonpackages/clerk-js/rspack.config.mjspackages/clerk-js/turbo.jsonpackages/ui/package.jsonpackages/ui/rspack.config.jspnpm-workspace.yaml
| '@rspack/cli': 2.0.0 | ||
| '@rspack/core': 2.0.0 | ||
| '@rspack/dev-server': 2.0.0 | ||
| '@rspack/plugin-react-refresh': 2.0.0 |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
What is the minimum supported Node.js version for @rspack/core2.0.0 and@rspack/cli 2.0.0?
💡 Result:
The minimum supported Node.js version for both @rspack/core 2.0.0 and @rspack/cli 2.0.0 is Node.js 20.19+ or 22.12+.
Citations:
- 1: https://rspack.rs/guide/migration/rspack_1.x
- 2: https://npmx.dev/package/@rspack/core/v/2.0.0-rc.0
🏁 Script executed:
# Find and display the package.json files mentioned in the review
find . -type f -name "package.json" | grep -E "(packages/ui|packages/clerk-js)" | head -5Repository: clerk/javascript
Length of output: 120
🏁 Script executed:
# Check the Node version requirement in packages/ui/package.json
if [ -f "packages/ui/package.json" ]; then
echo "=== packages/ui/package.json ===" && \
grep -A 2 '"engines"' packages/ui/package.json || echo "No engines field found"
fiRepository: clerk/javascript
Length of output: 136
🏁 Script executed:
# Check the Node version requirement in packages/clerk-js/package.json
if [ -f "packages/clerk-js/package.json" ]; then
echo "=== packages/clerk-js/package.json ===" && \
grep -A 2 '"engines"' packages/clerk-js/package.json || echo "No engines field found"
fiRepository: clerk/javascript
Length of output: 142
🏁 Script executed:
# Check if these packages depend on `@rspack` packages
echo "=== Checking `@rspack` dependencies in packages/ui/package.json ===" && \
grep -E '"@rspack' packages/ui/package.json 2>/dev/null || echo "No `@rspack` deps found" && \
echo && \
echo "=== Checking `@rspack` dependencies in packages/clerk-js/package.json ===" && \
grep -E '"@rspack' packages/clerk-js/package.json 2>/dev/null || echo "No `@rspack` deps found"Repository: clerk/javascript
Length of output: 545
🏁 Script executed:
# Check the root package.json and pnpm-workspace.yaml for context
echo "=== pnpm-workspace.yaml (lines 20-35) ===" && \
sed -n '20,35p' pnpm-workspace.yaml && \
echo && \
echo "=== Root package.json engines ===" && \
grep -A 2 '"engines"' package.json 2>/dev/null || echo "No engines in root package.json"Repository: clerk/javascript
Length of output: 658
Node support contract is inconsistent with the Rspack 2 upgrade.
Line 24–27 upgrades @rspack/* to 2.0.0, which requires Node.js 20.19+ or 22.12+. However, packages/ui/package.json and packages/clerk-js/package.json specify "engines": { "node": ">=20.9.0" }. Both packages use catalog:rspack references, so they will pull 2.0.0 from the workspace catalog. This creates a compatibility gap: Node 20.9.0–20.18.x will pass install checks but fail at runtime when Rspack executes. Update the engine requirements in both packages to >=20.19.0 (or align with the root policy of >=24.15.0 if appropriate).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@pnpm-workspace.yaml` around lines 24 - 27, The Node engine fields in
packages/ui/package.json and packages/clerk-js/package.json are too permissive
("engines": { "node": ">=20.9.0" }) given the bump of `@rspack/`* to 2.0.0 (which
requires Node 20.19+ or 22.12+); update the "engines" node requirement in both
package manifests to at least ">=20.19.0" (or change both to match the project's
stricter root policy, e.g., ">=24.15.0") so installs won't pass on runtimes that
will fail when rspack runs.
| # TODO: remove once rspack 2.0.0 is >48h old (published 2026-04-22) | ||
| - '@rspack/*' |
There was a problem hiding this comment.
Remove the stale @rspack/* minimumReleaseAge bypass.
Line 50 says this should be removed once Rspack 2.0.0 is older than 48h (published 2026-04-22). As of April 30, 2026, that condition is already met. Keeping @rspack/* excluded broadens supply-chain risk unnecessarily.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@pnpm-workspace.yaml` around lines 50 - 51, Remove the stale minimumReleaseAge
bypass by deleting the excluded entry '@rspack/*' from the pnpm workspace
excludes list (the TODO above it can also be removed), so the workspace no
longer excludes `@rspack` packages and reduces unnecessary supply-chain risk.
|
Closing — the same 5 |
Do not merge. Sandbox to test whether upgrading from Rspack 1.7.x → 2.0.0 fixes the consistently-failing express / hono / generic / nextjs / billing / machine integration suites.
The previous experiment (#8425, now closed) was reverting the rspack pin — but that pin was a fix for an earlier rspack regression and shouldn't be reverted. This branch goes the other direction: upgrades to Rspack 2 (the current ecosystem version) on top of latest `main` (Node 24, auto-proxy, etc.).
Sibling experiments still up:
Will be closed regardless of outcome.