WASM/JavaScript bindings for wysiwyg-rust.
cd bindings/wysiwyg-wasm
yarn
yarn build
#yarn test (no tests yet)
This will generate:
pkg/matrix_sdk_wysiwyg_bg.wasm
pkg/matrix_sdk_wysiwyg_bg.wasm.d.ts
pkg/matrix_sdk_wysiwyg.d.ts
pkg/matrix_sdk_wysiwyg.js
... plus other files
You can then consume these files in your project by linking the package in your package.json:
{
"dependencies": {
"@matrix-org/matrix-sdk-wysiwyg-wasm": "link:../../bindings/wysiwyg-wasm"
}
}
And consume with code like this:
<script type="module">
import { initAsync, some_method_from_rust } from '@matrix-org/matrix-sdk-wysiwyg-wasm';
async function run() {
await initAsync();
some_method_from_rust();
}
run();
</script>
To generate a debugging/profiling Wasm module, use the following command
instead of yarn build
:
$ yarn dev-build