@tdxvolt/volt-ws-protocol-web
v0.1.14
Published
Volt websocket protocol library for web
Downloads
36
Readme
volt-ws-protocol-web
This crate provides a lightweight shim wrapping the volt-ws-protocol library for use in web applications, using the wasm-bindgen crate.
It is used by the volt-client-web package to communicate with the Volt API via websockets in web applications.
We could use the volt-ws-protocol-component in combination with jco
instead of wasm-bindgen to generate the javascript bindings, but the component workflow does not support the js feature of getrandom or the use of chrono for timestamps.
build and publish
To compile and publish the javascript package, run the following commands:
You may want to bump the patch version number in the cargo.toml file.
Compile the Rust code to WebAssembly using wasm-pack:
cd volt-ws-protocol-web
wasm-pack build --release --target web --scope tdxvoltPublish the package to npm:
cd pkg
npm publish --access publicusage
It is unlikely that you will need to use this library directly, use the volt-client-web package instead.
