fix(tsconfig): dedupe project reference dependencies#284
Conversation
|
Warning Review limit reached
Next review available in: 15 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR improves tsconfig project-reference resolution by preventing redundant work and growth in tracked tsconfig dependency lists, reducing repeated traversals and memory pressure when resolving transitive project references.
Changes:
- Deduplicate
TsConfig.file_dependencieswhen merging extended configs and project references via a shared helper. - Add a
visitedset toTsConfig::find_reference_pathsto avoid re-walking already-seen reference nodes during transitive traversal. - Add a regression unit test to ensure dependency deduplication behavior is preserved.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/tsconfig.rs |
Adds file-dependency dedupe helper and a visited-set guard for reference-path traversal to prevent repeated walking. |
src/lib.rs |
Switches project-reference dependency merging to the new dedupe helper. |
src/tests/tsconfig_project_references.rs |
Adds a regression test verifying file dependency deduplication. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ee0b90d to
7ead072
Compare
7ead072 to
d8610fa
Compare
Summary
TsConfig::resolveiterate the flattened reference list directly, removing per-resolve recursive traversal and visited-set hashing.Verification
cargo fmt --checkcargo test tsconfig_project_references --libcargo test --libwas also run; non-tsconfig PnP tests fail in this local environment (src/tests/pnp.rs), while 143 other tests pass.Local downstream validation
Earlier in this investigation, built a local Rspack binding against the resolver fix and verified the ccweb Platform build with:
Result: exit 0, peak RSS around 12.6 GB. Before the dependency dedupe fix, the same validation still hit
exit 137/ memory pressure after only adding the reference traversal visited set.