Allow NX to run tasks without calculating the dependency tree #35440
joshmossas
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My proposal
I would really like it if there was an option for NX to run a command without calculating the dependency graph or just ignoring the dependency graph altogether. This could be a cli flag such as
--skip-dep-graphor it could be an environment variable such asNX_SKIP_GRAPH.When either of those options are set NX should not attempt to calculate the dependency tree at all. Instead, it will just run the task normally. (Basically becoming a "dumb" task runner)
Some Context
I'm working with an organization that has a very large monorepo with multiple languages (rust, TS, lua, python).
We are using custom plugins to so that NX can calculate the dependency graph for these languages but here's the thing. In local development, we don't actually care about the dependency graph we just want to use NX as a task runner.
Consider this example. Our rust plugin needs to rely on the
cargo metadatacommand to figure out which crates import which crates. However if one developer is working on the Typescript code or the Python code they don't necessarily need to have cargo installed. NX is forcing us to make everyone install the tooling for every language in the repo, because all the plugins want to recalculate the graph all the time.When I run
nx build frontendI should not have to have cargo installed or python, but because NX is calculating the dependency tree it will try to run cargo (or protoc or whatever other tooling is needed). Additionally the NX daemon is watching all the files in the (very large) repo once again trigging a dependency graph recalculation.Now the way we've been getting around this is adding special environment variables that our plugins detect such as:
We also have custom plugin options such as
"ignoreCargoErrors": truewhich can be set in the nx.json. Lastly, we've been adding a bunch of stuff to .nxignore, but really so much of this headache would be solved if we could just tell NX to stop calculate the dependency graph.We still rely heavily on the NX project graph in CI. For a large repo it's extremely valuable to be able to test and lint only the projects that have been affected, but it's been causing a lot of friction in our local development. A simple toggle would fix so many issues.
Beta Was this translation helpful? Give feedback.
All reactions