argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
18.01k stars 5.49k forks source link

Upgrade to Yarn 2 #5279

Open rbreeze opened 3 years ago

rbreeze commented 3 years ago

Summary

About a year ago, Yarn froze their 1.22.x codebase and is now only pushing patch releases to it. Yarn 2 is now where active development occurs. Given the large list of improvements I think we should migrate Argo CD to Yarn 2.

TLDR: Yarn 2 removes the mess of node_modules and replaces it with a single file called .yarnrc.yml that efficiently references a local cache.

There are 2 paths post migration: a traditional philosophy or Zero Install. node_modules directories could easily be hundreds of megabytes, if not gigabytes in size -- Argo CD's is currently ~600MB and Argo UI's is ~800MB for example. Yarn 2 brings this closer to tens of megabytes, meaning it's feasible to include them in the repo and remove the yarn install step entirely. Yarn recommends this for "professional-grade" environments.

Motivation

Will result in faster (or nonexistent) install times after clone, faster build and run times, less "works on my machine" type issues, and less headaches with peer dependencies.

Proposal

In an ideal world, I think we should aim to achieve the following:

These are listed in ascending order of difficulty / descending imperativeness. It's possible to begin using Yarn 2 without removing reliance on node_modules, and it's possible to remove node_modules without going down the zero install route.

nsinghal12 commented 2 years ago

Can this be assigned to me.

crenshaw-dev commented 1 year ago

Someone can build on top of this: https://github.com/argoproj/argo-cd/pull/11006

blakepettersson commented 1 year ago

Perhaps this task can be updated to instead use pnpm? Similar to Yarn 2 with moar speed. WDYT @rbreeze?