A Go package providing seamless WebAssembly interop between Go structs and JavaScript values.
Vert is a Go package that provides enhanced WebAssembly interoperability between Go and JavaScript values. It solves the limitation in Go's standard `syscall/js` package which cannot handle struct types, enabling seamless conversion of Go structs to JavaScript objects and vice versa.
Go developers building WebAssembly applications that need to exchange complex data structures between Go and JavaScript, particularly those working with WebAssembly in the browser.
Vert offers a simple, idiomatic API that extends Go's standard WebAssembly support to handle structs and objects, eliminating the need for manual serialization/deserialization when passing complex data between Go and JavaScript.
WebAssembly interop between Go and JS values.
Vert automatically converts Go structs to JavaScript objects, solving the syscall/js limitation that panics on struct types, as shown in the examples.
Supports struct field tags to define custom JavaScript property names, enabling flexible interop without manual serialization, demonstrated in the tagged fields example.
The AssignTo method returns errors for safe value assignment, providing better reliability compared to panics in the standard library, as highlighted in the error handling section.
Builds upon syscall/js with a minimal API that feels natural to Go developers, adhering to the project's philosophy of seamless standard library extension.
Vert is tightly coupled with Go's WebAssembly ecosystem, making it unsuitable for polyglot projects or those using other languages like Rust for WASM.
The README provides only basic examples, lacking guidance on advanced use cases like nested structs or performance tuning, which could hinder complex implementations.
No benchmarks or details on conversion overhead are provided, which might be a concern for data-intensive applications requiring high-frequency interop.
Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
DOM library for Go and WASM
Library to use HTML5 Canvas from Go-WASM, with all drawing within go code
Run WASM tests inside your browser
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.