-
-
Notifications
You must be signed in to change notification settings - Fork 189
feat(rsc): ability to merge client reference chunks #766
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
Merged
hi-ogawa
merged 17 commits into
main
from
08-23-feat_rsc_ability_to_merge_client_reference_chunks
Aug 24, 2025
Merged
feat(rsc): ability to merge client reference chunks #766
hi-ogawa
merged 17 commits into
main
from
08-23-feat_rsc_ability_to_merge_client_reference_chunks
Aug 24, 2025
Conversation
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
444d758
to
85eb39a
Compare
Adds comprehensive JSDoc documentation for the clientChunks configuration option, including usage examples, parameter details, and benefits of custom client chunking. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
4 tasks
Actually it might be no-brainer to just go with #767 as a default behavior. |
We should do so at some point, but for now let's merge this. |
This was referenced Aug 24, 2025
dai-shi
added a commit
to wakujs/waku
that referenced
this pull request
Aug 28, 2025
This PR enables client reference chunk optimization implemented by vitejs/vite-plugin-react#766 and vitejs/vite-plugin-react#767. I will likely enables this by default in next release, but testing on Waku for starter. The idea is similar to the one explained in https://devongovett.me/blog/parcel-rsc.html "Bundling client components" section. > One interesting thing you might notice is that "use client" is not an explicit code splitting point like dynamic import(). If you import more than one client component from a server component, the client components will be grouped together into a single bundle instead of split into separate bundles. This difference can be seen in `packages/website` where previously each `"use client"` component file becoming its own chunk e.g. https://waku.gg/ - `Destination` -> `/assets/destination-xxx.js` - `Start` -> `/assets/start-xxx.js` - `Fade` -> `/assets/fade-xxx.js` - `Menu` -> `/assets/menu-xxx.js` - `Navigation` -> ... - `Scroll` -> ... - etc. but now, some client component chunks are merged together based on server-side usage, e.g. https://waku-git-fork-hi-ogawa-08-24-featoptimi-f784e4-daishis-projects.vercel.app/ - `Destination`, `Start` -> `/assets/index-xxx.js` (only used in `/`) - `Fade`, `Menu`, `Navigation`, `Scroll` -> `/assets/fade-xxx.js` (shared by all pages `/`, `/blog`, ...) - etc. --------- Co-authored-by: Daishi Kato <[email protected]>
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.
Description
todo
idea
Example:
Use
clientChunks
to specify custom groupingcustom-a = mod1, mod2
andcustom-b = mod3
Internally virtual modules will look like following: