This module is currently very experimental. It is not currently built standalone and still requires the glue JS to function. Ideally it will be standalone WASM module eventually.
# Run in VW root directory
docker run --rm -v $(pwd):/src -it emscripten/emsdk emcmake cmake -G "Unix Makefiles" --preset wasm -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=/src/ext_libs/vcpkg/scripts/buildsystems/vcpkg.cmake
docker run --rm -v $(pwd):/src -it emscripten/emsdk emcmake cmake --build /src/build --target vw-wasm -j $(nproc)
Artifacts are placed in wasm/out
Assumes required build artifacts are in wasm/out
# Run in VW root directory
docker run --workdir="/src/wasm" --rm -v $(pwd):/src -t node:16-alpine npm install
docker run --workdir="/src/wasm" --rm -v $(pwd):/src -t node:16-alpine npm test
Instructions here: https://emscripten.org/docs/getting_started/downloads.html
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
Make sure Emscripten is activated.
emcmake cmake --preset wasm -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=$(pwd)/ext_libs/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build build --target vw-wasm
npm run build
npm test
npm run docs
- Update the version in package.json
- Run
npm run docs
and check in the newdocumentation.md
if it has changed - Change all version references in README.md (relative links will be broken until merged to master and the tag is cut)
- Update the table in README.md to point to latest VW version and tag
- Commit changes to master
- Tag the release as
wasm_v.major.minor.patch
- Run
cmake
to pick up any newvw-wasm.js
changes - Publish to npm
npm publish --access public
(you need to sign into your npm account first and have access to the vowpalwabbit organisation)