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

[feature request] deno 2.1 supports native .wasm imports #44

Open
andykais opened this issue Dec 10, 2024 · 1 comment
Open

[feature request] deno 2.1 supports native .wasm imports #44

andykais opened this issue Dec 10, 2024 · 1 comment

Comments

@andykais
Copy link

Currently the compiled wasm code is loaded dynamically with an encoded string in lib.js. I believe you can replace that file and the init step in canvaskit.ts with a plain import if you are comfortable releasing a new version that is only compatible with deno 2.1+. I am mainly going off the information I see in this deno blogpost https://deno.com/blog/v2.1. It is possible that there is something more complicated about this module that will prevent this. At the very least though, it should remove an async init stage to canvas usage, which should help simplify usage.

@DjDeveloperr
Copy link
Owner

That would be interesting, I believe it would be more complicated than that due to how canvaskit loads the wasm. If there was a way to import as a WebAssembly Module, not an instance, that would make it easier to integrate but this requires quite a bit of rewiring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants