Replies: 3 comments 8 replies
-
I'm also working on migrating a large existing yarn classic + lerna monorepo to yarn 3 and I agree with almost all of these points. On 2. I agree that git lfs should definitely be called out. You have this line in the docs:
I don't think this is accurate. Git may perform okay-ish with 139 MB of zipped yarn cache at a single point in time but as packages are added in subsequent commits, this will definitely compromise git's performance without LFS. Since the files are checked in zipped I don't think git's packing algorithm(s) can do much. I would expect non-shallow clones would become problematic quite quickly.
I've seen numerous issues/discussions around this confusion so I think it's something that the maintainers should contemplate. |
Beta Was this translation helpful? Give feedback.
-
Hey Nick, I was in vacations and missed your post -
This used to be the case, but we changed it in 3.0 to automatically enable the Yes, PnP is still recommended because it solves many soundness, performance, and stability issues, but not everyone wants that at the same time as they upgrade to the latest "maintained" version.
It was like this in Yarn 1, and virtually noone knew about the offline mirror - which I truly believe is one of the most essential feature in Yarn, as I saw it countless time let us deploy when the npm registry was down and the yarnpkg twitter account was swamped of support requests. I understand the default may not be for everyone, but at least you know it's there. That said, there are some improvements that could be done to
I think this got fixed recently. In any case, we welcome any PR that would help at clarifying those sections (and preparing them for the many Yarn versions to come, since we'll likely start the work on the next major early next year).
I don't have the energy to dive into the topic again, but in short: what we do doesn't matter if there's no one picking up the phone. The solution to the IDE problems, to my knowledge, isn't doing X or Y instead of Z, but rather getting someone from those IDE teams actually committed to discuss whether the solution is X, Y, or Z. As a side note, the JetBrains folks actually came here back when the 2.0 was still in RC, to make sure our softwares were compatible. I enjoyed this interaction very much, and I'm still hoping to see other IDEs knock to the door someday. In the meantime, we'll do what we can do / have to do. |
Beta Was this translation helpful? Give feedback.
-
The community has tested the git LFS approach and it didn't really work out well. LFS equals LARGE files storage, but the packages are mostly in the several hundred kb range, and there are tons of them. LFS is very slow in this scenario, and it's very hard to work with because LFS related tooling isn't optimal for such use cases. It was actually meant for actual large files, and ideally a small number of them. With compressionLevel 0, git can actually store diffs of changes. This means that you can update a package, and if only a few lines inside a js file from it changes, a new copy of the entire zip file won't be stored. This should be extremely efficient. Here's a sample script that confirms this:
Output, size of git: One additional benefit is that git has its own compression which can be more efficient that zip compression. By disabling zip compression, git can more efficiently use its own compression and you actually end up with a smaller git repository, when stored. For more about this there's some related discussion on Discord here: https://discord.com/channels/226791405589233664/226793713722982400/819593307767177256 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I recently experimented with migrating some projects from Yarn classic/1 to Yarn 3/berry. So far I have noticed significant performance improvements and some workflow improvements, but I've also spent a bit of extra time trying to figure out config options and workflow changes that seemed pretty confusing to me. I greatly appreciate the Yarn team's work on all these new tooling features, but some of these changes are causing friction in me migrating my projects, and I'm hoping that my suggestions on improving the migration process could make it easier for users to switch to them.
yarn
in an existing project automatically switched to PNP. If users don't want to have to make any changes to their code, there's a good change they will continue to use Yarn Classic anyway.enableGlobalCache
by default. Alternatively instead of adding the configuration locally by default, the default config behavior could be changed to enableenableGlobalCache
unless in a zero install project (as to not interfere with those committed files).loose
mode for incompatible dependencies, this could be very helpful for users ofcreate-react-app
for example.yarn set version berry
always updates to the latest version of Berry. Also it doesn't seem to make sense that "Yarn latest" refers to Yarn 3 in some cases, since thelatest
tag of theyarn
npm package is Yarn 1, and Yarn 3 is actually Yarn berry.yarn init
should be as similar to the documentation as possible to encourage best practices and reduce confusion. Currently it generates a different gitignore, and adds some files like.editorconfig
that aren't necessary on all projects (for example I use Prettier so is an extra file I have to remember to delete).Beta Was this translation helpful? Give feedback.
All reactions