Repository navigation
perf(target-graph): index ordered dependency expansion - #1251
Merged
Nemanja Tesic (nemanjatesic) merged 6 commits intoNov 6, 2026
Merged
Nemanja Tesic (nemanjatesic) merged 6 commits into
Nemanja Tesic (nemanjatesic) merged 6 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7b26a45b-25aa-45e3-95b4-f9a1b55dcb58
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The dependency-expansion indexing change has no active review issues.
No open issues 🎉
What changed in this PR
This PR reduces repeated target scans during dependency expansion in Lage’s target-graph builder. It is a self-contained part of the broader performance effort and leaves transitive-cache lifetime unchanged.
Changes:
- Builds expansion-local task and package indexes while preserving target registration order.
- Adds regression tests for dependency ordering, scoped packages, missing tasks, global targets, and index isolation.
- Includes a Beachball patch release note.
| File | Description |
|---|---|
packages/target-graph/src/expandDepSpecs.ts |
Replaces repeated scans with ordered, task/package-indexed lookups. |
packages/target-graph/src/__tests__/WorkspaceTargetGraphBuilder.test.ts |
Adds ordering and index-isolation regression coverage. |
change/change-54bfdc0f-3f47-498d-bd7a-ec056560ef0d.json |
Records the target-graph optimization as a patch release. |
Review effort: Max
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7b26a45b-25aa-45e3-95b4-f9a1b55dcb58
Preserve invocation-local transitive caching alongside ordered dependency indexes and both regression test groups. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7b26a45b-25aa-45e3-95b4-f9a1b55dcb58
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Nemanja Tesic (nemanjatesic)
approved these changes
Nov 6, 2026
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.

Summary
Requested reviewers: Nemanja Tesic (@nemanjatesic) and Elizabeth Craig (@ecraig12345).
Build task/package lookup indexes once per dependency expansion instead of repeatedly scanning all targets. Gather and sort matching target positions to preserve registration order for direct, transitive, and global task dependencies.
Part of the broader Lage performance effort explored in #1238. This change is self-contained and can merge independently. It intentionally excludes the separate transitive-memo lifetime fix. The indexes are expansion-local; there is no new process-wide cache.
Validation