wit-bindgen
wit-bindgen copied to clipboard
Consider splitting configuration of foreign types into a new `generate!` macro config key
In https://github.com/bytecodealliance/wit-bindgen/pull/972 the default for whether bindings would be generated for foreign (i.e., not in the same package as the target world) types was flipped from being generated by default to not. Users could still opt-into generating code for foreign types by using the generate keyword.
The use of a special keyword, however, might not be the most discoverable. Instead we may wish to introduce a new key in the generate! macro.
In short the following...
with: {
"wasi:io/poll": wasi::io::poll,
"some:package/my-interface": generate,
},
...would become the following...
with: {
"wasi:io/poll": wasi::io::poll,
},
generate: [
"some:package/my-interface"
]
Seems reasonable to me!