perf(build): Add vendor chunk splitting for heavy stable dependencies#109635
Draft
scttcper wants to merge 2 commits intoscttcper/rspack-deterministic-idsfrom
Draft
perf(build): Add vendor chunk splitting for heavy stable dependencies#109635scttcper wants to merge 2 commits intoscttcper/rspack-deterministic-idsfrom
scttcper wants to merge 2 commits intoscttcper/rspack-deterministic-idsfrom
Conversation
Without explicit cache groups, stable heavy dependencies (React, Emotion, TanStack Query, echarts, etc.) get mixed into app chunks and their cached copies are invalidated on every app code deploy. Add vendor cache groups for: - vendor-react: React, React DOM, React Router, framer-motion, React Aria, React Stately, React Types — the full UI runtime ecosystem - vendor-emotion: emotion CSS-in-JS packages - vendor-tanstack: TanStack Query, Form, Virtual, Pacer - vendor-echarts: echarts + zrender charting library (~400KB min) Also raise maxAsyncRequests from 10 to 30 — the previous limit was unnecessarily restricting async chunk splits on complex routes. With HTTP/2 the default of 30 is appropriate. Co-Authored-By: Claude <noreply@anthropic.com>
emotion is React-specific and always loaded alongside React. Combining them simplifies the chunk structure from four vendor groups to three without meaningful cache granularity loss. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #109631.
Without explicit cache groups, stable heavy dependencies get mixed into app chunks and their browser-cached copies are invalidated on every app code deploy — even when the library versions haven't changed.
This adds vendor cache groups for three groups of packages:
@emotion/*packages. The full UI rendering ecosystem. These are used across hundreds of files but change only when deps are bumped.Also raises
maxAsyncRequestsfrom 10 → 30. The cap was preventing legitimate async chunk splits on complex routes; with HTTP/2 multiplexing the rspack default of 30 is appropriate.Co-Authored-By: Claude noreply@anthropic.com