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

chore: update Yarn to v4; migrate from Lerna to Yarn Workspaces #2567

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wojtekmaj
Copy link
Contributor

@wojtekmaj wojtekmaj commented Jan 26, 2024

This is an experimental PR to see the potential effect of upgrading Yarn to v4.

Why not Yarn v1:

  • It's no longer maintained.
  • It has many known bugs.
  • It's far slower than virtually every modern competitor (including npm).

Why Yarn v4:

  • Fast.
  • Very easy, pretty much automatic upgrade.
  • Bulit-in workspaces, allowing us to drop Lerna and has all its features built-in.
  • Automatic dependency management ("workspace:" protocol) - changes to ^x.x.x where x.x.x is the latest dependency version at the moment of publishing
  • Built-in portable shell, allowing us to use e.g. environment variables in scripts, and it'll work on Windows too.

What would make this PR ready for review

  • Publishing process - I don't see why it wouldn't work, but I also cannot test it
  • Analyzing dependency tree; would running builds in parallel be okay? If so, we can shave off additional 6 seconds from each build.

Copy link

changeset-bot bot commented Jan 26, 2024

⚠️ No Changeset found

Latest commit: 5b575dc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@wojtekmaj wojtekmaj force-pushed the yarn-4 branch 4 times, most recently from b081576 to b31bd9c Compare January 26, 2024 11:50
wojtekmaj added a commit to wojtekmaj/diegomura-react-pdf that referenced this pull request Jan 26, 2024
wojtekmaj added a commit to wojtekmaj/diegomura-react-pdf that referenced this pull request Jan 26, 2024
@wojtekmaj
Copy link
Contributor Author

@diegomura I'd love to know what you think about this!

wojtekmaj added a commit to wojtekmaj/diegomura-react-pdf that referenced this pull request Jan 29, 2024
wojtekmaj added a commit to wojtekmaj/diegomura-react-pdf that referenced this pull request Jan 29, 2024
diegomura pushed a commit that referenced this pull request Jan 29, 2024
@diegomura
Copy link
Owner

I like this!

@wojtekmaj wojtekmaj marked this pull request as ready for review February 6, 2024 08:17
@wojtekmaj wojtekmaj changed the title Update Yarn to v4; migrate from Lerna to Yarn Workspaces chore: update Yarn to v4; migrate from Lerna to Yarn Workspaces Feb 6, 2024
@wojtekmaj
Copy link
Contributor Author

wojtekmaj commented Feb 6, 2024

I'm glad! Rebased. Working for me.
I don't understand 100% of your workflow though, so I would really appreciate if you could play around with it and see if everything behaves 100% like you expect.

@diegomura
Copy link
Owner

@wojtekmaj this needs rebase 😄 Sorry, lots of changes going on recently

@wojtekmaj
Copy link
Contributor Author

wojtekmaj commented Feb 10, 2024

lots of changes going on recently

I wonder who can be at fault 🤣 Done.

Just to be sure though, @diegomura did you find some time it works alright and doesn't disrupt your workflow?

I'm more than happy to address any feedback you might have, and this IS a big change!

@wojtekmaj
Copy link
Contributor Author

Regarding publishing process - my biggest worry was about how version descriptors are managed during publish. Now Yarn handles automatically what Changesets used to do - so we use workspace:^ version descriptors that gets swapped to latest patch version on publish. This seems to be handled well since changesets/changesets#585 so we should be okay!

mskec pushed a commit to mskec/react-pdf that referenced this pull request Feb 26, 2024
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.

None yet

2 participants