wasm-bindgen-rayon: Missing file in pkg/snippets folder with wasm-bindgen upgrade

Hello,

When I use wasm-bindgen-rayon v1.2.2 along with wasm-bindgen >= v0.2.94, the pkg/snippets is not fully populated comparing to run with wasm-bindgen v0.2.93.

To reproduce

  • clone zama-ai/tfhe-rs repository
  • run make build_web_js_api_parallel and check content of tfhe/pkg/snippets/wasm-bindgen-rayon-<hash>/src
  • change version constraint for wasm-bindgen to 0.2.95
  • remove tfhe/pkg folder
  • run again make build_web_js_api_parallel and check content of tfhe/pkg/snippets/wasm-bindgen-rayon-<hash>/src -> you’ll see that workerHelpers.worker.js file is missing

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (7 by maintainers)

Most upvoted comments

Ok I published this workaround with wasm-bindgen bump as 1.3.0, hopefully this fixes the issue for now.

I have added a workaround to the tip of Git, which is switching back to old, suboptimal, approach for Workers, but at least should work, according to the CI. @soonum @zdimension @s-herbert @codeart1st Can you test with your project to see if it does work with latest wasm-pack for you?

Maybe this could help as shared by codeartist

rustwasm/wasm-pack#1443

?

This will only help, if wasm-pack released a new version. Then propably you can invoke wasm-pack build --split-linked-module command to get wasm-bindgen-rayon@1.2.2 working.

I will try to test the latest main commit from wasm-bindgen-rayon with the old approach in my project.

I’m going to wait for feedback for now - couple of days aren’t going to change anything. I’d rather issue a fix without pinning if it does work.

Slightly worse code splitting, so can impact initialization time a bit, but that’s relatively imperceptible.

The worse issue is that it used to break hard in some bundlers (eg Parcel), failing at compile time, but now that the new approach is broken everywhere, figured might be worth a try. Seems to pass on the CI nowadays, but personal feedback would be welcome before I make a release.