Skip to content

Commit

Permalink
feat!: update Yoga to 3.0 (#2711)
Browse files Browse the repository at this point in the history
Co-authored-by: Diego Muracciole <[email protected]>
  • Loading branch information
wojtekmaj and diegomura authored Sep 22, 2024
1 parent 70f29a0 commit 4257032
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 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 @@ -29,7 +29,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
4 changes: 2 additions & 2 deletions packages/layout/src/yoga/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/* eslint-disable import/prefer-default-export */

import * as Yoga from 'yoga-layout';
import { loadYoga as yogaLoadYoga } from 'yoga-layout/load';

let instance;

export const loadYoga = async () => {
if (!instance) {
// Yoga WASM binaries must be asynchronously compiled and loaded
// to prevent Event emitter memory leak warnings, Yoga must be loaded only once
instance = await Yoga.loadYoga();
instance = await yogaLoadYoga();
}

const config = instance.Config.create();
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10222,7 +10222,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 4257032

Please sign in to comment.