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

Adds legacy plugin removal behavior #5446

Merged
merged 6 commits into from
May 24, 2023
Merged

Conversation

arcanis
Copy link
Member

@arcanis arcanis commented May 16, 2023

What's the problem this PR addresses?

When using yarn set version with Yarn 4, the core plugins that were previously externals now conflict with the builtin ones, causing surprising errors.

Fixes #4952

How did you fix it?

Yarn will now ignore the specified list of plugins when booting. It'll then automatically remove them during the next install.

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@merceyz merceyz added this to the 4.0.0 milestone May 16, 2023
@arcanis
Copy link
Member Author

arcanis commented May 16, 2023

I reverted the support for immutable installs. I'd still like to support it, but I didn't find a way that didn't feel overkill. Things I considered / tried:

  • Make a ReadOnlyFS that would throw on FS access (but --immutable allows FS access - it just throws if the result is different from the initial state, so for example a recursive mkdir would work if the folder already exists).
  • Add writeFile / readFile callbacks to the changeFile functions (but that seemed redundant with the FakeFS interface itself).
  • Wrap xfs in updateConfiguration using Object.create, and override its writeFilePromise implementation (but that seemed to leak that changeFilePromise uses writeFilePromise under the hood).
  • Inline the code for changeFilePromise (but since it does some magic around line endings, it didn't feel right to include this code inside updateConfiguration).

One of those might still work in the end, but for this iteration I think it's reasonable to ship the main fix and think more about the --immutable situation.

@arcanis arcanis merged commit ebfb96a into master May 24, 2023
@arcanis arcanis deleted the mael/legacy-plugin-removal branch May 24, 2023 10:09
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.

[Bug?]: Updating Yarn to v4 should remove non-bundled official Yarn plugins on first install
2 participants