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

feat!: update Yoga to 3.0 #2711

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

Conversation

wojtekmaj
Copy link
Contributor

Closes #2692
Closes #2507

This PR updates Yoga to 3.0.

See the list of new features, improvements, and potential breaking changes in #2692.

Copy link

changeset-bot bot commented Apr 10, 2024

🦋 Changeset detected

Latest commit: 862e2cc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@react-pdf/layout Major
@react-pdf/renderer Patch
@react-pdf/examples Patch
@react-pdf/e2e-node-cjs Patch
@react-pdf/e2e-node-esm Patch

Not sure what this means? Click here to learn what changesets are.

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

Closes diegomura#2692
Closes diegomura#2507

This PR updates Yoga to 3.0.

See the list of new features, improvements, and potential breaking changes in diegomura#2692.
@diegomura
Copy link
Owner

@wojtekmaj this looks good. What's missing?

@wojtekmaj
Copy link
Contributor Author

@diegomura See the original ticket: we will be unable to provide CJS builds as Yoga 3 is a pure ESM module.

@diegomura
Copy link
Owner

Sorry! Missed that. Huh, good decision to make. Would be nice to push forward that and just embrace ESM but I'm afraid that would break a lot of setups. Will think about this. Any input would be welcomed!

@wojtekmaj
Copy link
Contributor Author

wojtekmaj commented Apr 23, 2024

I think the question is more WHEN and not IF.

It's really up to you: how much further are you able (and willing to!) push the v2 forward? If you think that significant improvements can still be made, you may want to hold off with v3 for a while, to avoid maintaining two releases at the same time. If you think v2 is "pretty much ready" and you're basically only maintaining it, then it would be best to bite the bullet and remove CJS builds.

The move will also improve the experience for ESM users (see #2507), userbase of which is ever growing, at the expense of CJS users, userbase of which is ever shrinking.

Please note that removing CJS builds does not stop CJS users from:

  • Using v2 🤷 They clearly like outdated solutions anyway
  • Importing ESM modules into CJS asynchronously (although that's a bit of a burden)
  • Using Node with --experimental-require-module flag which may just work
  • Using a bundler like Rollup before running code in Node to benefit from their built-in ESM/CJS interop to avoid all module resolution issues

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.

Update Yoga to 3.0 [solution] __dirname is not defined in ES module scope
2 participants