-
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(core): map lock file data to external dependencies #12185
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
62101cb
to
b8fd520
Compare
85b3fea
to
86ec6f6
Compare
86ec6f6
to
3e08fea
Compare
16da427
to
221adb9
Compare
221adb9
to
6452666
Compare
202385b
to
a223479
Compare
4ac551e
to
d4ad2d5
Compare
d4ad2d5
to
b0b8234
Compare
}); | ||
} | ||
|
||
private hashTarget(projectName: string, targetName: string): PartialHash { |
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.
it has to be the other way around.
We don't know what your executor depends on. It's not like run-commands is an exception. It's the opposite: nrwl/webpack etc are exceptions
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.
It searches for executors in the externalNodes
and if found returns the hash of that package and its dependencies. For run-commands
we know we shouldn't look for the dependencies of @nrwl/workspace
.
Are you saying that everything that isn't @nrwl/*
should be considered as hash-all-external-nodes
?
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.
Done!
packages/nx/src/hasher/hasher.ts
Outdated
@@ -361,6 +361,48 @@ class TaskHasher { | |||
}; | |||
} | |||
|
|||
private traverseExternalNodesDependencies( |
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.
Given that the number of external dependencies can be large and we traverse them for every task, should we cache the hash for every external dependency?
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.
Yes, I think that would be a good idea. To hash it during the parse phase.
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.
I added hash caching in the externalNodes
da1747f
to
2bd13ad
Compare
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 brings accurate external dependencies mapping to the project graph.
Implementation details
LockFileData
structure when a lock file is changednxdeps.json
cache for later comparison (add an additional field to nx deps cache object)LockFileData
to partialProjectGraph
(graph with onlyexternalNodes
and their dependencies populated)print-affected
to ignoreexternalNodes
's dependenciesBenefits
Performance (calculated on Nx repo) with Yarn:
Fixes #12033
Fixes #11874