Skip to content

Latest commit

 

History

History
61 lines (46 loc) · 1.14 KB

File metadata and controls

61 lines (46 loc) · 1.14 KB

wysiwyg-wasm

WASM/JavaScript bindings for wysiwyg-rust.

Building

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>

Profiling

To generate a debugging/profiling Wasm module, use the following command instead of yarn build:

$ yarn dev-build