Skip to content

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