You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reducing code duplication in cross-platform code-bases by getting as close as possible to what fn main() supports.
I would argue that #2994 and #2970 are also cross-platform issues, because error libraries are usually not targeted towards wasm-bindgen but all sorts of targets.
See #3076 and #3252 for more fn main() compatibility.
Proposed Solution
Make #[wasm_bindgen(start)] as compatible as possible with Termination, which is what is expected in fn main() by Rust.
Currently the return error type has to be a JsValue or (), but very commonly error types like anyhow::Error are used.
We should still continue supporting JsValue at the same time.
Alternatives
I don't know of any alternative for wasm-bindgen to apply here. This can always be solved on the user side with more #[cfg(...)]s.
The text was updated successfully, but these errors were encountered:
Motivation
Reducing code duplication in cross-platform code-bases by getting as close as possible to what
fn main()
supports.I would argue that #2994 and #2970 are also cross-platform issues, because error libraries are usually not targeted towards
wasm-bindgen
but all sorts of targets.See #3076 and #3252 for more
fn main()
compatibility.Proposed Solution
Make
#[wasm_bindgen(start)]
as compatible as possible withTermination
, which is what is expected infn main()
by Rust.Currently the return error type has to be a
JsValue
or()
, but very commonly error types likeanyhow::Error
are used.We should still continue supporting
JsValue
at the same time.Alternatives
I don't know of any alternative for
wasm-bindgen
to apply here. This can always be solved on the user side with more#[cfg(...)]
s.The text was updated successfully, but these errors were encountered: