__wbindgen_thread_destroy has optional params#3703
__wbindgen_thread_destroy has optional params#3703daxpedda merged 3 commits intowasm-bindgen:mainfrom
__wbindgen_thread_destroy has optional params#3703Conversation
daxpedda
left a comment
There was a problem hiding this comment.
This is unfortunately hacky :/
As far as I can tell we don't have more information available because we manually insert these functions into the module instead of exposing them with the wasm_bindgen macro. We could still actually add wasm-bindgen style descriptors manually to address this ... but it's questionable if that's worth it.
In any case, this is an improvement nevertheless, I don't see why not to take it.
Could you add a line to the changelog?
Agreed, but not sure how else to make it cleaner 😅 Also added a changelog for #3690 |
|
Thank you! |
|
Hi, I'm searching for solution for #3818 May I ask, is this renamed to |
|
This function is made to destroy spawned threads, not the main instance. |
This PR updates the generated TypeScript to reflect the fact that
__wbindgen_thread_destroyhas optional params.Ref: https://github.com/rustwasm/wasm-bindgen/blob/9fb3bca16876c756266274f78fcd0214e0581eaa/crates/threads-xform/src/lib.rs#L394-L395
Before:
After:
Ideally I'd like better names too (
aandb) but for the life of me I can't tell if it's in the wasm or not. Maybe just hardcode it since I'm already doing__wbindgen_thread_destroy? 🤷♂️ Oh well this is a strict improvement.