diegomura / react-pdf

📄 Create PDF files using React
https://react-pdf.org
MIT License
14.22k stars 1.11k forks source link

feat!: update Yoga to 3.0 #2711

Open wojtekmaj opened 1 month ago

wojtekmaj commented 1 month ago

Closes #2692 Closes #2507

This PR updates Yoga to 3.0.

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

changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: 862e2cca28afc59e0799c1ab3343efe76d907f57

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

diegomura commented 3 weeks ago

@wojtekmaj this looks good. What's missing?

wojtekmaj commented 3 weeks ago

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

diegomura commented 3 weeks ago

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 commented 3 weeks ago

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: