WASM/JavaScript bindings for wysiwyg-rust.
cd bindings/wysiwyg-wasm
npm install
npm run build
#npm run 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
These files should be copied into a web project and imported with code like:
<script type="module">
import init, { some_method_from_rust }
from './generated/matrix_sdk_wysiwyg.js';
async function run() {
await init();
some_method_from_rust();
}
run();
</script>
To generate a debugging/profiling Wasm module, use the following command
instead of npm run build
:
$ npm run dev-build