@@ -34,6 +34,8 @@ server-local = ["storage-sqlite"]
3434storage = [" storage-sqlite" ]
3535# Support for SQLite task storage
3636storage-sqlite = [" dep:rusqlite" , " dep:tokio-rusqlite" ]
37+ # Support for the in-memory storage backend (WASM-compatible)
38+ storage-inmemory = []
3739# (private) Support for sync protocol encryption
3840encryption = [" dep:ring" ]
3941# (private) Generic support for cloud sync
@@ -42,6 +44,8 @@ cloud = []
4244bundled = [" rusqlite/bundled" , " tokio-rusqlite/bundled" ]
4345# use native CA roots, instead of bundled
4446tls-native-roots = [" ureq/native-certs" ]
47+ # Feature for wasm builds. This enables wasm-compatible storage.
48+ wasm = [" storage-inmemory" ]
4549
4650[package .metadata .docs .rs ]
4751all-features = true
@@ -62,16 +66,26 @@ serde_json = "^1.0"
6266serde = { version = " ^1.0.147" , features = [" derive" ] }
6367strum = " 0.27"
6468strum_macros = " 0.27"
65- tokio = { version = " 1" , features = [" rt-multi-thread" , " macros" ] }
6669thiserror = " 2.0"
6770ureq = { version = " ^2.12.1" , features = [" tls" ], optional = true }
6871uuid = { version = " ^1.16.0" , features = [" serde" , " v4" ] }
6972url = { version = " 2" , optional = true }
7073async-trait = " 0.1.89"
7174tokio-rusqlite = { version = " 0.6.0" , optional = true }
75+ # Use only WASM-compatible features by default
76+ tokio = { version = " 1" , features = [" macros" ] }
77+
78+ # For non-WASM targets, enable the multi-threaded runtime
79+ [target .'cfg(not(target_arch = "wasm32"))' .dependencies ]
80+ tokio = { version = " 1" , features = [" rt-multi-thread" ] }
81+
82+ # For WASM targets, enable the single-threaded runtime and WASM-friendly uuid features
83+ [target .'cfg(target_arch = "wasm32")' .dependencies ]
84+ tokio = { version = " 1" , features = [" rt" ] }
85+ uuid = { version = " ^1.16.0" , features = [" js" ] }
7286
7387[dev-dependencies ]
7488proptest = " ^1.7.0"
7589tempfile = " 3"
7690rstest = " 0.26"
77- pretty_assertions = " 1"
91+ pretty_assertions = " 1"
0 commit comments