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

Evaluate switching / upgrading package manager (for development) #1693

Closed
bd82 opened this issue Oct 30, 2021 · 9 comments · Fixed by #1819
Closed

Evaluate switching / upgrading package manager (for development) #1693

bd82 opened this issue Oct 30, 2021 · 9 comments · Fixed by #1819
Labels

Comments

@bd82
Copy link
Member

bd82 commented Oct 30, 2021

This project currently uses Yarn 1.x which is no longer developed.

The two primary options are:

  • Upgrade to yarn 3.x
  • Switch to pnpm.

I recently played with pnpm and was quite impressed, it may be the first candidate to try out.

@bd82 bd82 added the DevOps label Oct 30, 2021
@NaridaL
Copy link
Collaborator

NaridaL commented Oct 31, 2021

How about plain NPM :-)

@bd82
Copy link
Member Author

bd82 commented Oct 31, 2021

NPM seems to always be behind features wise and performance wise, e.g:

  • They recently implemented workspaces, but Yarn has already moved to Plug&Play and pnpm supports both a linking approach.

Because NPM (different versions) comes pre-bundled with node installations it might make it more difficult to manage
and lock a specific NPM version for the project (There may be some tools to help with that...).

@NaridaL
Copy link
Collaborator

NaridaL commented Oct 31, 2021

Do we need any of the other features? As there aren't many dependencies, I don't thing performance is an issue.

If maintainability is a priority, I think just using NPM is the easiest as everyone knows how that works.

@bd82
Copy link
Member Author

bd82 commented Oct 31, 2021

We need workspaces for the mono repo.

That is supported is in npm 7.x, however nodejs 12 and 14 come pre-bundled with older versions of npm.
And I am not sure how to enforce all npm commands inside a specific directory (this repo) will always run with a specified npm version.

Other things I found useful in other projects were: (not currently needed here).

  • Yarn's nohoist feature (not yet implemented in npm)
  • pnpm's override feature.

Still it should be possible to switch to using only npm.
However, I am biased as imho yarn/pnpm are the better tools, and have been for multiple years now.
So I am not likely to invest effort in the npm route.

But I still want to modernize the repo as we are currently using an old release of yarn

  • also looking towards replacing Lerna as it is mostly un-maintained nowadays.

@NaridaL
Copy link
Collaborator

NaridaL commented Nov 1, 2021

You can add package.json engines.npm for the npm version

@bd82
Copy link
Member Author

bd82 commented Nov 1, 2021

You can add package.json engines.npm for the npm version

But would chevrotain developers need to do npm install -g [email protected] every time the switch to this repo's dir?

Yarn has a mechanism to lock the binary version per specific project.
Pnpm does not have such a mechanism afaik, but it is less of an issue as there are fewer projects that depend on legacy pnpm versions (at least for me).

I know there are 3rd party tools that can help with managing the binaries per project (volta/nvm).
But that just leads to a new set of problems with those tools.

It nothing unsolvable, but imho just an additional annoyance/cost for using a less powerful npm CLI tool
so its kind of a lose/lose proposition imho. 😄

@arcanis
Copy link

arcanis commented Jan 7, 2022

Just noticing this thread by pure hasard, while evaluating using Chevrotain to replace one of the PEG.js-based parser in Yarn. If you're interested to upgrade to 3.x, feel free to ping me on the Yarn discord, I'd be happy to answer questions 🙂

@bd82
Copy link
Member Author

bd82 commented Jan 11, 2022

Big Thanks @arcanis 😄

It is not planned anytime soon, and mostly depends more on when I've got both free time and the "muse" for upgrading the dev-ops related things. But a direct channel for questions can only help 👍

I'll ping you on discord 🏓

@bd82
Copy link
Member Author

bd82 commented Jan 13, 2022

Yarn now has a pnpm linker option which could be useful is there are compatibility issues with some tools that do not play well with the default pnp linker.

bd82 added a commit that referenced this issue Jul 2, 2022
bd82 added a commit that referenced this issue Jul 2, 2022
bd82 added a commit that referenced this issue Jul 2, 2022
bd82 added a commit that referenced this issue Jul 3, 2022
bd82 added a commit that referenced this issue Jul 3, 2022
bd82 added a commit that referenced this issue Jul 3, 2022
bd82 added a commit that referenced this issue Jul 3, 2022
bd82 added a commit that referenced this issue Jul 3, 2022
bd82 added a commit that referenced this issue Jul 3, 2022
@bd82 bd82 closed this as completed in #1819 Jul 3, 2022
bd82 added a commit that referenced this issue Jul 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants