Skip to content

Commit

Permalink
fix wasm dependencies, try 2
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronvoell committed Dec 19, 2024
1 parent 0c3232f commit 1bf6a9b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions xmtp_content_types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ xmtp_common = { workspace = true, features = ['test-utils'] }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tonic = { version = "0.12", features = ["transport"] }
diesel = { workspace = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
diesel = { workspace = true, features = [
"returning_clauses_for_sqlite_3_35",
] }
sqlite-web = { workspace = true }

9 changes: 8 additions & 1 deletion xmtp_content_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@ use diesel::{
expression::AsExpression,
serialize::{self, IsNull, Output, ToSql},
sql_types::Integer,
sqlite::Sqlite,
};
use serde::{Deserialize, Serialize};
use thiserror::Error;
use xmtp_proto::xmtp::mls::message_contents::{ContentTypeId, EncodedContent};

#[cfg(not(target_arch = "wasm32"))]
pub use diesel::sqlite::{Sqlite, SqliteConnection};

#[cfg(target_arch = "wasm32")]
pub use self::wasm::SqliteConnection;
#[cfg(target_arch = "wasm32")]
pub use sqlite_web::WasmSqlite as Sqlite;

/// ContentType and their corresponding string representation
/// are derived from the `ContentTypeId` enum in the xmtp-proto crate
/// that each content type in this crate establishes for itself
Expand Down

0 comments on commit 1bf6a9b

Please sign in to comment.