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

[guide/examples] Switch from --target no-modules to --target web now #4103

Open
BGR360 opened this issue Sep 4, 2024 · 1 comment
Open

Comments

@BGR360
Copy link

BGR360 commented Sep 4, 2024

All major browsers have supported ES modules in web workers for at least a year now. Firefox was the last one to catch up, it seems, and it added support in version 114 (2023-06). See MDN.

As a newcomer wanting to play around with Wasm in web workers, I want to know the most modern/standardized way to do things with wasm-bindgen.

Therefore, I request that the following examples and pages in the wasm-bindgen guide be updated to use the newer --target web instead of --target no-modules.

At the time of this writing, only Chrome supports modules in web workers, e.g.
Firefox does not. To have compatibility across browsers, the whole example is
set up without relying on ES modules as target. Therefore we have to build
with `--target no-modules`. The full command can be found in `build.sh`.

wasm module at this time to provide the appropriate memory object. This demo
uses `--target no-modules`, because Firefox does not support modules in workers.

@daxpedda
Copy link
Collaborator

daxpedda commented Sep 7, 2024

This should be quite straightforward to do, I'm happy to review a PR!

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

No branches or pull requests

2 participants