Add ability to run a target without running it's dependencies. #23342
Replies: 4 comments
-
I'm not sure I understand the motivation for this. Can you give an example of how this would be dangerous currently / why you would want to disregard configured dependencies? |
Beta Was this translation helpful? Give feedback.
-
Some executors use process.env to set env variables. If those executors/targets are run concurrently in the same process, there are race conditions that can happen. The way to solve that is to fork nx and run the target in separate processes. The problem is that there is no way to do that for targets without also re-executing all the dependencies of the target. A good example is the module federation dev server. Also, it would just simply be nice to be able to run a target and not run it's dependencies from the command line. |
Beta Was this translation helpful? Give feedback.
-
I've converted this to a discussion so we can discuss more easily. |
Beta Was this translation helpful? Give feedback.
-
We also need that. We use NX-Cloud with DTE for running complex CI/CD processes. We have, for example, several deployment targets, which are dependent on each other. However, for testing specific changes locally against our AWS environments, we don't need to deploy everything - even though it would be the correct way to ensure it's correctly deployed, which is why we obviously set it as a dependency. However, as mentioned earlier: For specific testing purposes, you simply don't want to deploy everything. Just saves local development time. And deployments are obviously not cached. So I hope the point it clear why it would be great to have a option of skipping dependenies, without always manually adjusting the dependencies in our project.json files. |
Beta Was this translation helpful? Give feedback.
-
Description
The ability to run a target without running it's dependencies.
IE just run a target but not it's deps.
Motivation
Currently most executors run targets in-process. Sometimes in parallel. This is dangerous given how many env variables are used in NX executors now.
It would be better if it was easy for an executor to fork off a nx executor with a nx command to just run a single target.
Suggested Implementation
Some option on nx run and run-many.
Alternate Implementations
Beta Was this translation helpful? Give feedback.
All reactions