feat(js): add tree-shaking-based dependency narrowing to the JS project graph#35798
Open
cw-alexcroteau wants to merge 12 commits into
Open
feat(js): add tree-shaking-based dependency narrowing to the JS project graph#35798cw-alexcroteau wants to merge 12 commits into
cw-alexcroteau wants to merge 12 commits into
Conversation
👷 Deploy request for nx-dev pending review.Visit the deploys page to approve it
|
👷 Deploy request for nx-docs pending review.Visit the deploys page to approve it
|
Contributor
Author
|
@nrwl/nx-pipelines-reviewers I believe this is a sufficiently complex feature addition that warrants its own minor release for testing purposes, per the PR template. Please let me know if you believe the same. |
Memoize imported names per source and target during affected narrowing, and precompute changed-file sets per touched project to avoid repeated work.
extract shared helper flows in import and export analysis.
This reverts commit 027c3eb.
add a dedicated guide and link the new @nx/js config from reference and affected docs.
keep the nx.json reference focused on config shape and link dependency narrowing details to the dedicated guide.
alias the narrowing pipeline to Nx's canonical raw dependency type so createDependencies no longer needs a local cast.
cover the case where @nx/js dependency narrowing excludes consumers whose imports are not used in emitted code while keeping consumers that still use the import.
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
This PR adds conservative tree-shaking-based dependency narrowing to the JS project graph.
It covers two related capabilities:
The affected-project narrowing is the higher-value part of the feature, because it directly improves affected precision for real code changes.
Current Behavior
Expected Behavior
What This PR Does
In practice, that means:
Public Reproduction
Related Context
Related Issue(s)
Fixes #35797