Does using Git protocol with workspaces support reduce download size? #5681
Unanswered
shinebayar-g
asked this question in
Q&A
Replies: 1 comment
-
Looking at the sources we don't do particular optimizations, but it should be possible to replace
Are you interested to open a PR?
Workspaces themselves can't be optimized, since Yarn needs to read the repo files in order to know where the workspace is located - so we can't just clone a specific path. We can however clone a single commit rather than everything. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there. I'm using git protocol https://yarnpkg.com/protocol/git with Workspaces support to install dependencies. Git protocol with workspaces support is an unique killer feature that only Yarn Berry offers. It works well and I love it.
Remote workspace I'm installing is very small, but repository itself is quite large. I am guessing Yarn will clone the big repo first and then pack the workspace afterwards.
Does using workspaces support help reduce the over all download size?
It looks like if it's cached it's just as fast as regular npm download cache. But when updating to a new tag or commit, it's taking roughly the same amount of time as fresh git clone.
Is there any optimization implemented like git's --depth 1, sparse-checkout and --filter? Or deduping the git clone action if multiple packages are coming from the same repository?
It would be awesome if things like how this works under the hood and what to watch out for etc mentioned on the docs.
Beta Was this translation helpful? Give feedback.
All reactions