Before, we introduced a type `api.ImportRenamer` to resolve conflicts where the "env" module was shared between AssemblyScript and user-defined functions. This API was never used in GitHub, and is complicated. AssemblyScript also isn't the only ABI to share the "env" module, as other web APIs like Emscripten do also. The less complicated approach is to have packages that need to share "env" use `ModuleBuilder.ExportFunctions` instead, and use namespaces as needed if there is overlap. Signed-off-by: Adrian Cole <adrian@tetrate.io>
wazero examples
The following example projects can help you practice WebAssembly with wazero:
- allocation - how to pass strings in and out of WebAssembly functions defined in Rust or TinyGo.
- assemblyscript - how to configure special imports needed by AssemblyScript when not using WASI.
- basic - how to use both WebAssembly and Go-defined functions.
- import-go - how to define, import and call a Go-defined function from a WebAssembly-defined function.
- multiple-results - how to return more than one result from WebAssembly or Go-defined functions.
- namespace - how WebAssembly modules can import their own host module, such as "env".
- replace-import - how to override a module name hard-coded in a WebAssembly module.
- wasi - how to use I/O in your WebAssembly modules using WASI (WebAssembly System Interface).
Please open an issue if you would like to see another example.