bytecodealliance / ComponentizeJS

JS -> WebAssembly Component
Apache License 2.0
242 stars 32 forks source link

support destructors for imported resources #69

Closed dicej closed 1 year ago

dicej commented 1 year ago

This provides partial support for #68. I've focused on imported resources to begin with since APIs such as wasi:http make heavy use of child handles, which must be disposed in the correct order to avoid traps.

Supporting destructors for exported resources may also be useful, but not as urgent with respect to WASI.

dicej commented 1 year ago

Here's an example: https://github.com/fermyon/spin-fileserver/blob/main/examples/javascript/app.mjs