Skip to content
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

[Feature] Support layer zip file as an alternative to cache folder #6578

Open
2 tasks
Downchuck opened this issue Oct 25, 2024 · 0 comments
Open
2 tasks

[Feature] Support layer zip file as an alternative to cache folder #6578

Downchuck opened this issue Oct 25, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Downchuck
Copy link

  • I'd be willing to implement this feature (contributing guide)
  • This feature is important to have in this repository; a contrib plugin wouldn't do

Describe the user story

Enable the cacheFolder to point to a store zip archive which contains all of the zip files that would otherwise be in a folder.

Describe the solution you'd like

Yarn Berry functions well in putting zip files into a local .yarn/cache folder which can then be zipped up as a layer.zip for deployment to cloud services such as AWS Lambda. In some deployment cases it would be nice to distribute that zip file directly without requiring an unzip pass.

As the zip archives in the cache folder are already loaded through yarn's zip processing, allowing the cacheFolder feature, perhaps as cacheArchive to point to a read-only zip may be well supported.

Describe the drawbacks of your solution

This is a niche feature, which adds one level of indirection from fs readdir and seek; while that is unlikely to cause any concern, simply supporting the feature does add more complexity to the list of yarn settings. The solution is for read-only archives and users may request additional tooling, such as explicit instructions on how to zip their current cache folder to make a zip file.

Describe alternatives you've considered

Simply unzipping the cache archive works well, and for zero install, a cache archive can be more appropriate than many zip files.
That stated, if a zip archive is modified with intention, the update of the dependency will be nearly the same size as if it was a separate file.

And so a repository whether on blob store or in revision control, may have a single .yarn/cacheArchive.zip file and still work within practice as well as having the many .yarn/cache/...zip files as we do in present use.

@Downchuck Downchuck added the enhancement New feature or request label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant