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

Switch to npm #108

Merged
merged 3 commits into from
Jul 6, 2024
Merged

Switch to npm #108

merged 3 commits into from
Jul 6, 2024

Conversation

WULCAN
Copy link
Collaborator

@WULCAN WULCAN commented Jul 5, 2024

We recently had problems with bugs in Yarn 1 regarding package aliases. See #107

The developers of Yarn 1 will not accept bug fixes for Yarn 1 anymore as they want users to upgrade to Yarn 4.

Since Yarn was created, the features that motivated its use have been added to npm. The only exception being parallel execution but npm has added other features that make it very fast anyway.

Here's some performance testing results: https://p.datadoghq.eu/sb/d2wdprp9uki7gfks-c562c42f4dfd0ade4885690fa719c818

Yarn introduced lockfiles to ensure that every install results in the exact same file structure in node_modules across all machines. This approach was quickly adopted by npm in npm 5.

Yarn introduced Workspaces as an optimization for monorepositories. After a few years, npm adopted that in npm 7.

I generated package-lock.json by just running npm install. Then I let Next and npm fight a little about it until they got exhausted and became frienemies. See commit messages for details.

We recently had problems with bugs in Yarn 1 regarding package aliases.
The developers of Yarn 1 will not accept bug fixes for Yarn 1 anymore
as they want users to upgrade to Yarn 4.

Since Yarn was created, the features that motivated its use have been
added to npm. The only exception being parallel execution but npm has
added other features that make it very fast anyway.

Here's some perfomance testing results:
https://p.datadoghq.eu/sb/d2wdprp9uki7gfks-c562c42f4dfd0ade4885690fa719c818

Yarn introduced lockfiles to ensure that every install results in
the exact same file structure in node_modules across all machines.
This approach was quickly adopted by npm in npm 5.

https://engineering.fb.com/2016/10/11/web/yarn-a-new-package-manager-for-javascript/
https://blog.npmjs.org/post/161081169345/v500.html

Yarn introduced Workspaces as an optimization for monorepositories.
After a few years, npm adopted that in npm 7.

https://classic.yarnpkg.com/blog/2017/08/02/introducing-workspaces/
https://docs.npmjs.com/cli/v7/using-npm/changelog

I generated package-lock.json by just running npm install.
That command supports and understands yarn.lock.
next build was not happy that npm removed so many swc dependencies when
we migrated from yarn, so it added some back again.

 ⚠ Found lockfile missing swc dependencies, patching...
 ⚠ Lockfile was successfully patched, please run "npm install"
   to ensure @next/swc dependencies are downloaded
npm wasn't happy with Next's patch, so it just had to tweak it a little.
@WULCAN WULCAN merged commit 049f583 into main Jul 6, 2024
@WULCAN WULCAN deleted the undocumented/switch-to-npm branch July 6, 2024 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants