Skip to content
This repository has been archived by the owner on Apr 6, 2024. It is now read-only.

Use gloo_utils instead of the serde feature in wasm_bindgen to convert objects. #10

Merged
merged 2 commits into from
Sep 28, 2022

Conversation

CMoore-Darwinium
Copy link
Contributor

@CMoore-Darwinium CMoore-Darwinium commented Sep 27, 2022

This changes worker to use gloo_utils package, rather than relying on the deprecated serde option in wasm-bindgen.

Description of the cyclic reference issue that I was hitting is here:
tkaitchuck/aHash#95

wasm_bindgen::JsValue::from_serde and wasm_bindgen::JsValue::into_serde are deprecated here (citing the cyclic reference issue that I encountered).
rustwasm/wasm-bindgen#3031

This patch replaces the usage of wasm_bindgen::JsValue::from_serde and wasm_bindgen::JsValue::into_serde with gloo_utils::format::JsValueSerdeExt::from_serde and gloo_utils::format::JsValueSerdeExt::into_serde respectively.

…convert between a serde object and Javascript. It effectively breaks reference cycles triggered by optional features in other packages.
@zebp zebp merged commit b1082de into zebp:master Sep 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants