Suppose I have a WIT definition, and some old WebAssembly components built/defined using the old definition, and then I want to make a change to my interface without requiring the component to be modified or rebuilt. Or perhaps I want to do the same in the reverse direction—make a change to my WASM component that remains backward-compatible with a host using an older WIT.
What changes to the WIT could be considered "compatible", if any, and which are not?
In essence, I'm looking for guidance similar to what Protobuf offers in their Updating a Message Type documentation.
A few example questions/scenarios I can think of: are the following compatible in one or both directions (old host/new guest vs. new guest/old host)?
- Removing an argument to a function
- Adding a new optional argument to a function
- Adding a new optional field to a struct
- Removing a field from a struct
- Adding a new case to a variant
- Removing a case from a variant
Suppose I have a WIT definition, and some old WebAssembly components built/defined using the old definition, and then I want to make a change to my interface without requiring the component to be modified or rebuilt. Or perhaps I want to do the same in the reverse direction—make a change to my WASM component that remains backward-compatible with a host using an older WIT.
What changes to the WIT could be considered "compatible", if any, and which are not?
In essence, I'm looking for guidance similar to what Protobuf offers in their Updating a Message Type documentation.
A few example questions/scenarios I can think of: are the following compatible in one or both directions (old host/new guest vs. new guest/old host)?