You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The yoga-layout JavaScript library isn't compatible with environments that disallow code generation (eval), like Cloudflare's workerd (example related issue). Because of that, a library that patched how the wasm was loaded took off: yoga-wasm-web (used on satory). This split isn't great for libraries that use yoga and would like to target all modern JS environments, especially since yoga-wasm-web is stuck in yoga 2-beta.
Proposed solution
Support multiple ways to load wasm, like with a new entry point similar to yoga-wasm-web. But, since some libraries were built without the consideration that this option could be added, it might be better to provide a mechanism to globally configure how wasm is loaded before the initialization of libraries that use yoga:
import{setWASMLoader}from'yoga-layout/load';setWASMLoader((...)=>WebAssembly.instantiate(...))import{ ... }from"@react-pdf/renderer"// or any other lib
The text was updated successfully, but these errors were encountered:
Report
Probably is related to #1507
Problem
The
yoga-layout
JavaScript library isn't compatible with environments that disallow code generation (eval), like Cloudflare's workerd (example related issue). Because of that, a library that patched how the wasm was loaded took off: yoga-wasm-web (used on satory). This split isn't great for libraries that use yoga and would like to target all modern JS environments, especially since yoga-wasm-web is stuck in yoga 2-beta.Proposed solution
Support multiple ways to load wasm, like with a new entry point similar to yoga-wasm-web. But, since some libraries were built without the consideration that this option could be added, it might be better to provide a mechanism to globally configure how wasm is loaded before the initialization of libraries that use yoga:
The text was updated successfully, but these errors were encountered: