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

Update yarn to latest stable version #307

Merged
merged 8 commits into from
May 28, 2024
Merged

Update yarn to latest stable version #307

merged 8 commits into from
May 28, 2024

Conversation

mchv
Copy link
Member

@mchv mchv commented May 15, 2024

What does this change?

This update yarn from 1.22.17 to the latest stable version 4.2.2.

There are a few noteworthy changes:

Adding the range for react-dom and react dependencies

The parsing of version dependency since yarn 2.x is more strict, which means the react and react-dom alias package needs an additional range to work (preact issue about it)

Removal of yarn-duplicate

The yarn-duplicate package is not necessary anymore, and has been replaced by the native dedupe command:

Warnings displayed when installing

When executing yarn install a few warnings are now displayed

Screenshot 2024-05-15 at 21 13 22

The associated changes do not address them, but with the associated changes it should be easier to update packages to address them (for instance updating jest and ts-jest seems sensible and not too difficult)

Retrieval of the right version of yarn

In order to retrieve the right version of yarn, it is now recommended to use corepack, rather than
This is very similar to that change in dotcom-rendering:

Upgrade of node version

However for the right yarn version to be picked up, un upgrade to the latest 18.xx node version was needed (see pnpm/pnpm#7724), otherwise yarn version is not found:

And yarn install fail miserably:

Type Error: URL.canParse is not a function
    at parseSpec (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:23627:21)
    at loadSpec (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:23704:11)
    at async findProjectSpec (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:23649:20)
    at async executePackageManagerRequest (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:24223:18)
    at async BinaryCommand.validateAndExecute (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21173:22)
    at async _Cli.run (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22148:18)
    at async Object.runMain (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:24279:[12](https://github.com/guardian/pinboard/actions/runs/9100236939/job/25014586984#step:7:13))
Error: Process completed with exit code 1.

@mchv mchv requested review from twrichards and a team as code owners May 15, 2024 20:51
@twrichards
Copy link
Collaborator

amazing, thank you @mchv - appreciate the detailed sequential PR description - the diff LGTM, I'm checking it out locally now to make sure various scripts involved in running locally all continue to work and will deploy to CODE - expect approval incoming shortly

@twrichards
Copy link
Collaborator

amazing, thank you @mchv - appreciate the detailed sequential PR description - the diff LGTM, I'm checking it out locally now to make sure various scripts involved in running locally all continue to work and will deploy to CODE - expect approval incoming shortly

looking good so far, but will do some more testing tomorrow - @mchv please feel free to enable auto merge and i'll approve tomorrow morning when all checked - thanks

@mchv mchv enabled auto-merge May 20, 2024 12:47
Copy link
Collaborator

@twrichards twrichards left a comment

Choose a reason for hiding this comment

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

thanks again @mchv!

Tested locally (added one small commit) and also deployed to CODE and did a quick test:
image

looks good, approving now (and given auto-merge also merging)...

@mchv mchv merged commit ac6978d into main May 28, 2024
1 check passed
@mchv mchv deleted the mc-update-yarn branch May 28, 2024 08:45
@prout-bot
Copy link
Collaborator

Seen on PROD (merged by @mchv 3 minutes and 15 seconds ago) Please check your changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants