-
Notifications
You must be signed in to change notification settings - Fork 795
Conversation
Nice start - we should also add a CI job for it |
Updateadded wasm-pack example in
This executes
Unified both websocket implementations with only a few extra cfg's |
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.
LGTM, follow ups from our discussion:
- Simplify the example, remove the need for webpack and make it as "vanilla" as possible
- NodeJS does not seem to be working right now. Unclear if it's a bug in how we do the WASM inside Rust, or if it's a config issue.
cfg-if = "1.0.0" | ||
|
||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] | ||
getrandom = { version = "0.2", features = ["js"] } |
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.
This doesn't seem to be used anywhere?
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.
you're right, we don't actually use this directly, however we need to set this for it to compile standalone:
https://docs.rs/getrandom/0.2.3/getrandom/#indirect-dependencies
* abi detection when sending * fix doctests
Motivation
Add wasm support
Solution
--target wasm32-unknown-unknown
. the biggest challenge is probably disabling transports.web_sys::WebSocket
Afterwards we can look at how to shrink it etc.