bytecodealliance / jco

JavaScript toolchain for working with WebAssembly Components
https://bytecodealliance.github.io/jco/
Apache License 2.0
642 stars 65 forks source link

preview2-shims: remove all class state #445

Closed guybedford closed 5 months ago

guybedford commented 5 months ago

All the classes in preview2-shims use an #id that is internally constructed. This therefore only applies to user-created objects and not bindgen-created objects.

In order to properly support bindgen resource creation we need to replace all use of #id with Symbol.cabiRep per the resource bindgen convention in https://github.com/bytecodealliance/jco/blob/main/docs/src/optimized-host-bindings.md#resourceinstancesymbolforcabirep.

Pollable, excluding the cabiLower part is a good example of how to do this.

This work also lays the foundations for low-level bindgen for all WASI interfaces as well.