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

refactor: migrate to Yarn Berry (v3.2.1) #8764

Merged
merged 120 commits into from
Nov 24, 2022

Conversation

ThatOneCalculator
Copy link
Contributor

@ThatOneCalculator ThatOneCalculator commented May 29, 2022

What

Migrate to Yarn Berry (v3.2.1)

Resolve #5858
Supersede #8472

Why

As yarn v3 (yarn berry) has worked with Misskey for a while and provides better performance when compiling while still retaining backwards compatibility with yarn v1, I feel that upgrading to yarn berry would be a smart choice.

Additional info

I've been building Misskey with yarn v3 for two months now both on my server for production and on my development machine with absolutely no problems. This PR was made simply by running yarn with yarn 3.2.1 and following the yarn migration instructions.

Further steps

  • Documentation on Misskey Hub would have to be updated
  • Update workflow (especially mocha and e2e)
  • Update the install script (maybe docker too?)

@github-actions github-actions bot added packages/backend Server side specific issue/PR packages/frontend Client side specific issue/PR labels May 29, 2022
@ThatOneCalculator ThatOneCalculator marked this pull request as draft May 29, 2022 20:00
@ThatOneCalculator ThatOneCalculator marked this pull request as ready for review May 29, 2022 20:13
@ThatOneCalculator ThatOneCalculator changed the title Add compatibility for Yarn Berry (v3) Switch to Yarn Berry (v3.2.1) May 29, 2022
@ThatOneCalculator
Copy link
Contributor Author

ThatOneCalculator commented May 29, 2022

@acid-chicken I'd personally like your feedback on this PR first if you don't mind, as you've been the most involved with Yarn Berry discussion.

@acid-chicken acid-chicken self-requested a review May 29, 2022 23:07
Copy link
Member

@acid-chicken acid-chicken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your work.
I believe that by using the node_modules linker, we can upgrade without facing most of the problems, so I think this PR is fine with the current policy for now, regardless of whether we move to PnP mode in the future or not.

Also, since Yarn berry has built-in monorepo management system called workspaces, so it would be great (and probably easy) to also improve the current situation, which is awkwardly realized by scripts/install-packages.js and so on.

@acid-chicken acid-chicken added 🛠️Dev Development of Misskey itself and removed packages/frontend Client side specific issue/PR packages/backend Server side specific issue/PR labels May 29, 2022
@acid-chicken
Copy link
Member

acid-chicken commented May 29, 2022

Also, since there are opinions like #5858 (comment), it would be better if Corepack could be used as a boot loader for Yarn berry (instead of placing .yarn/releases/yarn-3.2.1.cjs directly).

@ThatOneCalculator
Copy link
Contributor Author

Running corepack enable in the repo folder didn't change anything, is there a proper way to enable corepack?

@acid-chicken
Copy link
Member

corepack enable is related to environment settings, so it will not change anything in the repository (excluding docs).
Can you confirm that deleting .yarn/releases/yarn-3.2.1.cjs with "packageManager" specified in package.json after running it still works?

@ThatOneCalculator
Copy link
Contributor Author

ThatOneCalculator commented May 30, 2022

Can you confirm that deleting .yarn/releases/yarn-3.2.1.cjs with "packageManager" specified in package.json after running it still works?

@acid-chicken yep!

@github-actions github-actions bot added packages/backend Server side specific issue/PR packages/frontend Client side specific issue/PR labels May 30, 2022
@ThatOneCalculator
Copy link
Contributor Author

Seems like the labeler bot adds back removed labels every commit ^^"

@ThatOneCalculator
Copy link
Contributor Author

Also, since Yarn berry has built-in monorepo management system called workspaces, so it would be great (and probably easy) to also improve the current situation, which is awkwardly realized by scripts/install-packages.js and so on.

Done!

@acid-chicken
Copy link
Member

I assume packages/*/yarn.lock will no longer be used after yarn install should consolidate the lock files in /yarn.lock.

@tamaina
Copy link
Member

tamaina commented Oct 29, 2022

developに追従した

@tamaina
Copy link
Member

tamaina commented Nov 7, 2022

マージしちゃう?

@tamaina

This comment was marked as abuse.

@tamaina

This comment was marked as abuse.

@tamaina
Copy link
Member

tamaina commented Nov 13, 2022

yarn install --immutableであれば1GiBで足りるかも

@rinsuki
Copy link
Contributor

rinsuki commented Nov 13, 2022

そもそもproductionのビルドって yarn v1 版でも1GBで足りるんだっけ?vite入ったから行ける?

@tamaina
Copy link
Member

tamaina commented Nov 13, 2022

無理だった
でも1536MiBならいけた

"got": "12.5.2",
"hpagent": "1.2.0",
"ioredis": "4.28.5",
"ip-cidr": "3.0.10",
"is-svg": "4.3.2",
"jest-mock": "^29.0.3",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

要る?
要るとしてもdevDependenciesじゃないかしら

@@ -82,6 +88,7 @@
"node-fetch": "3.3.0",
"nodemailer": "6.8.0",
"nsfwjs": "2.4.2",
"oauth": "^0.10.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

要る?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DiscordServerServiceとGithubServerServiceでは使われているけど

@tamaina tamaina requested a review from syuilo November 22, 2022 05:34
@tamaina
Copy link
Member

tamaina commented Nov 22, 2022

Fastifyと統合するのちょっと骨折れそう

Copy link
Member

@syuilo syuilo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YOSASOU

@syuilo syuilo merged commit bdbc448 into misskey-dev:develop Nov 24, 2022
@syuilo
Copy link
Member

syuilo commented Nov 24, 2022

🙏🏻🙏🏻🙏🏻

@ThatOneCalculator
Copy link
Contributor Author

🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉

@syuilo
Copy link
Member

syuilo commented Dec 22, 2022

nodeLinker: pnpmだと型の不具合が起きるっぽい
https://mstdn.rinsuki.net/@rinsuki/109556531278084299

@rinsuki
Copy link
Contributor

rinsuki commented Dec 22, 2022

いやこれ peerDependencies に追加すれば解決する

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠️Dev Development of Misskey itself packages/backend Server side specific issue/PR packages/frontend Client side specific issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discussion: Yarn v2
8 participants