-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(graph): display expanded task inputs #19597
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 2b3e3ed. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 6 targets
Sent with 💌 from NxCloud. |
4b8b9f8
to
73471b5
Compare
422457b
to
2b3e3ed
Compare
function expandInputs( | ||
inputs: string[], | ||
project: ProjectGraphProjectNode, | ||
allWorkspaceFiles: FileData[], | ||
depGraphClientResponse: ProjectGraphClientResponse | ||
): Record<string, string[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be replaced by the rust functionality that is going to be built out soon. But for now it's fine to have here. I'll replace this when the new function is ready.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're going to have a follow up PR to replace the expandInputs
function with a rust one to match the task hasher.
We also should take a look at the actual performance of the task view in the graph because it's quite bloated and slow. But we'll do that in a future PR as well.
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 PR adds a list of inputs per task to the graph UI:
It also lists dependencies' & external inputs in separate sections:
Implementation
We've expanded the
nx graph
command.graph.ts - getExpandedTaskInputs
will use the newHashPlanner
to calculate all files that contribute to a project's inputs. Because expanding inputs for all projects is potentially time-consuming, we try to do it lazily.nx graph
, we have a live server started ingraph.ts
. When queried, this calculcates the expanded inputs for only one task.This lazy loading sets the task input request apart from the project & task graph requests made in the graph UI. Those are made once when loading a route. By contrast, the individual task inputs are loaded when opening the task tooltip. This required us to break out of the loader pattern somewhat to get the task inputs.
We could adapt this approach to load all task inputs per route, which would probably result in a lot of unused computation (because we don't expect folks to actually click on all the different task inputs). It would, however, be more in line with how we're currently doing things and result in cleaner code.