-
Notifications
You must be signed in to change notification settings - Fork 384
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
Suggestion: Switch package manager to Yarn 2 #3292
Comments
I don't know much about yarn, but I know it's widely used. I think really my hesitation is that this creates more friction because it's another dependency to install. Faster sounds nice, though. :) |
Yeah, Yarn is widely used. Mostly I like its modern and fashion CLI. It is also bundled in |
From a "developer-user" standpoint, my primary concern is "how much work will it take to make our existing tools work with Yarn?" I'm completely unfamiliar with Yarn, so anything that needs to be modified will block me completely until Someone Else is able to convert tools. This isn't necessarily a problem, since I would assume part of the process of moving to Yarn would be that conversion step, but it is something to be aware of. It's also important that we consider the novice contributor. When I started contributing here, I knew next to nothing about package managers and build tools. Those were things for Experienced And Serious Software Engineers, while I just wanted to write a few lines of Javascript. Installing NPM is already a bit of a barrier for newer contributors, and we really want to do our best to ensure that we do not make things more difficult for them, if possible. Laying that aside, I think moving to Yarn is worth serious consideration just on the basis of improved speed and reduced disk churn. With the next expansion coming up, and all the new content that we will have to add, cutting off 10-15% of the time spent waiting for our tools to work would really add up. How much effort would it take to set up a "prototype" Yarn environment or sandbox that we could try? I am happy to provide feedback on something like that, but I would have very little to contribute as far as putting it together. |
AFAIK, the migration should be done as follows:
I can upload a playable environment with yarn later when I have enough time to tweak configurations. For novices, I think, after installed (If we enable |
After trying several times, sadly I found that Yarn's PnP feature doesn't support ESM currently. So it seems redundant to migrate to Yarn 2 if we don't enable PnP/Zero-Install feature since it does the same work as NPM basically. |
It is so surprising to me how few things support ESM. :C |
It looks like that issue got closed without any fixes? So maybe Yarn isn't going to support PnP+ESM? |
Well, no? |
As NPM now has part of Yarn Berry's features now, it would be better to just upgrade our npm version. |
Yarn 2 (Berry) brings many features:
π Plug'n'Play. To get rid of the extremely biggest
node_modules
, it also make node scripts run faster. moon, earth, sun, black hole, node_modules.ποΈ Faster installation. Not only because of the Zero-installs feature, but Yarn installs packages in parallel, however npm does this one by one, usually Yarn is faster than npm several times.
π© Cross-platform scripts. Yarn includes a simple shell interpreter, make scripts runs consistently across platforms, no matter which OS/Shell you're running from. It is time to get rid of
node_modules/.bin/blahblah
prefixes!There are also disadvantages:
π§ The first one is obvious: you should install Yarn manually and globally, it is not bundled like npm.
π The Plug'n'Play feature is not compatible with all tools, or only be supported by the new version, so it might be painful to make a bunch of tools work.
π« Many IDE/Editor would assume that you are running npm by default, although you can configure it manually, for example in VSCode ESLint plugin.
Feel free to comment your thoughts! (γ₯qββΏβΏβq)γ₯
The text was updated successfully, but these errors were encountered: