You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When spawning a web worker with gloo-worker, a warning message is printed to the console: using deprecated parameters for the initialization function; pass a single object instead
This comes from the use of wasm_bindgen("URL") (which refers to / runs __wbg_init("URL")), a parameter format which was deprecated in wasm-bindgen v0.2.93 in favor of wasm_bindgen({module_or_path: "URL"}).
Conveniently, the clock example almost causes the issue, aside from using a pre-0.2.93 version of wasm-bindgen. Modify the clock example's Cargo.toml to depend on wasm-bindgen v0.2.93, and from the clock example's directory, run wasm-pack build --target no-modules --out-name clock, and serve the example's index.html in some way (e.g. python3 -m http.server). Opening the site in a browser and opening the developer console shows the deprecation warning.
Expected Behavior
No warnings should be printed to the console for correct code using gloo-worker.
Actual Behavior
Creating a web worker with gloo-worker causes a deprecation warning to be printed to the console.
Additional Context
I used gloo-worker v0.5.0, and the warning occurred on Safari, Chrome, and Firefox (presumably also on any supported browser). Note that many crates don't seem to have updated to the newer wasm_bindgen() format, so this deprecation warning might still occur in other contexts even if this issue is fixed.
The text was updated successfully, but these errors were encountered:
Describe the Bug
When spawning a web worker with gloo-worker, a warning message is printed to the console:
using deprecated parameters for the initialization function; pass a single object instead
This comes from the use of
wasm_bindgen("URL")
(which refers to / runs__wbg_init("URL")
), a parameter format which was deprecated in wasm-bindgen v0.2.93 in favor ofwasm_bindgen({module_or_path: "URL"})
.The places I found that can cause this bug are
gloo/crates/worker/src/actor/spawner.rs
Line 32 in d600d3a
and, in an example,
gloo/examples/clock/index.html
Lines 11 to 13 in d600d3a
Steps to Reproduce
Conveniently, the clock example almost causes the issue, aside from using a pre-0.2.93 version of wasm-bindgen. Modify the clock example's Cargo.toml to depend on wasm-bindgen v0.2.93, and from the clock example's directory, run
wasm-pack build --target no-modules --out-name clock
, and serve the example's index.html in some way (e.g.python3 -m http.server
). Opening the site in a browser and opening the developer console shows the deprecation warning.Expected Behavior
No warnings should be printed to the console for correct code using gloo-worker.
Actual Behavior
Creating a web worker with gloo-worker causes a deprecation warning to be printed to the console.
Additional Context
I used gloo-worker v0.5.0, and the warning occurred on Safari, Chrome, and Firefox (presumably also on any supported browser). Note that many crates don't seem to have updated to the newer wasm_bindgen() format, so this deprecation warning might still occur in other contexts even if this issue is fixed.
The text was updated successfully, but these errors were encountered: