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

Merged
merged 4 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 () => {
wojtekmaj marked this conversation as resolved.
Show resolved Hide resolved
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==