rustwasm / wasm-bindgen

Facilitating high-level interactions between Wasm modules and JavaScript
https://rustwasm.github.io/docs/wasm-bindgen/
Apache License 2.0
7.82k stars 1.08k forks source link

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

Open BGR360 opened 2 months ago

BGR360 commented 2 months ago

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.

https://github.com/rustwasm/wasm-bindgen/blob/e4f8c4540aee2f3c0798fdae51ac7dace28e102b/guide/src/examples/wasm-in-web-worker.md?plain=1#L13-L16

https://github.com/rustwasm/wasm-bindgen/blob/e4f8c4540aee2f3c0798fdae51ac7dace28e102b/guide/src/examples/raytrace.md#L60-L61

daxpedda commented 2 months ago

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