anchor
anchor copied to clipboard
feature suggestion: remove yarn requirement
Similar to https://github.com/coral-xyz/anchor/issues/2839 - originally there were a few reasons to add a yarn dependency
- Solana docs used to use yarn. Anza's web3.js docs just use npm now. Likewise Solana Foundation's docs just use npm.
- Yarn had lockfiles, so the dependency tree could be replicated easily. npm added dependency lock files back in 2018
- npm used to be quite slow, it's had significant speed increases since 2016 when yarn was released.
There's a few downsides to yarn too:
- when we teach a class and point people to the anchor install page everyone has to manually install yarn dependency along with Rust and Solana CLI. Removing yarn would significantly reduce the steps.
- npm ships with node, and is used in all previous labs to run package.json scripts.
- npm has it's own lock file name, though it will use yarn, it will also tell you it's using yarn, and warnings will appen when both lockfiles are used.
There doesn't seem to be a good reason to require a third party package manage manager anymore.
As @acheroncrypto mentioned in #2839:
It's always good to have less dependencies
😁
To add to the downsides you mentioned, I was a fan of yarn
but their v3 release was quite annoying to upgrade, so I think it's worth moving away from it.
To add to the list, yarn
v4 is not compatible with VSCode out of the box. It requires a special VSCode extension (ZipFS) and needs additional commands to add a typescript SDK, and finally the version of typescript that is used needs to changed manually.