Skip to content
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

Fix RSC loading unnecessary bundles #10104

Merged
merged 2 commits into from
Mar 14, 2025
Merged

Fix RSC loading unnecessary bundles #10104

merged 2 commits into from
Mar 14, 2025

Conversation

devongovett
Copy link
Member

When using "use server-entry" in a nested dependency, for example to load either one component or another, separate bundles get created correctly but both still get downloaded even when only one of them is rendered. This PR fixes that issue by stopping at isolated bundle boundaries when traversing the list of referenced bundles. Instead of these bundles being hoisted into the root page's resources, they are loaded on demand when rendered by React. Therefore only the scripts for the rendered components are loaded.

@devongovett devongovett merged commit 0529f29 into v2 Mar 14, 2025
17 checks passed
@devongovett devongovett deleted the rsc-isolated branch March 14, 2025 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant