Support JS environments without code generation #1772
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Report
Probably is related to https://github.com/facebook/yoga/issues/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:
I think this is mostly a dupe of #1767