Added wasi for v1 wasmrs components & helper macros. #384
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds WASI support for v1 wasmrs components.
Sample config:
As part of building the WASI test modules, I included experimental macros and proc_macro attributes for common operation cases. The WASI module showcases them but they're not necessary to rely on or use.
Breaking changes for component devs:
wick-component-codegen
. Everything generated for operations was housed under individualoperation_name::*
modules in the generated code, except the operation trait itself which was named[OperationName]Operation
. This PR moves the operation trait tooperation_name::Operation
. To recompile old components, the operation implementations need to be changed fromimpl OperationNameOperation for Component
toimpl operation_name::Operation for Component
..error()
method on outputs now takes a&str
instead ofimpl AsRef<str>
due to becoming a trait methods vs generated code. Any call to .error that passed in aString
or otherwise will need to be updated to pass a string slice instead (e.g.outputs.output.error(an_error_string)
needs to be changed tooutputs.output.error(&an_error_string)