Bump wasm_bindgen + fixes for JsError #98
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
During #81
utils.rs
was refactored into many places and some wouldn'tbe using
error::JsError
which in wasm builds is a typedef forjs_sys::JsValue
and is its own struct for rust builds (to avoid panicsin JsValue when used from non-wasm builds).
Howeve, some places couldn't see these types and would pull it in
directly from
wasm_bindgen::prelude
from the wildcare import inlib.rs
. This caused an issue when bumpingwasm_bindgen
as thefrom_str()
method is no longer injs_sys::JsError
but still is inJsValue
. Between now and #81 this would have also led to panics ifmany places when an error was returned when using CML from rust instead
of wasm.
In the future we should deprecate the direct usage of
js_sys::JsValue
and remove our
JsError
type on rust in favor for real rust errors (notjust string wrappers).
See rustwasm/wasm-bindgen#2710
which will greatly improve error handling from the rust side but this
should be done after the rust/wasm split.