fix(react-start): dedupe rsbuild dependencies#7644
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a ChangesRSBuild Package Deduplication
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit 5cc2eea
☁️ Nx Cloud last updated this comment at |
Merging this PR will degrade performance by 11.57%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | mem serialization-payload (solid) |
7 MB | 12.1 MB | -41.99% |
| ❌ | Memory | mem aborted-requests (solid) |
2 MB | 2.5 MB | -19.11% |
| ❌ | Simulation | ssr server-fn raw-stream (solid) |
106.5 ms | 111.8 ms | -4.7% |
| ❌ | Simulation | ssr server-fn multipart (solid) |
60.1 ms | 63 ms | -4.68% |
| ⚡ | Memory | mem aborted-requests (vue) |
958.5 KB | 888.9 KB | +7.83% |
| ⚡ | Memory | mem serialization-payload (react) |
32.7 MB | 31.4 MB | +4.02% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing elecmonkey:fix/rsbuild-react-dedupe (5cc2eea) with main (e499164)1
Footnotes
There was a problem hiding this comment.
Nx Cloud is proposing a fix for your failed CI:
We scoped the dedupe: ['react', 'react-dom'] override from all environments to only the client environment, which fixes the RSC 500 errors caused by the server layer resolving to the wrong React instance. Applying dedupe to all environments forced the react-server-components rspack layer to reuse the client-side React bundle, which lacks the react-server export condition required by RSC. This change preserves the deduplication benefit for client bundles while allowing the ssr environment's RSC layer to resolve React independently with the correct condition.
Tip
✅ We verified this fix by re-running tanstack-react-start-e2e-rsc:test:e2e--rsbuild-ssr--shard-4-of-6.
diff --git a/packages/react-start/src/plugin/rsbuild.ts b/packages/react-start/src/plugin/rsbuild.ts
index bd159690..3b75cf86 100644
--- a/packages/react-start/src/plugin/rsbuild.ts
+++ b/packages/react-start/src/plugin/rsbuild.ts
@@ -11,7 +11,7 @@ import type {
import type { RsbuildPlugin } from '@rsbuild/core'
const reactStartRsbuildEnvironmentOverrides = {
- all: {
+ [RSBUILD_ENVIRONMENT_NAMES.client]: {
resolve: {
dedupe: ['react', 'react-dom'],
},
Because this branch comes from a fork, it is not possible for us to apply fixes directly, but you can apply the changes locally using the available options below.
Apply changes locally with:
npx nx-cloud apply-locally HRa7-KQnd
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
Summary
This PR aligns the react-start Rsbuild plugin with the existing Vite-side dedupe behavior.
Summary by CodeRabbit