-
Notifications
You must be signed in to change notification settings - Fork 962
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
"Just works" WASM (browser) experience #2245
Conversation
@wngr very very very much appreciated! I am sorry for the delay here. I will give this a review. I just need a bit more time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of comments for now. Let me know if you need help pinging folks for sebcrozet/instant#9.
Again, thanks for this contribution!
@@ -80,6 +87,11 @@ jobs: | |||
# TODO: ideally we would build `--workspace`, but not all crates compile for WASM | |||
run: cargo build --target=wasm32-wasi | |||
|
|||
- name: Build on wasm32-wasi | |||
# TODO: also run `cargo test` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please, that would be great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a bigger undertaking, which might be more geared towards wasm32-wasi
rather than wasm32-unknown-unknown
.
I guess for wasm32-unknown-unknown
a wasm-bindgen based browser smoke test might be something, but I'll leave that to future-us :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Some comments inline, nothing big :)
I think the test failure is unrelated to this PR. |
Should be good to go for another 👀 @mxinden @thomaseizinger |
Yes. Fixed once #2295 is merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Made a few suggestions but nothing blocking.
Great PR! Getting rid of |
I think |
Thanks for the pull request @wngr! As you might have seen, we already cut a |
Would appreciate if you could cut create a |
These are the changes I needed to make in order to get libp2p to run via
wasm32-unknown-unknown
in the browser (both main thread and inside web workers).wasm-timer
is ingossipsub
, as it uses anInterval
. Haven't gotten around to refactor that (yet).The other thing is that I'm waiting for a release of the instant create (see wasm::Instant: Add {checked,saturating}_duration_since sebcrozet/instant#36).SystemTime
incore/src/peer_record.rs
, probably w/ AddSystemTime
sebcrozet/instant#9 AddSystemtime
(second attempt) sebcrozet/instant#42Looking for comments, whether this is something that can get merged, or whether there are alternative approaches.
related #2134 #2166 #2143