-
Notifications
You must be signed in to change notification settings - Fork 304
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
pinning old version of wasm_bindgen makes dependency management difficult #433
Comments
Have you tried using patches? I add this on my Cargo.toml to override all my workers-rs dependencies: I believe you might be able to do that by pointing to the wasm-bindgen, but probably the most advisable solution for you is to create your own fork of workers-rs, update it and use it, like I did, and I guess too many others... Because in practice workers-rs appears to be unsupported for some time now. |
I've forked the repo for the same reason main...DylanRJohnston:workers-rs:main. Now I just need to figure out if it's worth writing the bindings for WebSocket Hibernation or just abandon using Rust in favour of Typescript :( |
A while back they announced on twitter that support for other languages was coming: https://twitter.com/eastdakota/status/1720454051660194195 I'm guessing they plan to release some kind of workers-wasm. I'm not sure when I'm going to get to the WebSocket Hibernation API... I already added some R2 missing checksum stuff, so in my case I believe TypeScript was always a mistake. Adding support for testing with workerd is also planned because I need it, but I'll have to way for miniflare 3 to work on that, for now I just use plain unit tests with wasm-bingen-test, I don't use vitest for integration, although I use it a lot in TypeScript workers. But a community led fork makes a lot of sense in my opinion. |
That's awesome! I had already seen it. I might try to merge to my fork them when I get there. Thanks! My experience has been that too, it always seems harder than it actually is in practice. |
I just ran into this same issue.. @DylanRJohnston Btw, now there's wasm-bidngen 0.2.90. Why is it even pinned to a specific patch version? Doesn't it adhere to semver?
Any idea why? What's the alternative for Rust in workers? :) |
@Boscop I believe that I'm using |
@Boscop There alternative for now is for you to fork it and use the forked version which is very easy to use in rust. I believe its because they diverted all the resources to their higher priority projects. If I had to guess, I would say they might be working on a workers-wasm, that given that a lot of stuff is done supported directly by workerd, might bypass JS entirely making it faster, besides supporting other languages like ghey announced. |
I had a look the most-downloaded public crates that have a dependency on I'm not sure what "every part of the toolchain" refers to, but anything built by Cargo will already unify on the same version. |
I created a draft PR based on @spigaz' fork: #472 @eric-seppanen I am not sure if pinning the exact version is required, but if it is possible changing the dependency requirement to sth like |
My complaint (pinning to |
I ran into the same issue with a |
Is there an existing issue for this?
What version of
workers-rs
are you using?0.0.18
What version of
wrangler
are you using?n/a
Describe the bug
The
worker
crate pins the exact version of wasm_bindgen:This makes it painful to add additional dependencies, because it forces the user to manually hunt around for older versions of crates that permit that exact version of
wasm-bindgen
.As as example, here's what it's like to create a new project and then start adding other dependencies:
The error isn't terribly clear, but the only solution is to find a version of
js-sys
that will accept the same version ofwasm-bindgen
thatworker
requires. Let's try the previous version:Nope, maybe the one before that?
And then the one before that...
I've noticed this problem with
js-sys
,wasm-bindgen-futures
, andweb-sys
.This isn't a great user experience and not one I am used to seeing with public crates. This version pinning goes against the usual expectation that we trust semver-compatibility between minor/patch releases; if there's no reason to pin the version, could this be relaxed to allow newer versions?
If pinning is necessary, could
worker
please stay up to date onwasm-bindgen
releases? There have been multiple releases in the months since0.2.86
was released.Steps To Reproduce
cargo add worker
cargo add js-sys
The text was updated successfully, but these errors were encountered: