Closed barafael closed 1 year ago
Actually, I think the right thing to do idiomatically is to delete the main
entirely. It probably shouldn't have a main, except for debugging, so maybe that's the best way to cfg it away.
Here's a variant without a main
in WASM at all. One could add it for debugging. I have kept set_panic_hook
in, however I'd also argue it is up for removal. A library user would do it themselves, so certainly a pub
function seems out of place.
Maybe a good compromise would be to simply keep the original fn main
but comment it out. No features and no set_panic_hook
. This would be a breaking change, however.
What do you think?
Yeah, I think we should remove them altogether.
Not sure this is idiomatic. However, I noticed, that when compiling to e.g. a yew app, which has a
main
, it conflicts with the existingmain
fromkord
. The double negation ofnot("wasm_no_main")
is because I didn't want to make this a breaking change, which I guess a feature"wasm_main"
would have been. Let me know if you prefer a feature"wasm_main"
as part of thedefault-features
perhaps, or something else entirely.