Skip to content

Commit

Permalink
feat!: update Yoga to 3.0
Browse files Browse the repository at this point in the history
Closes #2692
Closes #2507

This PR updates Yoga to 3.0.

See the list of new features, improvements, and potential breaking changes in #2692.
  • Loading branch information
wojtekmaj committed Apr 10, 2024
1 parent 5e9a113 commit 862e2cc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/honest-boxes-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-pdf/layout": major
---

Update Yoga to 3.0
2 changes: 1 addition & 1 deletion packages/layout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"cross-fetch": "^3.1.5",
"emoji-regex": "^10.3.0",
"queue": "^6.0.1",
"yoga-layout": "^2.0.1"
"yoga-layout": "^3.0.0"
},
"files": [
"lib"
Expand Down
7 changes: 3 additions & 4 deletions packages/layout/src/yoga/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
/* eslint-disable import/prefer-default-export */

import * as Yoga from 'yoga-layout';
import Yoga from 'yoga-layout';

export const loadYoga = async () => {
const instance = await Yoga.loadYoga();
const config = instance.Config.create();
const config = Yoga.Config.create();

config.setPointScaleFactor(0);

const node = { create: () => instance.Node.createWithConfig(config) };
const node = { create: () => Yoga.Node.createWithConfig(config) };

return { node };
};
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10027,7 +10027,7 @@ yocto-queue@^1.0.0:
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251"
integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==

yoga-layout@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/yoga-layout/-/yoga-layout-2.0.1.tgz#4bc686abe2464f977866650ddccc1dbcf9f0d03c"
integrity sha512-tT/oChyDXelLo2A+UVnlW9GU7CsvFMaEnd9kVFsaiCQonFAXd3xrHhkLYu+suwwosrAEQ746xBU+HvYtm1Zs2Q==
yoga-layout@^3.0.0:
version "3.0.3"
resolved "https://registry.yarnpkg.com/yoga-layout/-/yoga-layout-3.0.3.tgz#0231bfbffe0b3aeb09fed53e02599d5c954d1946"
integrity sha512-7Y9/DP9BaEDKwrL2+rQPq5HFYSOdwED0hPceuXd1NIdnxQf6hnrYGMZBnUqG1CLXXL6njh/dEjsli574OmAcVw==

0 comments on commit 862e2cc

Please sign in to comment.