aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Cargo.toml9
-rw-r--r--filamento/Cargo.toml46
-rw-r--r--filamento/src/db.rs4
-rw-r--r--lampada/Cargo.toml15
-rw-r--r--luz/Cargo.toml19
-rw-r--r--luz/src/jabber_stream/bound_stream.rs2
6 files changed, 67 insertions, 28 deletions
diff --git a/Cargo.toml b/Cargo.toml
index b3cefa7..c869d3d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,11 +1,10 @@
[workspace]
resolver = "2"
-members = [
- "luz",
- "lampada",
- "stanza", "jid", "filamento",
-]
+members = ["luz", "lampada", "stanza", "jid", "filamento"]
[workspace.dependencies]
tokio = { version = "1.42.0" }
+
+[patch.crates-io]
+tokio_with_wasm = { path = "../tokio-with-wasm/tokio_with_wasm" }
diff --git a/filamento/Cargo.toml b/filamento/Cargo.toml
index 08f482b..97c2931 100644
--- a/filamento/Cargo.toml
+++ b/filamento/Cargo.toml
@@ -4,20 +4,38 @@ version = "0.1.0"
edition = "2024"
[features]
-serde = ["dep:serde", "jid/serde", "uuid/serde", "chrono/serde", "lampada/serde"]
+serde = [
+ "dep:serde",
+ "jid/serde",
+ "uuid/serde",
+ "chrono/serde",
+ "lampada/serde",
+]
opfs = ["dep:web-sys"]
reactive_stores = ["dep:reactive_stores"]
[dependencies]
futures = "0.3.30"
lampada = { version = "0.1.0", path = "../lampada" }
-tokio = { workspace = true }
thiserror = "2.0.11"
-stanza = { version = "0.1.0", path = "../stanza", features = ["rfc_6121", "xep_0203", "xep_0030", "xep_0060", "xep_0172", "xep_0390", "xep_0128", "xep_0115", "xep_0084"] }
+stanza = { version = "0.1.0", path = "../stanza", features = [
+ "rfc_6121",
+ "xep_0203",
+ "xep_0030",
+ "xep_0060",
+ "xep_0172",
+ "xep_0390",
+ "xep_0128",
+ "xep_0115",
+ "xep_0084",
+] }
# TODO: re-export jid?
jid = { version = "0.1.0", path = "../jid", features = ["rusqlite"] }
uuid = { version = "1.13.1", features = ["v4"] }
-rusqlite = { git = "https://github.com/Spxg/rusqlite.git", branch = "wasm-demo", features = ["uuid", "chrono"] }
+rusqlite = { git = "https://github.com/Spxg/rusqlite.git", branch = "wasm-demo", features = [
+ "uuid",
+ "chrono",
+] }
tracing = "0.1.41"
chrono = "0.4.40"
sha2 = "0.10.8"
@@ -33,12 +51,26 @@ reactive_stores = { version = "0.1.8", optional = true }
tokio = { workspace = true, features = ["sync", "time", "rt", "fs", "io-std"] }
[target.'cfg(target_arch = "wasm32")'.dependencies]
-web-sys = { version = "0.3", features = ["FileSystemDirectoryHandle", "FileSystemWritableFileStream", "FileSystemGetDirectoryOptions", "FileSystemFileHandle", "StorageManager", "File", "Url", "Window", "Navigator"], optional = true }
+tokio = { workspace = true, features = ["sync", "time", "rt"] }
+web-sys = { version = "0.3", features = [
+ "FileSystemDirectoryHandle",
+ "FileSystemWritableFileStream",
+ "FileSystemGetDirectoryOptions",
+ "FileSystemFileHandle",
+ "StorageManager",
+ "File",
+ "Url",
+ "Window",
+ "Navigator",
+], optional = true }
jid = { version = "0.1.0", path = "../jid", features = ["rusqlite"] }
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
-rusqlite = { git = "https://github.com/Spxg/rusqlite.git", branch = "wasm-demo", features = ["uuid", "chrono", "precompiled-wasm"] }
-tokio = { workspace = true, features = ["sync", "time", "rt"] }
+rusqlite = { git = "https://github.com/Spxg/rusqlite.git", branch = "wasm-demo", features = [
+ "uuid",
+ "chrono",
+ "precompiled-wasm",
+] }
tokio_with_wasm = { version = "0.8.2", features = ["sync", "time", "rt"] }
[dev-dependencies]
diff --git a/filamento/src/db.rs b/filamento/src/db.rs
index d4edb4c..9d4b4e9 100644
--- a/filamento/src/db.rs
+++ b/filamento/src/db.rs
@@ -921,14 +921,10 @@ impl DbActor {
result.send(self.read_message(message));
}
DbCommand::ReadMessageHistory { chat, result } => {
- tracing::warn!("ReadMessageHistory: {chat}");
result.send(self.read_message_history(chat));
- tracing::warn!("ReadMessageHistory: read and sent")
}
DbCommand::ReadMessageHistoryWithUsers { chat, result } => {
- tracing::warn!("ReadMessageHistoryWithUsers: {chat}");
result.send(self.read_message_history_with_users(chat));
- tracing::warn!("ReadMessageHistoryWithUsers: read and sent")
}
DbCommand::ReadCachedStatus { result } => {
result.send(self.read_cached_status());
diff --git a/lampada/Cargo.toml b/lampada/Cargo.toml
index 37ce2f3..421360c 100644
--- a/lampada/Cargo.toml
+++ b/lampada/Cargo.toml
@@ -12,14 +12,17 @@ luz = { version = "0.1.0", path = "../luz" }
peanuts = { version = "0.1.0", git = "https://bunny.garden/peanuts" }
jid = { version = "0.1.0", path = "../jid" }
stanza = { version = "0.1.0", path = "../stanza", features = ["xep_0203"] }
-tokio = { workspace = true, features = ["macros", "sync"] }
tracing = "0.1.41"
thiserror = "2.0.11"
serde = { version = "1.0.219", features = ["derive"], optional = true }
-[target.'cfg(target_arch = "wasm32")'.dependencies]
-tokio = { workspace = true, features = ["macros", "rt", "time", "sync"] }
-tokio_with_wasm = { version = "0.8.2", features = ["macros", "rt", "time", "sync"] }
+[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
+tokio = { workspace = true, features = ["macros", "sync"] }
-# [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
-# tokio = { version = "1.42.0", features = ["rt-multi-thread"] }
+[target.'cfg(target_arch = "wasm32")'.dependencies]
+tokio_with_wasm = { version = "0.8.2", features = [
+ "macros",
+ "rt",
+ "time",
+ "sync",
+] }
diff --git a/luz/Cargo.toml b/luz/Cargo.toml
index 4ab1a6e..878132b 100644
--- a/luz/Cargo.toml
+++ b/luz/Cargo.toml
@@ -21,7 +21,6 @@ rsasl = { version = "2.0.1", default-features = false, features = [
"config_builder",
"scram-sha-1",
] }
-tokio = { workspace = true, features = ["io-util"] }
tracing = "0.1.40"
try_map = "0.3.1"
stanza = { version = "0.1.0", path = "../stanza", features = ["xep_0156"] }
@@ -35,11 +34,23 @@ pin-project = "1.1.7"
thiserror = "2.0.11"
[target.'cfg(target_arch = "wasm32")'.dependencies]
-tokio = { workspace = true, features = ["io-util", "sync", "macros"] }
+tokio = { workspace = true, features = ["macros", "rt", "time"] }
+tokio_with_wasm = { version = "0.8.2", features = ["macros", "sync"] }
uuid = { version = "1.13.1", features = ["js", "v4"] }
getrandom = { version = "0.2.15", features = ["js"] }
-stanza = { version = "0.1.0", path = "../stanza", features = ["rfc_7395", "xep_0156"] }
-web-sys = { version = "0.3", features = ["Request", "WebSocket", "RequestInit", "Request", "Window", "Response", "ErrorEvent"] }
+stanza = { version = "0.1.0", path = "../stanza", features = [
+ "rfc_7395",
+ "xep_0156",
+] }
+web-sys = { version = "0.3", features = [
+ "Request",
+ "WebSocket",
+ "RequestInit",
+ "Request",
+ "Window",
+ "Response",
+ "ErrorEvent",
+] }
js-sys = "0.3"
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4.50"
diff --git a/luz/src/jabber_stream/bound_stream.rs b/luz/src/jabber_stream/bound_stream.rs
index 13f8b2d..74ced14 100644
--- a/luz/src/jabber_stream/bound_stream.rs
+++ b/luz/src/jabber_stream/bound_stream.rs
@@ -1,7 +1,5 @@
use std::ops::{Deref, DerefMut};
-use tokio::io::{AsyncRead, AsyncWrite};
-
use super::{JabberReader, JabberStream, JabberWriter};
pub struct BoundJabberStream(JabberStream);