Skip to content

Changes to cargo to allow to depend only on the base client #3

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target
Cargo.lock
19 changes: 11 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ proptest-derive = { optional = true, version = "0.4.0" }
rand = { version = "0.8" }
serde_json = { features = [ "float_roundtrip", "preserve_order" ], version = "1" }
thiserror = { version = "1" }
tokio = { features = [ "full" ], version = "1" }
tokio = { optional = true, features = [ "sync" ], version = "1" }
tokio-stream = { features = [ "io-util", "sync" ], version = "^0.1.8" }
tokio-tungstenite = { version = "0.20.0" }
tokio-tungstenite = { optional = true, version = "0.20.0" }
tracing = { version = "0.1" }
url = { version = "2" }
uuid = { features = [ "serde", "v4" ], version = "1.6" }
Expand All @@ -43,9 +43,12 @@ proptest-derive = { version = "0.4.0" }
tracing-subscriber = { features = [ "env-filter" ], version = "0.3.17" }

[features]
default = [ "native-tls" ]
native-tls = [ "tokio-tungstenite/native-tls" ]
native-tls-vendored = [ "tokio-tungstenite/native-tls-vendored" ]
rustls-tls-native-roots = [ "tokio-tungstenite/rustls-tls-native-roots" ]
rustls-tls-webpki-roots = [ "tokio-tungstenite/rustls-tls-webpki-roots" ]
testing = [ "convex_sync_types/testing", "proptest", "proptest-derive", "parking_lot" ]
default = [ "full", "native-tls" ]
native-tls = [ "full", "tokio-tungstenite/native-tls" ]
native-tls-vendored = [ "full", "tokio-tungstenite/native-tls-vendored" ]
rustls-tls-native-roots = [ "full", "tokio-tungstenite/rustls-tls-native-roots" ]
rustls-tls-webpki-roots = [ "full", "tokio-tungstenite/rustls-tls-webpki-roots" ]
testing = [ "full", "convex_sync_types/testing", "proptest", "proptest-derive", "parking_lot" ]
full = [ "full-client", "base-client" ]
full-client = [ "tokio-tungstenite", "tokio/full"]
base-client = ["tokio/sync"]
8 changes: 7 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ pub use value::{
Value,
};

#[cfg(any(feature = "full-client"))]
mod client;

#[cfg(any(feature = "full-client"))]
pub use client::{
subscription::{
QuerySetSubscription,
Expand All @@ -58,12 +61,15 @@ pub use client::{
ConvexClient,
};

#[cfg(any(feature = "base-client"))]
pub mod base_client;

#[cfg(any(feature = "base-client"))]
#[doc(inline)]
pub use base_client::{
FunctionResult,
QueryResults,
SubscriberId,
};

mod sync;
mod sync;
1 change: 1 addition & 0 deletions src/sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::value::Value;

#[cfg(test)]
pub mod testing;
#[cfg(any(feature = "full-client"))]
pub mod web_socket_manager;

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