-
Notifications
You must be signed in to change notification settings - Fork 166
Description
Specification
Description
A follow-up to WasmGC, this feature adds a way to associate data with a type, by using a WebAssembly struct as a "descriptor" for other structs. This reflects the concept that many languages call "static properties" (per-class rather than per-instance). Compared to previous user-space implementations, the standardized feature saves memory, because the custom per-type data can be integrated with engine-internal per-type metadata.
The second part of the proposal, building on the first, is a way to attach JavaScript prototypes to exported Wasm objects, for much more ergonomic WasmGC/JS interop.
To be in line with other Wasm features, I expect that the feature/file name in this repository will be wasm-custom-descriptors.yml. The group is "webassembly".
Documentation
Browser support
Chrome is about to run an Origin Trial for this.
Firefox has expressed support and is working on an implementation as well.
Finalization of the proposal and shipping by default in browsers is tentatively expected to happen some time in 2026, possibly quite early in the year.