Skip to content

Commit 20e3dfa

Browse files
quextenHinton
andauthored
[no ticket] Fix wasm being imported on UNIFFI builds (#385)
## 🎟️ Tracking https://bitwarden.slack.com/archives/C054ZQSBS49/p1755188403409309 ## 📔 Objective It seems #279 accidentally required wasm in all uniffi builds via `bitwarden-vault` -> `bitwarden-collections` -> `bitwarden-core`. Since it is only required on core, this leads to build issues on anything where an impl is tagged with wasm-bindgen, but uses a struct from a third package - such as `bitwarden-crypto` that does not have the wasm feature enabled. Attempts to fix the build errors of: #383 Note: This flags out a function from the collections client. This has to be fixed by the owning team and updated, this PR just unblocks builds and fixes the imports. ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --------- Co-authored-by: Oscar Hinton <[email protected]>
1 parent bceb681 commit 20e3dfa

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

crates/bitwarden-exporters/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ keywords.workspace = true
1818
[features]
1919
uniffi = ["dep:uniffi", "bitwarden-core/uniffi"] # Uniffi bindings
2020
wasm = [
21+
"bitwarden-collections/wasm",
2122
"bitwarden-vault/wasm",
2223
"dep:tsify",
2324
"dep:wasm-bindgen"
2425
] # WebAssembly bindings
2526

2627
[dependencies]
2728
base64 = ">=0.22.1, <0.23"
28-
bitwarden-collections = { workspace = true, features = ["wasm"] }
29+
bitwarden-collections = { workspace = true }
2930
bitwarden-core = { workspace = true }
3031
bitwarden-crypto = { workspace = true }
3132
bitwarden-error = { workspace = true }

crates/bitwarden-vault/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ uniffi = [
2121
"dep:uniffi"
2222
] # Uniffi bindings
2323
wasm = [
24+
"bitwarden-collections/wasm",
2425
"bitwarden-core/wasm",
2526
"dep:tsify",
2627
"dep:wasm-bindgen",
@@ -30,7 +31,7 @@ wasm = [
3031
[dependencies]
3132
base64 = ">=0.22.1, <0.23"
3233
bitwarden-api-api = { workspace = true }
33-
bitwarden-collections = { workspace = true, features = ["wasm"] }
34+
bitwarden-collections = { workspace = true }
3435
bitwarden-core = { workspace = true, features = ["internal"] }
3536
bitwarden-crypto = { workspace = true }
3637
bitwarden-error = { workspace = true }

crates/bitwarden-vault/src/collection_client.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use bitwarden_collections::{
33
tree::{NodeItem, Tree},
44
};
55
use bitwarden_core::Client;
6+
#[cfg(feature = "wasm")]
67
use bitwarden_error::js_sys::Map;
78
#[cfg(feature = "wasm")]
89
use wasm_bindgen::prelude::wasm_bindgen;
@@ -69,6 +70,7 @@ impl CollectionViewNodeItem {
6970
self.node_item.children.clone()
7071
}
7172

73+
#[cfg(feature = "wasm")]
7274
pub fn get_ancestors(&self) -> Map {
7375
self.node_item
7476
.ancestors

0 commit comments

Comments
 (0)