-
Notifications
You must be signed in to change notification settings - Fork 17
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
Support status for vite-plugin-wasm and testing env #24
Comments
I managed to build your project and added Vitest and SSR support. Please test~ |
A question: what's the difference between Worker and Worklet. What extra steps will I need to make it work in Worklet? |
With vite-plugin-wasm: v3.2.1 ResultsVitest
Chrome
Firefox
Gnome web
|
AFAIK, In AudioWorkletScope:
Other apis are not available (see) I dont known if this is also true for others worklet: PainWorklet, LayoutWorklet, and AnimationWorklet. |
Does it mean I could only base64 encode the WASM file to load it in Worklet context? Are there any other APIs used by wasm-bindgen that is missing in Worklet context? |
I dont known
wasm-bindgen uses |
Firefox worker is supported now. Please test. |
worker is still not working on FF, for both svelte and sveltekit (tested with with vite-plugin-wasm last commit) this error message appears in the console.
|
How did you build? You need to set worker to iife, not es. |
I retrieved the commit and built from source, maybe there is a better way? package.json
i used the default as specify in the README vite.config.js
I push it on the repo, you can check it out, see if there is any mistake. (link) |
No, you need to use my plugin vite-plugin-top-level-await to transform this.
…On Tue, Feb 28, 2023 at 19:28 Jerboas86 ***@***.***> wrote:
How did you build?
I retrieved the commit and built from source, maybe there is a better way?
package.json
{
[...]
"devDependencies": {
[...]
"vite-plugin-wasm": ***@***.***:Menci/vite-plugin-wasm.git#7ab4a5e"
}
}
You need to set worker to iife, not es.
i used the default as specify in the README
vite.config.js
import { defineConfig } from "vite";
import { svelte } from ***@***.***/vite-plugin-svelte";
import wasm from "vite-plugin-wasm";
import topLevelAwait from "vite-plugin-top-level-await";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [svelte(), wasm(), topLevelAwait()],
test: {
environment: "jsdom",
},
worker: {
plugins: [wasm(), topLevelAwait()],
},
});
I push it on the repo, you can check it out, see if there is any mistake.
(link) <https://github.com/Jerboas86/vpw-test-env>
—
Reply to this email directly, view it on GitHub
<#24 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACWRBA2D3PICUVVBBLZHCILWZXOOHANCNFSM6AAAAAATQTFISY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I was trying to uderstand where vite-plugin-wasm is supported.
The testing environment is here: https://github.com/Jerboas86/vpw-test-env
I tried different frameworks:
In different scopes:
And with different web browers:
Results
Chrome
Firefox
Gnome web
opened issues:
and opened PR:
I would suggest to:
The testing can also be extended if it is valuable, let me known.
The text was updated successfully, but these errors were encountered: