summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.cargo/config.toml19
-rw-r--r--Cargo.lock5
-rw-r--r--Cargo.toml2
-rw-r--r--Trunk.toml1
-rw-r--r--src/lib.rs8
5 files changed, 28 insertions, 7 deletions
diff --git a/.cargo/config.toml b/.cargo/config.toml
index c91c3f3..9fa8b2c 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -1,2 +1,21 @@
+[build]
+rustflags = [
+ # LLD (shipped with the Rust toolchain) is used as the default linker
+ # "-C", "link-arg=-Tlink.x",
+
+ # if you run into problems with LLD switch to the GNU linker by commenting out
+ # this line
+ # "-C", "linker=arm-none-eabi-ld",
+
+ # if you need to link to pre-compiled C libraries provided by a C toolchain
+ # use GCC as the linker by commenting out both lines above and then
+ # uncommenting the three lines below
+ "-C",
+ "target-feature=+atomics,+bulk-memory,+mutable-globals",
+]
+
+[unstable]
+build-std = ["std", "panic_abort"]
+
[net]
git-fetch-with-cli = true
diff --git a/Cargo.lock b/Cargo.lock
index 2c12742..2c6cdc7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -318,7 +318,6 @@ dependencies = [
"iana-time-zone",
"js-sys",
"num-traits",
- "serde",
"wasm-bindgen",
"windows-link",
]
@@ -822,7 +821,6 @@ dependencies = [
"lampada",
"reactive_stores",
"rusqlite",
- "serde",
"sha1",
"sha2",
"sha3",
@@ -1532,7 +1530,6 @@ name = "jid"
version = "0.1.0"
dependencies = [
"rusqlite",
- "serde",
]
[[package]]
@@ -1578,7 +1575,6 @@ dependencies = [
"jid",
"luz",
"peanuts",
- "serde",
"stanza",
"thiserror 2.0.12",
"tokio",
@@ -3768,7 +3764,6 @@ checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9"
dependencies = [
"getrandom 0.3.2",
"js-sys",
- "serde",
"wasm-bindgen",
]
diff --git a/Cargo.toml b/Cargo.toml
index 53db452..89c001f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,7 +8,7 @@ base64 = "0.22.1"
chrono = "0.4.41"
chrono-humanize = "0.2.3"
console_error_panic_hook = "0.1.7"
-filamento = { path = "../luz/filamento", features = ["serde", "reactive_stores", "opfs"] }
+filamento = { path = "../luz/filamento", features = ["reactive_stores", "opfs"] }
futures = "0.3.31"
indexmap = "2.9.0"
jid = { path = "../luz/jid" }
diff --git a/Trunk.toml b/Trunk.toml
index 6e16d80..9df66ca 100644
--- a/Trunk.toml
+++ b/Trunk.toml
@@ -13,6 +13,7 @@ public_url = "/"
filehash = true
# Whether to inject scripts (and module preloads) into the finalized output.
inject_scripts = true
+cargo_flags = ["-Z build-std=std,panic_abort"]
# Run without network access
# offline = false
# Require Cargo.lock and cache are up to date
diff --git a/src/lib.rs b/src/lib.rs
index 2aa32ee..f907933 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -190,7 +190,13 @@ fn LoginPage(set_app: WriteSignal<AppState>, set_client: RwSignal<Option<(Client
};
// initialise the client
- let db = Db::create_connect_and_migrate("mem.db").await.unwrap();
+ let db = if remember_me.get_untracked() {
+ debug!("creating db in opfs");
+ Db::create_connect_and_migrate(jid.as_bare().to_string()).await.unwrap()
+ } else {
+ debug!("creating db in memory");
+ Db::create_connect_and_migrate_memory().await.unwrap()
+ };
let files = if remember_me.get_untracked() {
let opfs = FilesOPFS::new(jid.as_bare().to_string()).await;
match opfs {