Skip to content

Commit c60a5d7

Browse files
authored
[PM-27727] Update WASM-bindgen (#540)
## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-27727 ## 📔 Objective Update WASM-bindgen and removed `VectorIntoJsValue` implementations, as those types aren't needed anymore and were removed from wasm-bindgen. The TS typings now include `[Symbol.dispose](): void;` for the Client classes, so I've updated the TS check script to include the `esnext.disposable` feature, which we're already using in the clients repo anyway. Prerequisite for #330 ## ⏰ 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
1 parent fa008db commit c60a5d7

File tree

9 files changed

+28
-77
lines changed

9 files changed

+28
-77
lines changed

.github/workflows/build-wasm-internal.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
key: wasm-cargo-cache
9191

9292
- name: Install wasm-bindgen-cli
93-
run: cargo install wasm-bindgen-cli --version 0.2.100 --locked
93+
run: cargo install wasm-bindgen-cli --version 0.2.105 --locked
9494

9595
- name: Build
9696
run: ./build.sh -r ${{ matrix.license_type.build_flags }}

.github/workflows/rust-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
7575

7676
- name: Install wasm-bindgen-cli
77-
run: cargo install wasm-bindgen-cli --version 0.2.100 --locked
77+
run: cargo install wasm-bindgen-cli --version 0.2.105 --locked
7878

7979
- name: Test WASM
8080
run: cargo test --target wasm32-unknown-unknown -p bitwarden-wasm-internal -p bitwarden-threading -p bitwarden-error -p bitwarden-uuid --all-features

Cargo.lock

Lines changed: 21 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ tsify = { version = ">=0.5.5, <0.6", features = [
8282
uniffi = "=0.29.4"
8383
uuid = { version = ">=1.3.3, <2.0", features = ["serde", "v4", "js"] }
8484
validator = { version = ">=0.18.1, <0.21", features = ["derive"] }
85-
wasm-bindgen = { version = ">=0.2.91, <0.3", features = ["serde-serialize"] }
86-
wasm-bindgen-futures = "0.4.41"
87-
wasm-bindgen-test = "0.3.45"
85+
wasm-bindgen = { version = ">=0.2.105, <0.3", features = ["serde-serialize"] }
86+
wasm-bindgen-futures = "0.4.55"
87+
wasm-bindgen-test = "0.3.55"
8888
wiremock = ">=0.6.0, <0.7"
8989
zxcvbn = ">=3.0.1, <4.0"
9090

crates/bitwarden-vault/src/cipher/cipher.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -886,24 +886,6 @@ impl Decryptable<KeyIds, SymmetricKeyId, CipherListView> for Cipher {
886886
}
887887
}
888888

889-
#[cfg(feature = "wasm")]
890-
impl wasm_bindgen::__rt::VectorIntoJsValue for Cipher {
891-
fn vector_into_jsvalue(
892-
vector: wasm_bindgen::__rt::std::boxed::Box<[Self]>,
893-
) -> wasm_bindgen::JsValue {
894-
wasm_bindgen::__rt::js_value_vector_into_jsvalue(vector)
895-
}
896-
}
897-
898-
#[cfg(feature = "wasm")]
899-
impl wasm_bindgen::__rt::VectorIntoJsValue for CipherView {
900-
fn vector_into_jsvalue(
901-
vector: wasm_bindgen::__rt::std::boxed::Box<[Self]>,
902-
) -> wasm_bindgen::JsValue {
903-
wasm_bindgen::__rt::js_value_vector_into_jsvalue(vector)
904-
}
905-
}
906-
907889
impl IdentifyKey<SymmetricKeyId> for Cipher {
908890
fn key_identifier(&self) -> SymmetricKeyId {
909891
match self.organization_id {

crates/bitwarden-vault/src/cipher_risk/types.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,3 @@ pub struct CipherRiskResult {
9696
/// None if not found or if no password_map was provided.
9797
pub reuse_count: Option<u32>,
9898
}
99-
100-
#[cfg(feature = "wasm")]
101-
impl wasm_bindgen::__rt::VectorIntoJsValue for CipherRiskResult {
102-
fn vector_into_jsvalue(
103-
vector: wasm_bindgen::__rt::std::boxed::Box<[Self]>,
104-
) -> wasm_bindgen::JsValue {
105-
wasm_bindgen::__rt::js_value_vector_into_jsvalue(vector)
106-
}
107-
}

crates/bitwarden-vault/src/folder/folder_models.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,6 @@ pub struct FolderView {
4141
pub revision_date: DateTime<Utc>,
4242
}
4343

44-
#[cfg(feature = "wasm")]
45-
impl wasm_bindgen::__rt::VectorIntoJsValue for FolderView {
46-
fn vector_into_jsvalue(
47-
vector: wasm_bindgen::__rt::std::boxed::Box<[Self]>,
48-
) -> wasm_bindgen::JsValue {
49-
wasm_bindgen::__rt::js_value_vector_into_jsvalue(vector)
50-
}
51-
}
52-
5344
impl IdentifyKey<SymmetricKeyId> for Folder {
5445
fn key_identifier(&self) -> SymmetricKeyId {
5546
SymmetricKeyId::User

crates/bitwarden-wasm-internal/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ log = "0.4.20"
3838
serde = { workspace = true }
3939
tsify = { workspace = true }
4040
# When upgrading wasm-bindgen, make sure to update the version in the workflows!
41-
wasm-bindgen = { version = "=0.2.100", features = ["serde-serialize"] }
41+
wasm-bindgen = { version = "=0.2.105", features = ["serde-serialize"] }
4242
wasm-bindgen-futures = "0.4.41"
4343

4444
[lints]

crates/bitwarden-wasm-internal/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ npx terser ./crates/bitwarden-wasm-internal/${NPM_FOLDER}/bitwarden_wasm_interna
6363

6464
# Typecheck the generated TypeScript definitions
6565
cd crates/bitwarden-wasm-internal/${NPM_FOLDER}
66-
npx tsc --noEmit --lib es2020,dom bitwarden_wasm_internal.d.ts
66+
npx tsc --noEmit --lib es2020,dom,ESNext.Disposable bitwarden_wasm_internal.d.ts

0 commit comments

Comments
 (0)