diff --git a/ffi/wasm/Cargo.lock b/ffi/wasm/Cargo.lock index 64f47b51..b407a718 100644 --- a/ffi/wasm/Cargo.lock +++ b/ffi/wasm/Cargo.lock @@ -17,7 +17,7 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cipher 0.3.0", "cpufeatures", "opaque-debug", @@ -94,12 +94,6 @@ dependencies = [ "cipher 0.4.3", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -131,7 +125,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen", ] @@ -216,7 +210,7 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "libc", "wasi", @@ -291,7 +285,7 @@ version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -303,12 +297,6 @@ dependencies = [ "digest", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "num-bigint-dig" version = "0.8.1" @@ -390,7 +378,7 @@ dependencies = [ [[package]] name = "picky" -version = "0.4.0" +version = "0.4.1" dependencies = [ "console_error_panic_hook", "getrandom", @@ -398,7 +386,6 @@ dependencies = [ "serde_json", "wasm-bindgen", "wasm-bindgen-test", - "wee_alloc", ] [[package]] @@ -485,7 +472,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "opaque-debug", "universal-hash", @@ -623,7 +610,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest", ] @@ -634,7 +621,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest", ] @@ -748,7 +735,7 @@ version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -773,7 +760,7 @@ version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -842,40 +829,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "zeroize" version = "1.5.7" diff --git a/ffi/wasm/Cargo.toml b/ffi/wasm/Cargo.toml index 11c4aea9..950c6e87 100644 --- a/ffi/wasm/Cargo.toml +++ b/ffi/wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "picky" -version = "0.4.0" +version = "0.4.1" authors = ["BenoƮt CORTIER "] edition = "2021" publish = false @@ -35,13 +35,6 @@ serde_json = "1.0.82" # code size when deploying. console_error_panic_hook = { version = "0.1.7", optional = true } -# `wee_alloc` is a tiny allocator for wasm that is only ~1K in code size -# compared to the default allocator's ~10K. It is slower than the default -# allocator, however. -# -# Unfortunately, `wee_alloc` requires nightly Rust when targeting wasm for now. -wee_alloc = { version = "0.4.5", optional = true } - getrandom = { version = "0.2.7", features = ["js"] } [dev-dependencies] diff --git a/ffi/wasm/README.md b/ffi/wasm/README.md index abddc835..20e1520c 100644 --- a/ffi/wasm/README.md +++ b/ffi/wasm/README.md @@ -11,7 +11,7 @@ This should be run in the CI. 2. Build the package: ``` - $ wasm-pack build --target web --scope devolutions --out-name picky --features wee_alloc + $ wasm-pack build --target web --scope devolutions --out-name picky ``` 3. Rename `@devolutions/picky-wasm` to `@devolutions/picky` in `pkg/package.json`. @@ -34,7 +34,7 @@ Other tests are run using `nodejs` and the `ava` testing framework. For these, you need to build the npm package targeting `nodejs`: ``` -$ wasm-pack build --target nodejs --scope @devolutions --out-name picky --features wee_alloc +$ wasm-pack build --target nodejs --scope @devolutions --out-name picky ``` Rename `@devolutions/picky-wasm` to `@devolutions/picky` in `pkg/package.json`. diff --git a/ffi/wasm/publish.ps1 b/ffi/wasm/publish.ps1 index feaf9cc8..e35d64e3 100755 --- a/ffi/wasm/publish.ps1 +++ b/ffi/wasm/publish.ps1 @@ -2,7 +2,7 @@ $ErrorActionPreference = "Stop" -wasm-pack build --target bundler --scope devolutions --out-name picky --features wee_alloc +wasm-pack build --target bundler --scope devolutions --out-name picky if ($LastExitCode -ne 0) { diff --git a/ffi/wasm/src/lib.rs b/ffi/wasm/src/lib.rs index e1ba244d..ea138fe8 100644 --- a/ffi/wasm/src/lib.rs +++ b/ffi/wasm/src/lib.rs @@ -7,12 +7,6 @@ pub mod pem; use wasm_bindgen::prelude::*; -// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global -// allocator. -#[cfg(festure = "wee_alloc")] -#[global_allocator] -static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; - #[wasm_bindgen(start)] pub fn init_picky() -> Result<(), JsValue> { // When the `console_error_panic_hook` feature is enabled, we can call the