diff options
author | 2025-04-12 09:43:27 +0100 | |
---|---|---|
committer | 2025-04-12 09:43:27 +0100 | |
commit | 986350b3fb786c1530a3fef199b6d51c536b1188 (patch) | |
tree | 206b824fa0ee3df6cab74e3e3f288c09a1968422 | |
parent | b0294e0bb01c92f0eb8822f701ef9c585ac87f74 (diff) | |
download | luz-986350b3fb786c1530a3fef199b6d51c536b1188.tar.gz luz-986350b3fb786c1530a3fef199b6d51c536b1188.tar.bz2 luz-986350b3fb786c1530a3fef199b6d51c536b1188.zip |
feat(luz): dependencies compile on wasm
-rw-r--r-- | luz/Cargo.toml | 14 | ||||
-rw-r--r-- | luz/src/jabber_stream.rs | 2 |
2 files changed, 11 insertions, 5 deletions
diff --git a/luz/Cargo.toml b/luz/Cargo.toml index 0a7f86e..d7207ca 100644 --- a/luz/Cargo.toml +++ b/luz/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" async-recursion = "1.0.4" async-trait = "0.1.68" lazy_static = "1.4.0" -nanoid = "0.4.0" +uuid = { version = "1.13.1", features = ["v4"] } # TODO: remove unneeded features and dependencies rsasl = { version = "2.0.1", default_features = false, features = [ "provider_base64", @@ -18,10 +18,8 @@ rsasl = { version = "2.0.1", default_features = false, features = [ "config_builder", "scram-sha-1", ] } -tokio = { version = "1.28", features = ["full"] } -tokio-native-tls = "0.3.1" +tokio = { version = "1.28", features = [] } tracing = "0.1.40" -trust-dns-resolver = "0.22.0" try_map = "0.3.1" stanza = { version = "0.1.0", path = "../stanza" } peanuts = { version = "0.1.0", git = "https://bunny.garden/peanuts" } @@ -32,6 +30,14 @@ pin-project-lite = "0.2.15" pin-project = "1.1.7" thiserror = "2.0.11" +[target.'cfg(target_arch = "wasm32")'.dependencies] +uuid = { version = "1.13.1", features = ["js", "v4"] } +getrandom = { version = "0.2.15", features = ["js"] } + +[target.'cfg(not(target_arch = "wasm32"))'.dependencies] +tokio-native-tls = "0.3.1" +trust-dns-resolver = "0.22.0" + [dev-dependencies] test-log = { version = "0.2", features = ["trace"] } env_logger = "*" diff --git a/luz/src/jabber_stream.rs b/luz/src/jabber_stream.rs index 302350d..ef21921 100644 --- a/luz/src/jabber_stream.rs +++ b/luz/src/jabber_stream.rs @@ -220,7 +220,7 @@ where #[instrument] pub async fn bind(mut self, jid: &mut JID) -> Result<Self> { - let iq_id = nanoid::nanoid!(); + let iq_id = uuid::Uuid::new_v4().to_string(); if let Some(resource) = &jid.resourcepart { let iq = Iq { from: None, |