Conversation
…om base branch Split these features into separate branches for independent review. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR optimizes the performance of pnpm why and pnpm list commands in workspaces with many importers by sharing the dependency graph and materialization cache across all importers instead of rebuilding them independently for each one.
Changes:
- Refactored dependency graph building to accept multiple root nodes and build a single shared graph
- Modified tree materialization to return structured results with deduplication metadata
- Implemented cross-importer caching to avoid redundant tree materialization
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| reviewing/dependencies-hierarchy/src/buildDependencyGraph.ts | Changed to accept an array of root IDs instead of a single root, enabling building a unified graph for multiple importers |
| reviewing/dependencies-hierarchy/src/getTree.ts | Added return type GetTreeResult with deduplication metadata, and implemented top-level caching to detect already-materialized subtrees |
| reviewing/dependencies-hierarchy/src/buildDependenciesHierarchy.ts | Refactored to build a single shared graph and materialization cache for all importers, with logic to handle deduped results in search scenarios |
| reviewing/dependencies-hierarchy/test/getTree.test.ts | Added comprehensive tests for multi-root graph building and cross-call deduplication behavior |
| reviewing/list/src/index.ts | Enabled showDedupedSearchMatches flag for search operations |
| pnpm-lock.yaml | Updated dependencies (@types/node, semver, string-width) |
| .changeset/optimize-why-many-importers.md | Added changeset documenting the performance optimization |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
zkochan
added a commit
that referenced
this pull request
Feb 13, 2026
zkochan
added a commit
to teambit/bit
that referenced
this pull request
Feb 17, 2026
`bit why` now shows a reverse dependency tree. The searched package appears at the root with its dependents as branches, walking back to workspace components. This replaces the previous forward-tree output which was noisy and hard to read for deeply nested dependencies. Also with the complete rewrite of the dependency tree builder we have fixed the out-of-memory errors that were frequent with the why command. The command also became a lot faster. ## Proposed Changes Related PRs: - pnpm/pnpm#10582 - pnpm/pnpm#10586 - pnpm/pnpm#10615 - pnpm/pnpm#10616 - pnpm/pnpm#10627 - pnpm/pnpm#10629 - pnpm/pnpm#10596 --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
No description provided.