feat(code-splitting): add group-local recursive dependency control#9488
Draft
aminpaks wants to merge 4 commits into
Draft
feat(code-splitting): add group-local recursive dependency control#9488aminpaks wants to merge 4 commits into
aminpaks wants to merge 4 commits into
Conversation
d9a50c5 to
bb21cd0
Compare
4 tasks
graphite-app Bot
pushed a commit
that referenced
this pull request
Jun 2, 2026
…vely` (#9587) ## Summary - Allow `includeDependenciesRecursively` on individual `codeSplitting.groups`, overriding the global value - When omitted on a group, inherits `codeSplitting.includeDependenciesRecursively` (default `true`) - Extends `preserveEntrySignatures` validation to check both global and per-group values Closes #9467 Built on the exploration in #9488 — thank you @aminpaks for the thorough investigation and initial implementation! 🙏 ## Changes | Layer | File | Change | |-------|------|--------| | Rust types | `manual_code_splitting_options.rs` | Add `include_dependencies_recursively: Option<bool>` to `MatchGroup` | | NAPI binding | `binding_manual_code_splitting_options.rs` | Add field to `BindingMatchGroup` | | Binding conversion | `normalize_binding_options.rs` | Map new field | | Chunk logic | `manual_code_splitting.rs` | Per-group fallback: group → global → `true` | | Validation | `prepare_build_context.rs` | `has_non_recursive_dependency_capture()` helper, 2 callsites | | TS types | `output-options.ts` | Add to `CodeSplittingGroup` with JSDoc | | TS validator | `validator.ts` | Add to group schema | ## Example ```js output: { codeSplitting: { includeDependenciesRecursively: true, groups: [ { name: 'route-alpha', test: /routes\/alpha\//, includeDependenciesRecursively: false, // route-only, no sibling deps }, { name: 'shared', test: /shared\//, // inherits global (true) }, ], }, } ``` ## Test plan - [x] Chunking behavior test: group with `false` excludes transitive deps, group without inherits global - [x] Validation test: per-group `false` + `preserveEntrySignatures: 'strict'` → error - [x] All existing `advanced-chunks` tests pass - [x] Full build (`just build-rolldown`) passes
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.
What
Adds
includeDependenciesRecursivelyto manual code-splitting groups.A group-local value overrides the top-level
codeSplitting.includeDependenciesRecursively; omitted group values inherit the top-level option, and the default remainstrue.This updates the Rust options, NAPI binding normalization, generated binding types, TypeScript public types, option validation, JSON config schema, docs, and regression fixtures.
Fixes #9467.
Why
Some manual code-splitting groups need to capture only the modules they directly match, while other groups should keep Rolldown’s existing recursive dependency capture behavior.
The existing top-level option can only disable recursive dependency capture globally, which changes every manual group at once. Making the option group-local allows targeted opt-outs without changing unrelated groups.
The preserve-entry-signature validation now uses the effective group/global value, so non-recursive groups keep the same safety checks as the existing top-level option.
Tophat
Validated locally with:
cargo fmt --all -- --emit=filescargo check -qCI=true just build-rolldowncargo run-fixturecoverage for:includeDependenciesRecursively: falseincludeDependenciesRecursively: falsetrueoverriding top-levelfalseA full
just test-updaterun was attempted; this local checkout could not complete the full workspace run because thetest262submodule is not initialized.AI disclosure
AI assistance was used while developing this change. I reviewed, tested, and validated the implementation before submission.