Skip to content

Switch package manager to pnpm or npm #1660

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

Open
flevi29 opened this issue May 23, 2024 · 10 comments · May be fixed by #1863 or #1899
Open

Switch package manager to pnpm or npm #1660

flevi29 opened this issue May 23, 2024 · 10 comments · May be fixed by #1863 or #1899
Assignees
Labels
maintenance Issue about maintenance (CI, tests, refacto...)

Comments

@flevi29
Copy link
Collaborator

flevi29 commented May 23, 2024

A lot of high profile repositories these days use pnpm, for instance:

I was looking into upgrading Yarn, but it looks like to make full use of the latest Yarn, we'd have to make some trade-offs and non-standard changes.

Instead I will be switching to pnpm, and I will do so for every JS/TS repository in the meilisearch org, if you'll allow me.

@flevi29 flevi29 added the enhancement New feature or request label May 23, 2024
@curquiza
Copy link
Member

Hello, I saw discussion here, but I answer in this issue for an easier traceability with community: I'm not sure this change is worth it. We would like to keep what is working and yarn is not deprecated and still widely used. We want to avoid pain and work in order to focus on the most critical things. I'm afraid of the new pains this huge change could bring.

However I agree with you @flevi29, updating yarn could be a good move

Would love to have the opinion of the community of this

@flevi29
Copy link
Collaborator Author

flevi29 commented May 29, 2024

I'm not so sure about this huge pain and work. I detailed in the PR in my last comment that this will not be the case because of how corepack works, that's literally the whole point of corepack. EDIT: Sorry if I'm being rude.

Anyhow, the way I see it, to upgrade you'll still need to change actions/setup-node@v4 to enable corepack instead of installing yarn globally.
Read on Yarn's page more: https://yarnpkg.com/getting-started/install

@flevi29
Copy link
Collaborator Author

flevi29 commented May 29, 2024

Alright fair enough, switching to pnpm might be a little much, I'll open another issue for updating yarn.

@flevi29 flevi29 closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2024
@flevi29
Copy link
Collaborator Author

flevi29 commented May 29, 2024

Closed in favour of #1664.

@flevi29 flevi29 reopened this Feb 2, 2025
@flevi29 flevi29 added maintenance Issue about maintenance (CI, tests, refacto...) and removed enhancement New feature or request labels Feb 2, 2025
@flevi29
Copy link
Collaborator Author

flevi29 commented Feb 3, 2025

Updated description.

@flevi29 flevi29 self-assigned this Feb 4, 2025
@Strift
Copy link
Collaborator

Strift commented Feb 27, 2025

I know @curquiza and @brunoocasali have some concerns, so I'll share my feedback regarding moving to PNPM here.

Why migrate from Yarn?

First of all, the yarn version we are using has entered maintenance mode. Eventually it will reach EOL and we will have to migrate to a new Yarn version. The different versions of Yarn have different ways to resolve dependencies, create different lockfiles, and don't interoperate particularly well in my experience. So a migration will be needed at some point anyway.

Why PNPM?

Generally speaking, I'm in favor of moving to PNPM because it makes the lives of maintainers easier. As Flevi pointed out, it's now a common tool for front-end libraries, and I have more experience with it than I do with Yarn.

My main selling points for PNPM are:

  • Faster installation (helps with PR reviews and speeds up CIs)
  • I often ran into issues when installing deps. It will also make it easier for external contributors to use PNPM IMO
  • Easier mono-repo handling in my experience
  • Better disk space utilization (it's a bonus, but it's enjoyable)

I'm not saying this is a priority, but it would be a welcome improvement to our workflows.

@curquiza
Copy link
Member

Thanks @Strift for your point of view
Can we have the limit and risks migrating to pnpm?

@brunoocasali
Copy link
Member

Knowing that our yarn version is not maintained anymore, why not just use the good ol' npm?

@flevi29
Copy link
Collaborator Author

flevi29 commented Mar 24, 2025

That's also an option. I personally don't mind it. I'm not sure how much it would slow down CI though.

I can open another PR which switches to npm, we'll see the difference then.

@flevi29
Copy link
Collaborator Author

flevi29 commented Mar 26, 2025

Alright here it is #1899. It does miss some bells and whistles, and the lock files are ginormous messes, but it is simpler and available out of the box.

@flevi29 flevi29 changed the title Switch package manager to pnpm Switch package manager to pnpm or npm Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment