Update packages, use serde_wasm_bindgen

This commit is contained in:
Tyler Hallada 2022-09-30 12:49:32 -04:00
parent 62834ba668
commit c1862733c8
2 changed files with 5 additions and 4 deletions

View File

@ -13,16 +13,17 @@ default = ["console_error_panic_hook"]
[dependencies]
seahash = "4.1"
skyrim-cell-dump = "0.3"
wasm-bindgen = { version = "0.2.63", features = ["serde-serialize"] }
wasm-bindgen = "0.2.83"
serde-wasm-bindgen = "0.4.3"
# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
# all the `std::fmt` and `std::panicking` infrastructure, so isn't great for
# code size when deploying.
console_error_panic_hook = { version = "0.1.6", optional = true }
console_error_panic_hook = { version = "0.1.7", optional = true }
[dev-dependencies]
wasm-bindgen-test = "0.3.13"
wasm-bindgen-test = "0.3.33"
[profile.release]
# Tell `rustc` to optimize for small code size.

View File

@ -6,7 +6,7 @@ use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn parse_plugin(input: &[u8]) -> JsValue {
JsValue::from_serde(&skyrim_cell_dump::parse_plugin(input).unwrap()).unwrap()
serde_wasm_bindgen::to_value(&skyrim_cell_dump::parse_plugin(input).unwrap()).unwrap()
}
#[wasm_bindgen]