Releases: bytecodealliance/go-modules
Releases · bytecodealliance/go-modules
v0.7.0
Changed
- Removed remaining Go 1.22 support.
Fixed
- #306: do not emit incompatible version feature gates when serializing WIT. For example, if a world with version
0.1.0
includes a world from another package with a@since(version = 0.2.0)
feature gate, then strip that feature gate when serializing to WIT if the version is greater than the world’s package version. - #350: correctly align
record
size to the highest alignment of its fields, per specification. - #352: do not use
tuple
types as data shape forvariant
orresult
types, as they may contain abool
or not be packed. - #356: sort WIT packages topologically by dependency before matching WIT world when generating Go bindings. Warn if there is an ambiguous match.
- Updated package
cm
to v0.3.0 with multiple fixes, including a breaking change tocm.BoolResult
.
v0.6.2
v0.6.1
v0.6.0
Added
- Initial support for Component Model async types
stream
,future
, anderror-context
. - Initial support for JSON serialization of WIT
list
,enum
, andrecord
types. wasm-tools
is now vendored as a WebAssembly module, executed using Wazero. This allows packagewit
andwit-bindgen-go
to run on any supported platform without needing to separately installwasm-tools
.
Changed
- Breaking: generated
*.wasm.go
files will now have correct WIT kebab-case base name. Interfaces or worlds with-
in their name will require removal of the previous*.wasm.go
files. - Breaking: upgraded to
wasm-tools
v1.227.1, which removes support for multiple return values and flags with > 32 values. To ease migration, this package will continue to support JSON generated bywasm-tools
v1.225.0 and earlier. - Dropped support for TinyGo v0.32.0 and v0.33.0.
- Added support for Go 1.24 and dropped support for Go 1.22.
Fixed
- #281: errors from internal
wasm-tools
calls are no longer silently ignored. This required fixing a number of related issues, including synthetic world packages for Component Model metadata generation, WIT generation, and WIT keyword escaping in WIT package or interface names. - #284: do not use
bool
forvariant
orresult
GC shapes. TinyGo returnsresult
andvariant
values withbool
as 0 or 1, which breaks the memory representation of tagged unions (variants). - #288: correctly report the
wasm32
ABI alignment oflist<T>
as 4, rather than 8. - #306: run
wasm-tools
with the--all-features
argument so feature-gated WIT is correctly found when synthesizing Component Model metadata for a Go package.
v0.5.0
Changed
- Breaking: package
cm
is now a separate module. This change was made in order to minimize the runtime dependencies of programs that depend on packagecm
but not the rest of the packages in this module. To update your code that depends on packagecm
, rungo get -u go.bytecodealliance.org/...
.
Fixed
- #264: fix lowering for imported functions that return named
bool
types.
v0.4.1
Added
wit-bindgen-go wit
now accepts an--interface
argument in the form ofmonotonic-clock
,wasi:clocks/monotonic-clock
, orwasi:clocks/monotonic-clock@0.2.0
. This filters the serialized WIT to a specific interface and the other interface(s) it references. This can be used to generate focused WIT with a minimal set of dependencies, and can be combined with the--world
argument to filter serialized WIT to the intersection of a specific world and interface.
Fixed
- #240: correctly handle cyclical data structures when generating variant lowering code.
Changed
- Breaking: package
wit
no longer interprets-
to read from stdin when loading JSON or WIT usingwit.LoadJSON
orwit.LoadWIT
. Usewit.DecodeJSON
orwit.DecodeWIT
to read JSON or WIT from anio.Reader
. - Breaking:
wit.ParseWIT
has been removed. Usewit.DecodeWIT(bytes.NewReader(b))
instead.
v0.4.0
This module has been renamed. Going forward, please use go.bytecodealliance.org
instead of github.com/bytecodealliance/wasm-tools-go
.
v0.3.1
Added
wit-bindgen-go
now accepts arguments that control the level of logging output on stderr. Verbose mode (-v
or--verbose
) will print informational log lines, warnings, and errors. Debug mode (-vv
or--debug
) will emit finer-grained debugging information. By default,wit-bindgen-go
will print warnings or errors.- New method
(cm.Result).Result() (ok OK, err Err, isErr bool)
added to streamline common patterns usingresult
types. It has a value receiver, allowing it to be chained off a function call that returns aResult
, eliminating the need to declare a temporary variable. For example:stream, err, isErr := stream.BlockingRead(n)
Fixed
- #215: generate variant accessor methods with the correct scope for Go names.
New Contributors
- @vados-cosmonic: #212 and #214 — verbose logging controls in
wit-bindgen-go
.
v0.3.0
Added
- Go type aliases are now generated for each WIT type alias (
type foo = bar
). Deep chains of type aliases (type b = a; type c = b;
) are fully supported. Generated documentation now reflects whether a type is an alias. Fixes #204. go:wasmimport
andgo:wasmexport
functions are now generated in a separate.wasm.go
file. This helps enable testing or use of generated packages outside of WebAssembly.wit-bindgen-go generate
now generates a WIT file for each WIT world in its corresponding Go package directory. For example thewasi:http/proxy
world would generatewasi/http/proxy/proxy.wit
.wit-bindgen-go wit
now accepts a--world
argument in the form ofimports
,wasi:clocks/imports
, orwasi:clocks/imports@0.2.0
. This filters the serialized WIT to a specific world and interfaces it references. This can be used to generate focused WIT for a specific world with a minimal set of dependencies.
Changed
- Method
wit.(*Package).WIT()
now interprets the non-empty stringname
argument as signal to render in single-file, multi-package braced form. wit.(*Resolve).WIT()
andwit.(*Package).WIT()
now accept a*wit.World
as context to filter serialized WIT to a specific world.- Packages are now sorted topologically by dependency in generated WIT files. For example,
wasi:cli
would be followed by its dependencies likewasi:io
,wasi:filesystem
, orwasi:random
.
v0.2.4
Added
- Generated variant shape types (
...Shape
) now includestructs.HostLayout
.