@@ -52,10 +52,11 @@ through `wasm-pack`, for example.
52
52
53
53
### Running the demo
54
54
55
- Currently it's required to use the ` --target no-modules ` flag with
56
- ` wasm-bindgen ` to run threaded code. This is because the WebAssembly file
55
+ Currently it's required to use the ` --target no-modules ` or ` --target web ` flag
56
+ with ` wasm-bindgen ` to run threaded code. This is because the WebAssembly file
57
57
imports memory instead of exporting it, so we need to hook initialization of the
58
- wasm module at this time to provide the appropriate memory object.
58
+ wasm module at this time to provide the appropriate memory object. This demo
59
+ uses ` --target no-modules ` , because Firefox does not support modules in workers.
59
60
60
61
With ` --target no-modules ` you'll be able to use ` importScripts ` inside of each
61
62
web worker to import the shim JS generated by ` wasm-bindgen ` as well as calling
@@ -79,10 +80,10 @@ improvements to be made so if you have an idea please file an issue!
79
80
synchronization with the main thread.
80
81
81
82
* Setting up a threaded environment is a bit wonky and doesn't feel smooth
82
- today. For example ` --target no-modules ` is required with ` wasm-bindgen ` and
83
- very specific shims are required on both the main thread and worker threads.
84
- These are possible to work with but are somewhat brittle since there's no
85
- standard way to spin up web workers as wasm threads.
83
+ today. For example ` --target bundler ` is unsupported and very specific shims
84
+ are required on both the main thread and worker threads. These are possible to
85
+ work with but are somewhat brittle since there's no standard way to spin up
86
+ web workers as wasm threads.
86
87
87
88
* There is no standard notion of a "thread". For example the standard library
88
89
has no viable route to implement the ` std::thread ` module. As a consequence
0 commit comments