-
Notifications
You must be signed in to change notification settings - Fork 23
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
compile xmtp_id
and xmtp_mls
to wasm32
#1026
Conversation
@@ -1,3 +1,11 @@ | |||
pub mod time; | |||
use wasm_timer::{SystemTime, UNIX_EPOCH}; |
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.
wasm_timer uses normal std
SystemTime
libraries if on native, and the JS web_sys/js_sys shim if on web
|
||
use crate::InboxOwner; | ||
|
||
impl InboxOwner for LocalWallet { |
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.
I preferred the implementation in xmtp_id
, enabling us to remove the ethers
dependency in xmtp_mls
let mut stream = client.stream_conversations().await?; | ||
let handle = crate::spawn(async move { | ||
let stream = client.stream_conversations().await?; | ||
futures::pin_mut!(stream); |
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 should be a minor performance improvement, streams are entirely stack-based, even in the with_callback
methods.
feature flag/
Send
boundsslightly changes streams. All streams except for
_with_callback
are stack-based/no moreBox<Stream>
. This makes it easier to modify theSend
bound for wasm32.general dependency pruning where possible.
smart-default
crate since it was used in only one place.flume
withtokio::sync::mpsc
blocked on some missing trait implementations forWasmSqlite
backend which require a patcheddiesel
.remove
InboxOwner
inxmtp_mls
and use the one inxmtp_id
xmtp_mls
dependency onethers
.xmtp_id
depends onethers
anywayremove
ethers_core
and use theethers::core
re-export90% of this PR is adding
cfg
/cfg_attr
to tests/items + hoisting individual types likeBox<dyn Signature>
into type alias to make it possible to varySend/Sync
bounds based on wasm/not wasmcloses #951 closes #939 closes #940
this PR makes tests compile in WebAssembly, but not necessarily pass. Rel: #941