Loading workspace insights... Statistics interval
7 days30 daysLatest CI Pipeline Executions
0ae4455a docs(nx-plugin): add guide on writing performant createNodes v2 plugins (#35981)
## Current Behavior
The plugin authoring docs explain the `createNodesV2` API and how to
build a tooling plugin, but there's no guidance on writing a
*performant* one. `createNodesV2` runs on every graph computation
(before any task cache is consulted), so an inefficient plugin slows
down every command for every developer and CI machine — most painfully
on Windows, where one team reported ~8 minute graph creation.
## Expected Behavior
Adds a new guide, **Write a Performant Project Graph Plugin**, under
`extending-nx`, collecting the patterns Nx's own first-party plugins
use:
- Prefer the batched `createNodesV2` API over per-file v1
- Cache results to disk with a content hash (`PluginCache` +
`calculateHashesForCreateNodes`), writing in a `finally` block
- Hoist shared work (package-manager detection, presets, base configs)
out of the per-file loop
- Load config files in parallel with `Promise.all`
- Keep file globs narrow and output deterministic
- Avoid per-file process spawning and heavy top-level imports
- Develop/debug with `NX_DAEMON`/`NX_CACHE_PROJECT_GRAPH` overrides and
diagnose slow graphs with `NX_PERF_LOGGING` + `nx report`
Also adds cross-links from the project graph plugin and tooling plugin
pages, plus a sidebar entry.
Preview:
https://deploy-preview-35981--nx-docs.netlify.app/docs/extending-nx/performant-project-graph-plugins
## Related Issue(s)
Resolves Linear DOC-516 (auto-linked via the branch name).
Co-authored-by: Jack Hsu <53559+jaysoo@users.noreply.github.com>
Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>