Skip to content

fix(testing): support NX_CACHE_PROJECT_GRAPH when reading inferred config from jest cache file#32380

Merged
leosvelperez merged 1 commit intonrwl:masterfrom
jogelin:support-skip-project-graph-jest-crystal
Aug 18, 2025
Merged

fix(testing): support NX_CACHE_PROJECT_GRAPH when reading inferred config from jest cache file#32380
leosvelperez merged 1 commit intonrwl:masterfrom
jogelin:support-skip-project-graph-jest-crystal

Conversation

@jogelin
Copy link
Copy Markdown
Contributor

@jogelin jogelin commented Aug 18, 2025

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.

@jogelin jogelin requested a review from a team as a code owner August 18, 2025 07:41
@jogelin jogelin requested a review from jaysoo August 18, 2025 07:41
@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Aug 18, 2025 7:56am

@netlify
Copy link
Copy Markdown

netlify Bot commented Aug 18, 2025

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit b685976
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/68a2d947525e9c0008af9d23
😎 Deploy Preview https://deploy-preview-32380--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Aug 18, 2025

View your CI Pipeline Execution ↗ for commit b685976

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 23m 39s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 1m 57s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 7s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 7s View ↗
nx documentation ✅ Succeeded 2m 21s View ↗

☁️ Nx Cloud last updated this comment at 2025-08-18 08:13:11 UTC

@leosvelperez leosvelperez merged commit d5de2c6 into nrwl:master Aug 18, 2025
10 checks passed
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)
@github-actions
Copy link
Copy Markdown
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.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants