Skip to content

Commit d6afb06

Browse files
committed
modifications to make it work with wasm
1 parent 39ee70a commit d6afb06

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target
2+
Cargo.lock

Cargo.toml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ proptest-derive = { optional = true, version = "0.4.0" }
2424
rand = { version = "0.8" }
2525
serde_json = { features = [ "float_roundtrip", "preserve_order" ], version = "1" }
2626
thiserror = { version = "1" }
27-
tokio = { features = [ "full" ], version = "1" }
27+
tokio = { optional = true, features = [ "sync" ], version = "1" }
2828
tokio-stream = { features = [ "io-util", "sync" ], version = "^0.1.8" }
29-
tokio-tungstenite = { version = "0.20.0" }
29+
tokio-tungstenite = { optional = true, version = "0.20.0" }
3030
tracing = { version = "0.1" }
3131
url = { version = "2" }
3232
uuid = { features = [ "serde", "v4" ], version = "1.6" }
@@ -43,9 +43,12 @@ proptest-derive = { version = "0.4.0" }
4343
tracing-subscriber = { features = [ "env-filter" ], version = "0.3.17" }
4444

4545
[features]
46-
default = [ "native-tls" ]
47-
native-tls = [ "tokio-tungstenite/native-tls" ]
48-
native-tls-vendored = [ "tokio-tungstenite/native-tls-vendored" ]
49-
rustls-tls-native-roots = [ "tokio-tungstenite/rustls-tls-native-roots" ]
50-
rustls-tls-webpki-roots = [ "tokio-tungstenite/rustls-tls-webpki-roots" ]
51-
testing = [ "convex_sync_types/testing", "proptest", "proptest-derive", "parking_lot" ]
46+
default = [ "full", "native-tls" ]
47+
native-tls = [ "full", "tokio-tungstenite/native-tls" ]
48+
native-tls-vendored = [ "full", "tokio-tungstenite/native-tls-vendored" ]
49+
rustls-tls-native-roots = [ "full", "tokio-tungstenite/rustls-tls-native-roots" ]
50+
rustls-tls-webpki-roots = [ "full", "tokio-tungstenite/rustls-tls-webpki-roots" ]
51+
testing = [ "full", "convex_sync_types/testing", "proptest", "proptest-derive", "parking_lot" ]
52+
full = [ "full-client", "base-client" ]
53+
full-client = [ "tokio-tungstenite", "tokio/full"]
54+
base-client = ["tokio/sync"]

src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ pub use value::{
4949
Value,
5050
};
5151

52+
#[cfg(any(feature = "full-client"))]
5253
mod client;
54+
55+
#[cfg(any(feature = "full-client"))]
5356
pub use client::{
5457
subscription::{
5558
QuerySetSubscription,
@@ -58,7 +61,10 @@ pub use client::{
5861
ConvexClient,
5962
};
6063

64+
#[cfg(any(feature = "base-client"))]
6165
pub mod base_client;
66+
67+
#[cfg(any(feature = "base-client"))]
6268
#[doc(inline)]
6369
pub use base_client::{
6470
FunctionResult,

src/sync/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use crate::value::Value;
1010

1111
#[cfg(test)]
1212
pub mod testing;
13+
#[cfg(any(feature = "full-client"))]
1314
pub mod web_socket_manager;
1415

1516
/// Upon a protocol failure, an explanation of the failure to pass in on

0 commit comments

Comments
 (0)