#e1 #standard #73 #publish #esta #bsr #implementers

e173

A library implementing various aspects of the ESTA BSR E1.73 standard

4 releases

0.1.0-alpha.4 Oct 28, 2024
0.1.0-alpha.3 Oct 24, 2024
0.1.0-alpha.2 Oct 17, 2024
0.1.0-alpha.1 Apr 22, 2024

#461 in WebAssembly

MIT license

92KB
2.5K SLoC

E1.73 Support Library

A library implementing various aspects of the ESTA BSR E1.73 standard, and building on it with functionality that is useful to various classes of implementers.

Use in WASM

This library can be used as a standard Rust library, but it is also designed to be compiled to WebAssembly for use in web projects. We compile and publish as an NPM package using the wasm-pack tool.

Building for WASM

You need wasm-pack to build for WASM (see above).

We currently have a custom build script build_wasm.sh in the root of the repo to build the WASM package. This is for two reasons. First, we require a postprocessing step to build the library for WASM, because of our desire to use TypeScript string enums and wasm-bindgen's limitations with them. Second, wasm-pack gets tripped up by the fact that there are multiple crates in this repo, and doesn't copy the right README file to the package.

If you are running on Windows, this script should run in Cygwin or MSYS2, or you can trivially reproduce it as a powershell script or similar.

If you want to develop and test the WASM functionality of the library in a Node environment (e.g. running automated tests for your web project), you currently need a version of wasm-pack newer than the latest release, because the solution for this issue, while merged, has not yet made it into a release.

So for example, to build from source, you can do:

$ cargo install wasm-pack --git https://github.com/rustwasm/wasm-pack.git

Acknowledgments

  • Thanks to Jonathan Kemble for designing the format of the ESTA DMX serializer and the algorithms by which it is translated into a database that is useful for controllers, and for providing the original C++ implementation from which the code in the controller module was largely adapted.
  • Thanks to @MadonoHaru for the Tsify crate, which is integrated into this library as the basis of e173_ts, and helps immensely with generating and type-checking the TypeScript/JavaScript FFI.

Dependencies

~1.4–2.5MB
~50K SLoC