fix(testing): support NX_CACHE_PROJECT_GRAPH when reading inferred config from jest cache file#32380
Merged
leosvelperez merged 1 commit intonrwl:masterfrom Aug 18, 2025
Conversation
…nfig from jest cache file
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
View your CI Pipeline Execution ↗ for commit b685976
☁️ Nx Cloud last updated this comment at |
leosvelperez
approved these changes
Aug 18, 2025
FrozenPandaz
pushed a commit
that referenced
this pull request
Aug 22, 2025
…nfig from jest cache file (#32380) ## Current Behavior The Jest plugin does not use `NX_CACHE_PROJECT_GRAPH` in its implementation. Unlike other plugins (e.g., ESLint, TypeScript), it does not provide a way to control or disable its internal caching behavior. ## Expected Behavior The Jest plugin should leverage `NX_CACHE_PROJECT_GRAPH`, ensuring consistent caching behavior across Nx plugins. This would make it easier to manage or override caching strategies when building higher-order plugins that extend Nx core functionality. ## Related Issue(s) Fixes # --- ### Additional Context * When creating higher-order plugins that extend Nx core plugins, it’s often useful to manage cache differently. Without this, concurrency issues can occur if `createNodesV2` is invoked multiple times in parallel. * This highlights a broader need for improved plugin extensibility: * Instead of re-invoking `createNodesV2` (which handles multiple files, cache, etc.), it would be helpful to expose lower-level functions responsible only for generating configuration. * This would give plugin authors more granular control while reducing unintended side effects. (cherry picked from commit d5de2c6)
Contributor
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Current Behavior
The Jest plugin does not use
NX_CACHE_PROJECT_GRAPHin its implementation. Unlike other plugins (e.g., ESLint, TypeScript), it does not provide a way to control or disable its internal caching behavior.Expected Behavior
The Jest plugin should leverage
NX_CACHE_PROJECT_GRAPH, ensuring consistent caching behavior across Nx plugins. This would make it easier to manage or override caching strategies when building higher-order plugins that extend Nx core functionality.Related Issue(s)
Fixes #
Additional Context
When creating higher-order plugins that extend Nx core plugins, it’s often useful to manage cache differently. Without this, concurrency issues can occur if
createNodesV2is invoked multiple times in parallel.This highlights a broader need for improved plugin extensibility:
createNodesV2(which handles multiple files, cache, etc.), it would be helpful to expose lower-level functions responsible only for generating configuration.